Excel Keyboard Shortcut to Resize a Column or AutoFit

How-to basics · Updated November 2, 2026

Excel Keyboard Shortcut to Resize a Column or AutoFit

In Excel for Microsoft 365 on Windows, select a cell in the column and press Alt, H, O, I to AutoFit its width to the contents. Press the keys in sequence, not all at once; to enter a specific width instead, use Alt, H, O, W, type the width, and press Enter.

The quickest way to resize a column

AutoFit is the usual answer when a column is too narrow to show its contents. Click a cell in the column, then press Alt, H, O, I. Excel adjusts the column so the widest displayed entry in it can fit, subject to Excel’s column-width limit. You can also select several columns first, then use the same shortcut to AutoFit each selected column.

The letters are ribbon Key Tips: Alt activates the ribbon shortcuts, H opens the Home tab, O opens the Format menu in the Cells group, and I chooses AutoFit Column Width. Tap each letter after the previous key; do not hold Alt and type the whole sequence as if it were a single chord. If a Key Tip shown on your screen differs, follow the letters displayed in your Excel version.

  • AutoFit: Alt, H, O, I
  • Set a numeric width: Alt, H, O, W, then enter a value and press Enter
  • AutoFit row height: Alt, H, O, A

What AutoFit changes—and what it does not

AutoFit changes the width of a column, not the size of its font or the height of its rows. Excel considers the displayed contents in the column, including calculated results in formula cells, and sizes the column to accommodate the widest relevant entry. A formula that displays 125.00 is fitted according to what appears in the cell, not the length of the formula typed into the formula bar.

Column width is not measured in pixels or inches in the Format Column Width box. It is based on character units associated with the workbook’s Normal style font, with additional spacing. That is why a width such as 10 does not mean exactly 10 characters for every possible font and character. The visible result can also vary with zoom and display scaling, even though the stored column width is unchanged.

AutoFit is not the same as making every column the same width. When you AutoFit a group of selected columns, each column is sized according to its own contents, so the results may differ. It also does not necessarily make a spreadsheet easier to read: a single long note or URL can make one column very wide. In that case, a deliberate fixed width plus text wrapping may be a better layout.

Use the keyboard to set a specific width

If you want consistent columns rather than a fit to the longest entry, select the column or columns and press Alt, H, O, W. Enter a number in the Column Width box and press Enter. For example, entering 12 sets the selected columns to a width of 12 character units. The result is a fixed width; Excel will not keep expanding it if you later add longer content.

Exact widths are useful in reports where a table should look balanced, or when several columns need to align visually. You can also type a width by opening the Format menu on the Home tab and choosing Column Width. If the box is unavailable or the sheet will not change, check whether the worksheet is protected or whether the selected range includes columns that cannot be formatted under the current protection settings.

To return a fixed-width column to a content-based width, use Alt, H, O, I again. AutoFit replaces the set width with a new estimate based on the current cell contents. If you later edit a value and the column becomes too narrow, run AutoFit again; Excel does not automatically resize columns every time their contents change.

Select the right columns before resizing

The shortcut acts on the selected column or columns. To resize just one, click any cell in it. To select the entire column, click its letter heading. On Windows, Ctrl+Space selects the column containing the active cell; then use the resize shortcut. If the active cell is inside an Excel table, Ctrl+Space can select table columns before another press selects the worksheet column, so check the highlighted area before formatting.

For a continuous block, select a cell in the first column and drag across the column headings, or click the first heading and Shift-click the last. For columns that are not next to one another, select one and then use Ctrl-click on additional column headings. Once the intended columns are selected, AutoFit or set their width in one operation.

Selection matters when you want a consistent width. If you select three columns and enter 12 in the Column Width box, all three receive the same width. If you select the same three columns and choose AutoFit, Excel calculates a separate width for each one. This distinction is useful when preparing a structured data table: choose a numeric width for a uniform layout, and AutoFit when the contents should determine each column’s size.

Mouse and ribbon alternatives

You do not need the keyboard shortcut to resize a column. To AutoFit one column with the mouse, move the pointer to the right edge of its letter heading until the resize cursor appears, then double-click. Excel adjusts the column to fit its contents. Double-clicking the boundary between two selected headings can AutoFit the selected columns as well.

To set a width by dragging, point to the right edge of a column heading and drag it left or right. A small width indicator appears while you drag. This is quick for visual adjustments, but it is less precise than entering a number when you need a repeatable width.

The ribbon route is Home > Format > AutoFit Column Width. To enter a value, choose Home > Format > Column Width. These commands are useful when you cannot remember the Key Tip sequence, when keyboard shortcuts are intercepted by another program, or when you want to confirm the command name before using it.

Common AutoFit problems and fixes

If AutoFit makes a column unexpectedly wide, look for a long value anywhere in that column, including rows far below the area currently visible. A long description, unbroken string, or web address can determine the width even when most cells contain short values. Consider setting a fixed width, wrapping the text, shortening the displayed content, or placing long notes in a separate column.

For a wrapped cell, column width and row height are separate settings. AutoFit Column Width does not mean “fit all wrapped text into a compact table”; it may widen the column, while the row’s height determines how many wrapped lines are visible. To fit the row height to wrapped text, use Alt, H, O, A, or choose Home > Format > AutoFit Row Height. If you want a narrow column, set its width first, turn on Wrap Text from the Home tab, and then AutoFit the affected row height.

Merged cells are another frequent source of confusion. AutoFit may not size columns as expected when the text is in a cell merged across multiple columns. A practical alternative is to set the relevant column widths manually or use a single unmerged cell for the text. Merging cells can also complicate sorting and selecting data, so it is often better reserved for headings rather than the body of a sortable table.

Also check for hidden columns, worksheet protection, and formatting that changes how values display. A number formatted as a date or currency may need more space than the raw number would suggest. If a cell shows hash marks, such as ####, the column may be too narrow for the formatted value; widening the column or applying a shorter number format often resolves it. For a date or number that still appears as a hash-mark sequence after AutoFit, check whether the value or format is valid for the cell type.

Excel for Mac and Excel for the web

On Excel for Mac, the documented AutoFit Column Width shortcut is Option+Command+0. Shortcut availability can depend on the Mac keyboard layout and system settings, so if it does not work, use the ribbon command instead. The menu route is available through the Home tab’s Format menu; select AutoFit Column Width. To enter a chosen width, use the Column Width command in the same menu.

Excel for the web also provides AutoFit through the ribbon, but keyboard sequences can be affected by the browser and by how the web app handles Key Tips. If the Windows sequence does not produce the expected command, use Home > Format > AutoFit Column Width in the web interface. The mouse method—double-clicking the boundary between column headings—is another straightforward option where supported.

These instructions concern Microsoft Excel. Other spreadsheet programs may use different shortcuts or label the command differently. If you work across desktop and web versions, the ribbon command names are often easier to recognize than relying on the same keystroke working identically in every environment.

Frequently Asked Questions

What is the shortcut to AutoFit a column in Excel?
In Excel for Microsoft 365 on Windows, select a cell in the column and press Alt, H, O, I in sequence. You can also select several columns first to AutoFit each one.

How do I make all Excel columns the same width?
Select the columns, press Alt, H, O, W, enter a width, and press Enter. This gives each selected column the same fixed width; AutoFit instead sizes each column individually.

Can Excel automatically resize a column when I enter longer text?
No. AutoFit runs when you choose the command; Excel does not continuously resize a column as cell contents change. Run AutoFit again after an edit, or set a width that anticipates the expected entries.

Why does AutoFit make my column too wide?
A long entry somewhere in the column may be controlling the result, even if that row is off screen. Find the unusually long value, then use a fixed width, wrap the text, or move that content to a separate column.

What is the Mac shortcut to resize a column in Excel?
Option+Command+0 is the Mac shortcut for AutoFit Column Width. If the shortcut is unavailable on your keyboard or conflicts with system settings, use the Home tab’s Format menu.

Does AutoFit work with merged cells?
Not reliably for text in merged cells spanning multiple columns. Set the widths manually or avoid merging cells in data areas where predictable sizing, sorting, or filtering matters.

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.