To autofit columns in Excel for Microsoft 365 on Windows, select the column or columns, then press Alt, H, O, I in sequence—not all at once. Excel adjusts each selected column to fit its longest visible cell entry. You can also use Home > Format > AutoFit Column Width. Before starting, decide whether to resize a few columns or the whole worksheet.
What You’ll Need
- An Excel workbook open in the desktop version of Microsoft Excel for Microsoft 365 on Windows.
- At least one column containing text, numbers, dates, or formula results that you want to make easier to read.
- Optional: a selection of column headers if you want to autofit only specific columns.
AutoFit changes column width, not the font size or cell contents. The result is based on the widest displayed entry in each selected column, plus a little spacing. If the worksheet contains long descriptions, autofitting may make a column very wide; you can choose a smaller selection or use wrapping instead.
Step-by-Step
- Open the worksheet and identify the columns. Click the sheet tab that contains the data. Look at the column letters across the top of the grid and decide which columns need adjustment. If a cell shows a row of number signs, such as
#####, its column may be too narrow to display a number or date; AutoFit is a useful first fix. Save the workbook before making broader layout changes if you want an easy way to revert to the original file. - Select the column or columns to resize. For one column, click its letter header, such as
B. For adjacent columns, drag across their letter headers or click the first header and Shift-click the last. For separate columns, holdCtrlwhile clicking each header. Selecting headers makes it clear that you are resizing whole columns rather than only changing the active cell. To select every column on the sheet, click the small Select All triangle at the intersection of the row numbers and column letters. - Run the Windows keyboard shortcut. Press and release
Alt, then pressH,O, andI, one after another. These are ribbon access keys for Home, Format, and AutoFit Column Width. Do not hold all four keys down together. Excel calculates a suitable width for each selected column using the displayed contents. Check the result before continuing, especially if you selected the whole worksheet. - Use the ribbon if you prefer clicking. Keep the columns selected, open the Home tab, and choose Format in the Cells group, then AutoFit Column Width. This performs the same operation as the shortcut and is useful if your keyboard layout or ribbon configuration makes access keys inconvenient. If you do not see Format immediately, look in the Cells group on the right side of the Home ribbon.
- Use the header boundary for a quick mouse adjustment. Select one or more column headers, then move the pointer to the right edge of a selected column letter until it becomes a horizontal resize pointer. Double-click the boundary to autofit the selection. For a single column, double-clicking its right edge is often the fastest method. A normal click-and-drag on that boundary sets a manual width instead; it does not calculate an AutoFit width.
- Review the result and adjust the layout if needed. Scroll through the relevant rows and check long entries, dates, and calculated values. If one lengthy cell makes a column impractically wide, undo immediately with
Ctrl+Z, select a smaller range, or use Wrap Text and adjust row height. AutoFit sets a width based on cell contents; it does not guarantee that the sheet will fit on a printed page or on one screen.
On a Mac, the Windows Alt, H, O, I sequence does not apply as written. Select the column headers and use Home > Format > AutoFit Column Width, or double-click a selected column boundary. In Excel for the web, use the Home ribbon’s Format menu; browser and keyboard settings can affect access-key behavior, so the menu is the dependable option.
Common Mistakes
- Pressing the shortcut as a chord. The Windows keys are sequential ribbon access keys. Tap
Alt, release it, then continue withH,O, andI. Holding them together may trigger a different action or do nothing. - Selecting cells when you mean to select columns. AutoFit can apply to columns intersecting a cell selection, but selecting the letter headers removes ambiguity and makes it easier to see what will change. This matters particularly when you intend to resize nonadjacent columns.
- Autofitting the entire sheet without checking its contents. One long note or URL can create an extremely wide column. Select only the columns that need attention, or use wrapping for prose. If you did autofit everything, use
Ctrl+Zright away to restore the previous widths. - Expecting AutoFit to fix every display problem. A narrow column is one cause of clipped content, but merged cells, text wrapping, custom number formats, and row height can affect what you see. AutoFit Column Width does not automatically enlarge row height or make merged-cell text fit.
- Confusing AutoFit with a manual width. Dragging a boundary lets you choose a width by eye. Double-clicking the boundary or choosing AutoFit Column Width asks Excel to calculate the width from cell contents. Use the method that matches your goal.
Tips
- Autofit after entering or changing data. Excel does not always keep a manually adjusted width in sync with later edits. If you add a longer entry, run AutoFit again on that column or double-click its right boundary.
- Use Wrap Text for long descriptions. Select the relevant cells and choose Home > Wrap Text. Text can then continue on additional lines within a narrower column. If necessary, use Home > Format > AutoFit Row Height to display the wrapped lines. This is often more readable than a very wide column.
- Resize several columns in one pass. Select the headers of the columns you want, then use the shortcut once. Each column is measured separately; Excel does not make all selected columns the same width. For columns that should match, set one width manually and apply it consistently instead.
- Keep headings in mind. A long heading may be the widest item in a column, so AutoFit can make the column wider than the data underneath requires. Consider shortening the heading, wrapping it, or choosing a practical manual width after fitting the data.
- Use the Select All corner when appropriate. Clicking the triangle above row 1 and left of column A selects the worksheet grid. Then run AutoFit to fit all columns. This is useful for a small, tidy sheet, but inspect the result because hidden content far down the sheet can affect a column’s width.
- Remember the separate row command. If the problem is that wrapped text is cut off vertically, select the affected rows and choose Home > Format > AutoFit Row Height. On Windows, the corresponding access-key sequence is
Alt,H,O,A. This is not the column-width shortcut.
Troubleshooting
The shortcut does nothing: Make sure Excel, rather than a cell editor or another application, has focus. Press Esc once if you are editing a cell, click a column header, and try the sequence again, releasing each key before the next. If your keyboard or system intercepts ribbon access keys, use Home > Format > AutoFit Column Width instead.
The column stays too narrow: Confirm that you selected the intended column and that the cell is not merged across multiple columns. Merged cells can prevent AutoFit from calculating a useful width from the full entry. If the content is wrapped, consider whether a row-height adjustment is also needed. For merged headings, unmerge the cells if suitable, or set the column widths manually.
The column becomes much too wide: Look for a long value, URL, or note anywhere in that column, including rows outside the portion currently on screen. Undo with Ctrl+Z, select only the columns you need, and decide whether long text should wrap or be shortened. Remember that even an entry far below the visible area may determine the fitted width.
Numbers still appear as #####: First try AutoFit on the affected column. If the marks remain, the issue may not be width alone. A negative date or time value, or a number format that needs more space, can also cause this display. Check the underlying cell value and number format, and widen the column manually if the data is valid but still needs room.
The displayed text still looks cut off: Check whether the neighboring cell contains data, because Excel cannot let one cell’s text spill over a nonempty adjacent cell. Increase the column width, wrap the text, or use a suitable layout change. Also check for clipping caused by row height, font size, or merged cells; column AutoFit does not resolve every one of these conditions.
The menu or shortcut differs on your device: On Mac or in a browser, use the ribbon’s Format menu rather than relying on Windows access keys. In Excel for the web, select the column headers first and choose Home > Format > AutoFit Column Width. If the command is unavailable in a particular browser layout, resize by double-clicking the column boundary.
Frequently Asked Questions
What is the shortcut to autofit a column in Excel?
In Excel for Microsoft 365 on Windows, select the column and press Alt, H, O, I in sequence. It is an access-key sequence, not a simultaneous key combination.
How do I autofit every column in a worksheet?
Click the Select All triangle at the top-left of the grid, then use the Windows shortcut or Home > Format > AutoFit Column Width. Check for unusually wide columns caused by long entries.
Can I autofit only a few columns?
Yes. Select the column letters you want, including nonadjacent headers with Ctrl-click on Windows, and run AutoFit. Excel calculates each selected column independently.
Does AutoFit work on Excel for Mac?
Yes. Select the columns and choose Home > Format > AutoFit Column Width, or double-click a selected column’s right boundary. The Windows Alt-key sequence is not the Mac method.
Why did AutoFit make one column so wide?
Excel fits the widest relevant displayed entry in that column. Find the long value that is driving the width, then wrap or shorten it, or set a manual width that better suits the worksheet.
Can I autofit row height with the same shortcut?
No. On Windows, use Alt, H, O, A for AutoFit Row Height. This is particularly helpful after wrapping text, when a cell needs more vertical space.
Related
- Home Clean List Excel: Build a Practical Checklist
- Guest List Excel Template: What to Include and How to Use
- Group Dates in Excel Filters: Steps, Fixes, and Tips
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Named Range Scope Greyed Out? How to Change ItIn Excel for Microsoft 365 on Windows, a named range’s scope is fixed when the name is created,…
- Extract Data from Google Maps to Excel: Practical OptionsYou can move location data into Excel, but Google Maps does not provide a general-purpose button to export…
- How to Not Copy Hidden Rows in Excel Without ErrorsTo avoid copying hidden rows in Excel, select the range you need, choose Home > Find & Select…
- Remove Percentage in Google Sheets: Format or ConvertTo remove the percent sign in Google Sheets, select the cells and choose Format > Number > Number.…
- Meal Planning Spreadsheet: Build a Weekly Planner in ExcelA meal planning spreadsheet is a workbook for scheduling meals, recording recipes, and organizing the ingredients you need…
- How to Move Freeze Panes in Excel to Different RowsTo move frozen rows or columns in Excel, first choose View > Freeze Panes > Unfreeze Panes. Then…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.