In Excel for Microsoft 365 on Windows, select the column or columns, then press Alt, H, O, I in sequence to AutoFit their width. On a Mac, select the columns and press Option+Command+0; you can also use the Home tab’s Format menu or double-click a column boundary.
The Windows shortcut, step by step
The Windows shortcut uses Excel’s ribbon Key Tips. Press and release each key in order rather than holding the whole sequence down: Alt, then H, then O, then I. The sequence opens the Home tab’s Format options and runs AutoFit Column Width. If you see small letters appear over ribbon controls after pressing Alt, that confirms Key Tips are active.
- Select the column headers you want to resize. To select adjacent columns, drag across their lettered headers; to choose separate columns, hold Ctrl while selecting each header.
- Press Alt, H, O, I, one key at a time.
- Check the result and repeat on other columns if needed.
You can also select one cell in each of the columns you want to adjust before using the shortcut. AutoFit changes the width of the affected column or columns, not just the selected cells. The shortcut is useful when you want to keep your hands on the keyboard, while the mouse method is often faster for a single column.
What AutoFit actually changes
AutoFit sets a column’s width to accommodate the widest relevant cell content in that column. Excel measures the displayed contents using the cell’s font and formatting, then adjusts the column width. A heading such as Customer name may therefore make a column wider than the shorter entries beneath it. If a formula returns a long label, the returned text can determine the width just as typed text can.
Excel column width is not a fixed number of pixels. It is based on the width of characters in the workbook’s default font, so the same numeric column-width setting can appear slightly different with different fonts, zoom levels, or display settings. AutoFit is a sizing command, not a formatting command: it does not change the font, wrap text, or shorten the cell value.
AutoFit also does not guarantee that every value will be fully visible in every situation. For example, a cell containing a date or number may show hash marks when the column is too narrow for its formatted display. Widening the column often resolves that display, but if the underlying value is negative or the cell uses an incompatible date format, the cause may be something other than width. Inspect the value and format if AutoFit alone does not fix it.
Choosing which columns to resize
For one column, click its letter at the top of the worksheet before using the shortcut. For several neighboring columns, select the first header and drag across the rest. You can select nonadjacent columns with Ctrl-click on Windows. When you run AutoFit, Excel adjusts each selected column according to the contents it considers in that column; it does not make all selected columns the same width.
To AutoFit every column in a worksheet, click the small Select All button where the row and column headers meet, then use the shortcut. In a worksheet with many columns, this can make the sheet extremely wide if even one cell contains a long note or identifier. A more controlled approach is to select only the columns that need attention, or to resize a specific data table rather than the entire sheet.
For a table with headers, it is often helpful to include the header row in the content being considered. A descriptive header may be longer than the entries beneath it, and you may want it to remain readable. If that heading creates an impractically wide column, consider wrapping the header, shortening its wording, or setting a deliberate width instead of letting one label dictate the layout.
Keyboard, mouse, and ribbon methods compared
The shortcut is only one way to run the same AutoFit command. Each method suits a slightly different situation:
- Keyboard: Alt, H, O, I on Windows is efficient for repeated adjustments and does not require locating a narrow boundary.
- Mouse: Double-click the right edge of a column-letter header to AutoFit that column. To adjust multiple selected columns, double-click the boundary of one selected column header.
- Ribbon: Select the columns, then choose Home > Format > AutoFit Column Width. This is easy to discover and helpful when you do not remember the shortcut.
- Manual sizing: Drag a column boundary to a width you choose. This is not AutoFit, but it gives you control when the automatic result is too wide or too narrow.
When dragging, the width indicator appears as you move the boundary. Double-clicking the boundary instead asks Excel to calculate an appropriate width from the content. If you select several columns and drag a boundary, Excel gives the selected columns the same manually chosen width; AutoFit, by contrast, can give each one a different width.
Why AutoFit can produce an unexpected result
A single unusually long entry can make a column much wider than the rest of the table. This is common with full URLs, long product descriptions, file paths, or pasted text. Before AutoFitting an entire sheet, scan for outliers. If one value is important but does not need to appear on one line, wrapping it or setting a maximum practical width may make the sheet easier to read.
Merged cells are another common complication. AutoFit does not reliably calculate a useful width from text spread across a merged range, because that text occupies multiple columns as one combined area. If a merged heading is clipped, you can unmerge the cells and use Center Across Selection, resize the columns manually, or place the heading in a suitable cell without merging. This is usually a layout issue rather than a broken shortcut.
Wrapped text affects the presentation in a different way. AutoFit Column Width may make a column wider to fit text on one line, which can defeat the purpose of wrapping. If you want a narrow column with several lines of text, keep a deliberate width and use Home > Wrap Text; then adjust row height if necessary. AutoFit Row Height is a separate command and does not replace AutoFit Column Width.
Hidden columns remain hidden when you run AutoFit on visible columns; AutoFit does not unhide them. Similarly, a protected worksheet may prevent changes to column widths depending on its protection settings. If the command appears to do nothing, check whether the columns are hidden, the sheet is protected, or the selected area is what you intended.
When to use a fixed width or wrap text instead
AutoFit is useful for quickly making ordinary labels and values visible, especially after importing data or editing headers. It is less suitable when a worksheet needs a consistent visual grid. For example, a report with several months of figures may look cleaner when all month columns share the same width, even if one month’s heading could fit more tightly than another. In that case, select the columns and set a common width manually.
Wrapping text can be preferable for long descriptions or headings. Select the cells, choose Home > Wrap Text, and set a sensible column width. Excel then displays the content on multiple lines within the cell. Row height may increase to show the wrapped lines; if it does not, use Home > Format > AutoFit Row Height or adjust the row height manually.
For a polished worksheet, it can help to separate data visibility from print layout. A very wide column may be convenient while reviewing data on screen but cause extra printed pages. Before printing, check the page layout and print preview. You may prefer wrapping long text, using a smaller but readable width, or adjusting the print scaling rather than allowing every column to expand to its longest entry.
Excel on Mac and Excel for the web
In Excel for Microsoft 365 on Mac, select the column or columns and use Option+Command+0 for AutoFit Column Width. If that key combination is unavailable on a particular keyboard or conflicts with a system setting, use the ribbon instead: select the columns and choose Home > Format > AutoFit Column Width. You can also double-click a column boundary, as on Windows.
Excel for the web runs in a browser, where keyboard shortcuts can be affected by the browser or operating system. If Alt, H, O, I does not trigger the command, select the columns and use the Home tab’s Format menu to choose AutoFit Column Width, or double-click the column boundary. The mouse and ribbon methods are straightforward alternatives and do not depend on remembering the desktop Key Tip sequence.
Frequently Asked Questions
What is the shortcut to AutoFit a column in Excel for Windows?
Select the column, then press Alt, H, O, I in sequence. These are ribbon Key Tips, so tap and release each key rather than pressing all four together.
Does AutoFit work on more than one column at once?
Yes. Select multiple column headers, then run the AutoFit command. Excel sizes each selected column independently according to its contents; it does not make them all equal in width.
How do I AutoFit all columns in a worksheet?
Click the Select All button at the intersection of the row and column headers, then use Alt, H, O, I on Windows. Review the result afterward, since a long entry in one column can make the entire sheet substantially wider.
Why does AutoFit not fix text in merged cells?
Excel cannot reliably derive one column width from text that spans a merged range. Unmerge the cells, use a manual width, or use a layout option such as Center Across Selection if the heading needs to span columns.
Is AutoFit the same as wrapping text?
No. AutoFit changes column width to accommodate content, while Wrap Text keeps the width and displays longer content on additional lines. Use wrapping when you want a controlled, narrower column.
A practical way to finish a worksheet
For a quick cleanup, start with the columns containing clipped headings or values rather than automatically resizing everything. Select those columns, run the Windows shortcut or the matching Mac command, and check whether long entries have created excessive width. Then decide whether the outliers should remain on one line, wrap, or use a manually chosen width. This small review matters because AutoFit optimizes for visibility of content, not for a particular screen layout, print page, or visual design.
In short, the Windows sequence is Alt, H, O, I; the Mac shortcut is Option+Command+0. The ribbon route and double-click method perform the same basic sizing task, while manual width and Wrap Text give you more control when an automatic fit is not the best layout.
Related
- Excel Data Validation List With Color
- Excel Data Validation Methods: Rules, Lists, and Tips
- Excel Data Validation List from a Table: How to Set It Up
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Scatter Plot Worksheet: Build and Read One in ExcelA scatter plot worksheet organizes paired numerical data and displays each pair as a point, making it easier…
- Excel Cannot Open the File: Causes, Checks, and FixesYes—Excel may be able to open a file that it says is corrupted, but the message does not…
- Compare Two Files in Word: Step-by-Step GuideTo compare two files in Microsoft Word, open Word and choose Review > Compare > Compare on Windows,…
- Share a Specific Calendar in Outlook: Access and StepsTo share one calendar in Outlook, select that calendar—not just the Calendar view—open its sharing settings, add the…
- How to Insert a Checkbox in Word 365To add a clickable checkbox in Word 365 for Windows, turn on the Developer tab, then choose Developer…
- How to Highlight a Box in ExcelTo highlight a box in Excel, select the cell or rectangular range, then choose Home > Fill Color…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.