Resize Columns in Excel: Keyboard Shortcuts and Tips

How-to basics · Updated November 20, 2026

In Excel for Microsoft 365 on Windows, select a cell in the column and press Alt, H, O, I—one key after another—to AutoFit its width to the contents. To enter a specific width instead, press Alt, H, O, W, type the value, and press Enter.

What the shortcuts do

Excel offers two different ways to resize a column from the keyboard. AutoFit adjusts the width to suit the displayed contents, while the Column Width command opens a box where you specify a number. The first is useful when you want to make text visible; the second is better when you need consistent, deliberate sizing across a worksheet.

  • AutoFit column width: Alt, H, O, I.
  • Set a numeric width: Alt, H, O, W, then enter a value.
  • AutoFit several columns: select the columns or cells in them first, then use Alt, H, O, I.

These are Ribbon Key Tips, not simultaneous key combinations. Press and release Alt, then press H, then O, then I or W as appropriate. The letters identify commands on the Home tab and its Format menu. If a key-tip display appears on screen, follow it; the letters can differ in localized editions of Office.

AutoFit one column with the keyboard

To size one column based on its contents, click a cell in that column. Press Alt, H, O, I. Excel changes the column width so the longest relevant displayed entry can fit, subject to the worksheet’s formatting and Excel’s width limit. You do not have to select the entire column for this operation.

The command is also available from the Ribbon: choose Home > Format > AutoFit Column Width. This is handy if you forget the key sequence or are using a device without a full keyboard. A mouse alternative is to move the pointer to the right edge of the column letter and double-click the boundary.

For example, if column B contains short product codes near the top and a longer code farther down, AutoFit considers the entries in the column rather than just the selected cell. It can therefore make the column wider than the value on the row you are viewing would suggest.

Set an exact column width

If you need a specific width, select a cell in the target column and press Alt, H, O, W. In the Column Width dialog, type the number you want and press Enter. You can also open the same dialog through Home > Format > Column Width. Excel accepts decimal values, so a width need not be a whole number.

Column width is not a measurement in inches or centimeters. Excel defines it in relation to the character width of the default font used by the workbook, so a value such as 12 is a sizing unit rather than 12 pixels. The visible result also depends on the font and display scaling. Use the dialog when matching columns within a workbook matters more than matching a physical screen measurement.

For instance, if a report has several date columns that should line up visually, select those columns and enter the same width. If the dates then appear as number signs, the columns may be too narrow for the date format; widen them or use AutoFit. The underlying date values remain intact.

Resize several columns together

To apply one width to multiple columns, select them before using either command. For adjacent columns, click the first column letter and drag across the others, or select a cell range spanning those columns. For columns that are not next to each other, hold Ctrl while selecting their column letters. Then use Alt, H, O, I to AutoFit, or Alt, H, O, W to set the same numeric width for the selection.

A keyboard-first way to select a whole column is to click a cell in it and press Ctrl+Space. To select a contiguous group, extend the selection with Shift and the arrow keys, or use the column letters with the mouse. Once selected, a width change applies to every selected column. This is useful for standardizing a table after importing data, though AutoFit can produce different widths for each column if their contents differ.

Be careful when selecting entire columns in a large sheet. If the selection includes columns you did not mean to change, the same command will resize them too. Check the highlighted column letters before applying the width.

How AutoFit decides the width

AutoFit is a content-based adjustment, not a command to make a column a fixed standard size. Excel looks at the cells’ displayed contents and formatting when calculating a suitable width. A long label, a formula result, or a number format that displays many characters can all affect the result. Because formulas are evaluated, the visible result of a formula—not just the formula text—is what matters in an ordinary worksheet cell.

AutoFit is usually a good first step after pasting data or changing a column’s contents. It does not, however, make every value visible in every situation. For example, a cell with Wrap Text enabled may display content on multiple lines, and the ideal width can differ from the width you want for a compact report. A manually chosen width may be preferable when you want consistent columns or controlled line wrapping.

Excel limits a column to a maximum width of 255 characters in its width units. If a very long entry exceeds what can fit, AutoFit cannot make the column unlimited. Consider wrapping the text, widening the column as far as practical, or placing the long description in a separate field.

When AutoFit does not give the expected result

Several worksheet features can make an AutoFit result surprising. Merged cells are a common case: Excel’s standard AutoFit behavior does not reliably size columns to fit text spread across merged cells. If a heading spans several columns, set the individual widths manually or reconsider whether merging is necessary. Center Across Selection is one alternative for centering a heading across cells without merging them.

Wrapped text can also make the result seem wrong. AutoFit Column Width adjusts width, but it is not the same as AutoFit Row Height. If wrapped content is cut off vertically, use Home > Format > AutoFit Row Height or press Alt, H, O, A. The row-height command addresses the height of the row, not the width of the column.

Other useful checks include:

  • Confirm that the column is not hidden. A hidden column has no visible boundary to resize until you unhide it.
  • Check whether a custom number format is making a value display with more characters than expected.
  • Make sure the worksheet is not protected in a way that prevents formatting changes.
  • After changing fonts or pasting formatted content, run AutoFit again if the existing width no longer suits the display.

If a long text value seems to spill into an empty neighboring cell, that does not necessarily mean it is fully visible in the first cell. Text can visually overflow into adjacent blank cells, but content in the neighboring cell, a fill, or other formatting can stop that display. AutoFit or an appropriate fixed width makes the layout more predictable.

Windows, Mac, and Excel for the web

The Alt key sequences above are for Excel for Microsoft 365 on Windows. Excel for Mac has a different keyboard environment. In many Mac editions, Option+Command+0 runs AutoFit Column Width; if that combination is intercepted by macOS or does not work in your build, use the Ribbon command Home > Format > AutoFit Column Width. To set a numeric width on Mac, use Home > Format > Column Width and enter the value.

Excel for the web also provides column resizing through the Ribbon and by dragging or double-clicking the column boundary. Windows desktop Ribbon Key Tips may not behave identically in a browser, because browser shortcuts and the web interface can affect keyboard access. If the desktop sequence is unavailable, use the visible Format command or the column boundary. The underlying goal is the same, but the fastest shortcut depends on the platform.

Choosing AutoFit or a fixed width

Choose AutoFit when the column should respond to its current data, such as a list of names or product descriptions that has just been imported. Choose a fixed width when the worksheet is a report, when aligned columns are important, or when wide entries should wrap rather than expand the layout. Neither approach is universally better: AutoFit prioritizes visibility, while a fixed width prioritizes consistency.

  • Use AutoFit for quick cleanup of ordinary text and numeric columns.
  • Use a numeric width for uniform tables, forms, and print-oriented layouts.
  • Use Wrap Text when a description should remain in a narrow column and occupy additional lines.
  • Review the result after changing fonts, formats, or data, because those changes can alter what fits.

One practical workflow is to AutoFit a newly imported table, inspect columns with unusually long entries, then set those columns to a deliberate width and enable wrapping where appropriate. This avoids letting one lengthy note dictate the width of an entire report.

Frequently Asked Questions

What is the keyboard 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. Excel adjusts the column width to fit its contents.

How do I set an exact column width using the keyboard?
Press Alt, H, O, W, type a width in the Column Width dialog, and press Enter. The value uses Excel’s character-based width units, not pixels or inches.

Can I AutoFit all columns at once?
Yes. Select the worksheet cells or columns you want to adjust, then run Alt, H, O, I. To select the entire worksheet, use the Select All button at the top-left corner between the row and column headings, then apply AutoFit.

Why does AutoFit not work with merged cells?
Excel does not reliably calculate AutoFit width for text spread across merged cells. Set the widths manually, or consider using Center Across Selection for a heading that needs to appear centered without merging cells.

How do I AutoFit a column on a Mac?
Try Option+Command+0 in Excel for Mac. If the shortcut is unavailable or conflicts with a system shortcut, choose Home > Format > AutoFit Column Width from the Ribbon.

Why does Excel show number signs after I resize a column?
Number signs usually mean the formatted number or date still does not fit in the available width. Widen the column, use AutoFit, or choose a shorter number format; the underlying value is generally still present.

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.