Excel Shortcut to Expand All Columns to Fit Contents

How-to basics · Updated November 2, 2026

Excel Shortcut to Expand All Columns to Fit Contents

In Excel for Microsoft 365 on Windows, select the whole worksheet and press Alt, H, O, I in sequence to AutoFit the selected columns to their contents. To select the sheet reliably, click the Select All button—the small triangle where the row numbers and column letters meet—before using the shortcut.

The Windows shortcut and what it does

Alt, H, O, I is a sequence of ribbon access keys, not four keys pressed simultaneously. Press and release each key in order. The sequence opens the Home tab’s Format menu and chooses AutoFit Column Width. Excel adjusts the width of the selected columns so their contents are easier to read.

For the whole worksheet, click the Select All button at the upper-left corner of the grid first, then enter the sequence. This avoids a common selection mistake: Ctrl+A can select only the current data region on its first press, and its behavior can vary inside an Excel table. In an ordinary worksheet, pressing Ctrl+A again may expand the selection to the whole sheet, but the Select All button is the clearest method when you mean every column.

The command changes column widths; it does not change row heights, font sizes, or the values in cells. It also does not make the text larger. If you need to fit only a few columns, select those columns instead of the whole worksheet, then use the same access-key sequence.

Use the ribbon or the column boundary

The keyboard sequence corresponds to a visible command, which is useful if you forget the keys or prefer the mouse. Select the columns or worksheet, then choose Home > Format > AutoFit Column Width. The Format menu also contains Column Width, where you can enter a specific width rather than letting Excel calculate one.

For a quick adjustment with a mouse, select the columns you want to resize and double-click the boundary between any two selected column letters. For example, to fit columns B through D, select their column headers and double-click the divider between B and C, or between any adjacent selected columns. Excel applies the AutoFit action to the selected columns. Dragging a boundary instead sets a width manually; it does not calculate the best fit.

  • AutoFit: double-click a selected column boundary or use Home > Format > AutoFit Column Width.
  • Manual width: drag a boundary, or use Home > Format > Column Width and enter a value.
  • Whole worksheet: click Select All before running AutoFit.

How Excel decides the width

AutoFit estimates the width needed to display cell contents in the selected columns. A long heading, date, number, or formula result can determine the width of its column. For instance, if column A contains short department names but one cell contains “Customer Support Operations,” Excel may widen the entire column to accommodate that longer entry. Other cells in the same column will have extra space as a result.

Excel sizes columns in relation to the workbook’s font settings and displayed content, rather than using a universal pixel width. That is why the same numeric column width can look different if the font or display settings change. Formula cells are sized according to their displayed results, not the formula text shown in the formula bar. Number formats also matter: a formatted date or currency value may need more space than the underlying stored number.

AutoFit is a calculation for the current contents, not a permanent rule that keeps recalculating the width whenever the data changes. If you later enter a longer value, the column may need to be AutoFit again. Similarly, deleting the longest entry does not necessarily shrink the column automatically; run AutoFit again if you want Excel to recalculate a narrower width.

Fit every column without changing the data

To resize all columns in a normal worksheet, use this sequence:

  1. Click the Select All button at the corner above row 1 and left of column A.
  2. Press and release Alt, then H, then O, then I.
  3. Review the sheet and adjust any unusually wide columns manually if needed.

This changes widths across the sheet, including columns that appear empty. Empty columns usually remain at a minimal width, but selecting the entire worksheet can still affect columns beyond the table you intended to format. If your data occupies only A through F, selecting just those columns is often a better choice: click the A header, then drag across to F, and run AutoFit. That keeps unrelated parts of the worksheet unchanged.

When only a specific range of cells is selected, Excel applies AutoFit to the columns containing that selection. If the goal is to size a complete column based on all its entries, select the column header rather than just a few cells in it. This matters when data farther down the sheet contains a longer value than the visible rows.

AutoFit versus wrapping and manual sizing

AutoFit is useful when the priority is seeing the full value on one line, but it can produce very wide columns. For long descriptions, notes, or addresses, Wrap Text is often a better choice. Wrapping keeps the column narrower and displays the content on multiple lines, which usually increases row height instead of making the column extremely wide.

For example, a table with product names and short quantities may benefit from AutoFit on both columns. A comments column containing full sentences may be more readable with a fixed, moderate width and Wrap Text enabled. You can combine approaches: AutoFit short identifier columns, set a deliberate width for long-text columns, and wrap text in those cells.

There is also a practical limit to how wide a column can be. Excel’s maximum column width is 255 characters, measured according to the workbook’s font metrics. Very long content will not turn into an unlimited-width column. If a column reaches its limit or becomes awkward to navigate, use wrapping, a smaller font, or a different layout rather than expecting AutoFit to make every entry fit on one line.

Common reasons columns still look cut off

If AutoFit does not appear to solve the problem, check how the cells are formatted and whether the columns are available to resize. These cases often explain the result:

  • Wrapped text: a wrapped cell is designed to occupy multiple lines. AutoFit may not widen it as you expect; set the width deliberately and adjust row height if necessary.
  • Merged cells: AutoFit does not reliably size columns based on the content of merged cells. Unmerge the cells or set the width manually, if changing the layout is acceptable.
  • Hidden columns: AutoFit is not the same as unhide. If a column is hidden, unhide it first when you want it visible, then size it.
  • Long text: a single lengthy entry can make a column much wider than the rest of the table. Wrap that entry or choose a manual width.
  • Numbers displayed as hash marks: a series of ##### often means the column is too narrow for a numeric value or date. AutoFit may help, but an invalid or negative date/time can also display hash marks.
  • Content that appears to overflow: text may spill visually into an adjacent blank cell. If the neighboring cell contains data, the text cannot overflow into it and may look clipped even though the column width has not changed.

Also check whether the longest content is actually in the column you selected. A short selection of visible cells will not necessarily represent longer entries elsewhere, so select the complete column or whole sheet when you need a full-data calculation.

Excel for Mac and Excel for the web

On Excel for Mac, the Windows ribbon sequence is not the shortcut to rely on. The AutoFit Column Width shortcut is Option+Command+0 in Excel for Mac, although keyboard shortcuts can be affected by macOS settings or keyboard layouts. You can use the ribbon command instead: select the columns and choose Home > Format > AutoFit Column Width.

In Excel for the web, ribbon access keys and available keyboard behavior can depend on the browser and keyboard configuration. If Alt, H, O, I does not invoke the command, select the columns and use the Home tab’s Format menu, or double-click a selected column boundary. The mouse method is a practical fallback across desktop and browser versions.

When to use AutoFit—and when not to

AutoFit works well for lists where entries are relatively short and users need to read complete values, such as names, dates, order IDs, or headings. It is especially helpful after importing data, pasting new records, or changing a font, because those actions can leave columns too narrow for their current contents.

It is less suitable as a blanket formatting choice for large reports. One unusually long note can expand a column across the entire sheet, making other columns harder to see without horizontal scrolling. In a carefully designed report, consistent widths may be more useful than widths calculated from every outlier. Consider setting widths for the main table and wrapping long descriptions instead of AutoFitting every column.

AutoFit adjusts layout, not the underlying data. It does not delete text, change number formats, or make the workbook’s content more concise. If a value is genuinely too long for a readable table, a better fix may be to shorten the display text, move detailed notes to another column, or use a wider page layout for printing.

Frequently Asked Questions

What is the shortcut to AutoFit all columns in Excel?
Select the whole worksheet, then press and release Alt, H, O, I in Excel for Microsoft 365 on Windows. The sequence runs AutoFit Column Width for the selected columns.

Can I AutoFit only selected columns?
Yes. Select the column headers you want to resize, then use Alt, H, O, I, or double-click a boundary between selected column letters. Only the selected columns are adjusted.

Why does AutoFit make one column extremely wide?
Excel sizes a column to accommodate its longest relevant displayed content. Look for an unusually long heading, note, or value. Set that column to a deliberate width and use Wrap Text if showing the full entry on one line is not practical.

Does AutoFit work with merged cells?
Not reliably. Merged cells can prevent Excel from calculating an appropriate width automatically. Unmerge the cells where suitable, or set the column width manually.

How do I fit the row height as well?
AutoFit Column Width changes columns, not rows. To fit selected row heights, use Home > Format > AutoFit Row Height. Wrapped text may need row-height adjustment to show all its lines.

Can I undo an AutoFit change?
Usually, yes: press Ctrl+Z on Windows immediately after the change. If you have made other edits since then, undo may reverse those edits first. You can also set a column width manually if you want a different result.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.