In Excel for Microsoft 365 on Windows, select the column or columns, then press Alt+H, O, I in sequence to AutoFit their widths. You can also double-click the right edge of a column heading to fit that column to its contents.
The Windows shortcut and what it does
AutoFit Column Width changes a column’s width so that its contents are easier to read without manually dragging the column boundary. The Windows shortcut uses Excel ribbon Key Tips: press and release Alt, then press H, O, and I, one after another. Do not hold all four keys down at once. The letters identify the Home tab, the Format menu, and AutoFit Column Width.
The command resizes each selected column separately, using the content Excel finds in that column. It does not make all selected columns the same width. That distinction is useful when, for example, a table has a short ID column, a longer customer-name column, and a date column.
- Alt+H, O, I: AutoFit the width of the selected column or columns.
- Alt+H, O, A: AutoFit the height of the selected row or rows.
- Double-click a column boundary: Fit that column without using the ribbon sequence.
How to AutoFit one or several columns
For one column, click its letter heading, such as B, and use the shortcut. You can also point to the divider between its heading and the next one; when the pointer becomes a resize cursor, double-click. Excel adjusts the column to show its contents, subject to its maximum width and other limitations.
To fit several columns, select their letter headings first. Drag across adjacent headings, or click one heading and then Ctrl-click additional headings on Windows to select nonadjacent columns. Run the shortcut after the selection is in place. Each selected column is fitted independently, so a wide text field does not force every other selected column to the same width.
To fit the whole worksheet, click the triangle at the top-left corner of the sheet, where the row numbers and column letters meet, and use the shortcut. Ctrl+A can also select worksheet cells; depending on where the active cell is, you may need to press it more than once to select the whole sheet. Selecting all columns is usually a clearer choice when the goal is specifically to resize every column.
- Select the column headings you want to resize.
- Press Alt, then H, then O, then I.
- Review the result and manually adjust any column that should be wider or narrower for presentation.
What Excel uses to calculate the width
AutoFit looks at the displayed contents of cells in the selected columns and chooses a width intended to show the longest relevant entry. A formula cell is sized according to its displayed result, not the formula text. For example, a cell containing a formula that returns a long department name needs more room than one returning a short code.
Width is not simply a count of characters. Excel measures column width in units related to the width of a zero character in the workbook’s Normal style font, then displays that width in screen pixels. Font choice and formatting can therefore affect the fit. A column that fits text in one font may need a different width after a font change, and the same stored width can look different at a different zoom level or display scale.
Number formats matter too. A date displayed as 2-Nov-2026 takes more space than the same underlying date displayed as 11/2/26. AutoFit responds to what the cell displays. For a column of numbers, the formatted value, including separators, decimal places, or a currency symbol, can affect the width. If you change the format after fitting, run AutoFit again if the values no longer fit.
AutoFit is different from Wrap Text
AutoFit Column Width makes a column wider to accommodate its contents. Wrap Text keeps the column relatively narrow and places long content on multiple lines within a cell. These options solve different layout problems: widening is often suitable for short labels and codes, while wrapping can be better for long descriptions in a report or a table with a fixed page width.
To wrap text, select the cells and choose Home > Wrap Text. If wrapped text is clipped vertically, use Home > Format > AutoFit Row Height or the row-height shortcut. A column can be wide and still have Wrap Text enabled, so check both settings if a cell appears unexpectedly tall or narrow.
For example, a short product name may become readable with AutoFit alone. A paragraph-length product description could make its column impractically wide; wrapping that column and fitting row heights is more likely to keep the worksheet usable. You can also set a deliberate width by dragging the boundary or choosing Home > Format > Column Width.
Common reasons the result looks wrong
AutoFit is a sizing command, not a guarantee that every cell will look ideal in every layout. If a column remains too narrow, becomes much wider than expected, or still shows clipped values, check the contents and formatting that Excel is using.
- A distant cell has long content: Excel may widen the column because of a long entry farther down the sheet than the visible table. Look through the selected column, including rows below the current data, before deciding the result is a mistake.
- The cell contains a merged range: AutoFit does not reliably calculate the required width for merged cells. Unmerge the cells and fit the column, or set a suitable width manually; where appropriate, use Wrap Text and adjust row height.
- You see hash marks: A series of #### often means a number, date, or time cannot fit in the current width, so AutoFit may help. But hash marks can also occur with certain negative date or time values. Check the value and its number format as well as the column width.
- Only part of the sheet was selected: The shortcut changes selected columns, not every column that happens to be visible. Select the intended headings before running it.
- The column is hidden: A hidden column has no visible width to adjust. Unhide it first, then select it and use AutoFit.
- The result is wider than you want: A long note or unusually large value can drive the fit. Use Wrap Text, shorten the displayed text, or set a narrower width manually.
Width limits and worksheet design
Excel column width has a maximum of 255 characters in its width scale. AutoFit cannot make a column wider than that limit. Even below the maximum, fitting a very long entry can make a worksheet difficult to navigate, so the widest possible result is not always the best design choice.
AutoFit is a one-time adjustment. If someone later enters a longer value, pastes new data, changes a formula result, or applies a wider number format, Excel does not continuously refit the column. Run the command again when the content changes, or choose a fixed width that suits the expected range of values.
Before sharing or printing a sheet, consider the reading context. On-screen, a wide column may be manageable with horizontal scrolling; on a printed page, it can push other columns onto another page. A practical workflow is to AutoFit for an initial readable size, then use Wrap Text or a deliberate width for columns with long descriptions.
Menu options and Mac or web alternatives
If you prefer the ribbon, select the columns and choose Home > Format > AutoFit Column Width. This is also a dependable route if a keyboard shortcut is intercepted by another application or if you are unsure whether the correct columns are selected.
In Excel for Mac, the Windows Alt Key Tip sequence is not the equivalent shortcut. In supported Excel for Mac versions, use Option+Command+0 for AutoFit Column Width; if macOS or your keyboard setup intercepts it, select the columns and use Home > Format > AutoFit Column Width. Double-clicking a column-heading boundary is another option.
Excel for the web has a ribbon command for AutoFit Column Width, but browser and operating-system shortcuts can affect keyboard behavior. If the Windows sequence does not activate the command in your browser, select the columns and use the Home tab’s Format menu, or double-click the column boundary. The ribbon command is the most direct alternative when shortcut handling varies.
Frequently Asked Questions
What is the shortcut to AutoFit column width in Excel?
In Excel for Microsoft 365 on Windows, select the columns and press Alt, H, O, I in sequence. This opens the Home tab’s Format options and applies AutoFit Column Width.
Can I AutoFit all columns at once?
Yes. Select the entire worksheet using the top-left corner button, then press Alt, H, O, I. Excel fits each column based on its contents. Review the result because one unusually long entry can make a column very wide.
How do I AutoFit a column without a keyboard shortcut?
Double-click the right boundary of the column heading. Or select the column and choose Home > Format > AutoFit Column Width. Both methods resize the column to fit its displayed contents.
Why does AutoFit not work with merged cells?
Excel does not reliably determine an AutoFit width for merged cells. Unmerge the range and fit the column, or set the width manually. Wrapping the text and adjusting the row height can help when the merged layout must remain.
Does AutoFit change the width automatically when data changes?
No. AutoFit applies a width once; it does not keep monitoring the column. Run it again after content or formatting changes, or choose a fixed width that accommodates typical entries.
Related
- How to Open Solver in Excel and Enable the Solver Add-in
- Find Solver Parameters in Excel and Understand Each One
- How to Find a Z-Score Using Excel Solver Step by Step
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Keyboard Shortcut to Remove Decimal PlacesIn Excel for Microsoft 365 on Windows, select the cells and press Alt+H, 9 to show one fewer…
- Excel Subtotal Rows in Color: How to Highlight ThemTo color subtotal rows in Excel, use conditional formatting with a rule that recognizes each subtotal row, then…
- Excel Shortcut Between Sheets: Windows, Mac, and WebIn Excel for Microsoft 365 on Windows, press Ctrl+Page Up to move to the previous sheet tab, or…
- Conditional Formatting Excel Dates Overdue: How to Set It UpTo highlight overdue dates in Excel, select the cells to format and create a formula-based conditional formatting rule.…
- Excel Not Letting You Put a 0 in Front of a Number?Excel removes a leading zero when it interprets what you type as a number. To keep the zero…
- Excel: Calculate the Length of Time Between Two DatesTo find the elapsed number of days between two dates in Excel, subtract the earlier date from the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.