How to Autofit Every Column in Excel
In this article
To autofit every column in Excel at once, select the whole sheet (click the small triangle at the top-left corner of the grid, or press Ctrl+A), then double-click any boundary line between two column headers. Every column resizes to fit its widest entry. On a Mac the shortcut is Command+A and the double-click works the same way. If you only want a range, select those columns first, then double-click a boundary inside the selection.
Autofit removes the guesswork of dragging column edges one by one. It makes each column exactly as wide as its longest visible value, so text stops getting cut off and numbers stop showing as ####. Nothing is required beyond an open workbook, though it helps to know that Excel ignores cells hidden by filters or grouped rows when it calculates the width.
What You'll Need
- A workbook open in Excel for Windows, Mac, or the web (the ribbon labels can differ slightly by version, device, and region).
- At least one column with data in it, since autofit sizes to content.
- No special add-ins or permissions.
Step-by-Step
- Select the columns you want to resize. For the entire sheet, click the select-all triangle where the row numbers meet the column letters, or press Ctrl+A (Command+A on Mac). For a subset, click the first column letter and drag to the last, or hold Ctrl and click individual letters.
- Hover over a column boundary. Move the pointer to the vertical line between two column headers in the selected area. The cursor changes to a double-headed arrow.
- Double-click the boundary. Excel fits every selected column to its widest visible entry. This is the fastest route and works on both Windows and Mac.
- Or use the ribbon. With the columns selected, go to Home > Cells > Format > AutoFit Column Width. On Mac, the path is Home > Format > AutoFit Column Width. The menu labels can vary slightly between versions.
- Check the result. Scroll across the sheet and look for values still clipped or replaced by ####. A column showing #### is usually too narrow for a number or date, so widen it manually or repeat autofit after checking the cell format.
- Undo if needed. Press Ctrl+Z (Command+Z on Mac) to revert. Autofit is a formatting change, so undo works normally.
If you want row heights to match, select all rows and double-click a row boundary, or use Home > Cells > Format > AutoFit Row Height. Rows with wrapped text grow to fit the tallest line.
Common Mistakes
- Selecting cells instead of columns. If you highlight cells rather than whole columns, autofit applies only to those columns but the double-click target must still be a header boundary. Selecting the header letters is clearer.
- Double-clicking the wrong edge. The boundary must be between two column headers, not between rows or inside the grid.
- Expecting hidden rows to count. Autofit ignores content in hidden rows and filtered-out rows, so a column can look too narrow once those rows reappear.
- Forgetting merged cells. Autofit does not work reliably on columns containing merged cells. Unmerge them first, resize, then merge again if needed.
- Assuming wrapped text expands width. If Wrap Text is on, Excel grows the row height instead of the column width. Turn wrapping off if you want a wider column.
Tips
- Set a maximum width by hand after autofit if a single long note is stretching a column across the screen. Autofit always fits the longest entry, however long.
- Use Ctrl+Shift+Right Arrow or Ctrl+Shift+End to select a block of columns quickly before running autofit.
- Apply autofit to a whole sheet before printing or exporting to PDF so nothing is cut off at the page edge.
- If you repeat the same layout often, record the steps with the Macro Recorder and run them as a one-click shortcut.
- Autofit works the same in Excel for the web, but very large sheets may take a moment to redraw.
Troubleshooting
Nothing happens when you double-click. Confirm the pointer is exactly on the header boundary and that the columns are selected. If the sheet is protected, autofit is blocked; go to Review > Unprotect Sheet and enter the password if you have it.
Columns stay narrow. Check for merged cells and cell comments. Also verify the column is not set to a fixed width in a table style that overrides formatting.
Numbers show as ####. The column is too narrow for the formatted value, often after applying a date or currency format. Widen it manually or reapply autofit after formatting.
Autofit makes a column enormous. A stray value far down the sheet is being counted. Delete or move it, or set a manual width instead.
Rows do not grow with wrapped text. Select the rows and use AutoFit Row Height, or double-click a row boundary.
Frequently Asked Questions
Can I autofit all columns with a keyboard shortcut?
There is no single default shortcut. Select all columns with Ctrl+A, then use the ribbon path Home > Cells > Format > AutoFit Column Width, or double-click a header boundary.
Does autofit change my data?
No. It only changes column width formatting, and Ctrl+Z reverses it.
Why does autofit ignore some cells?
Hidden rows, filtered-out rows, and merged cells are not measured. Unhide or clear the filter to include them.
Can I autofit every sheet at once?
Not in one action. Select each sheet tab (hold Ctrl to group them) and run autofit, then right-click a tab and choose Ungroup to avoid editing all sheets by accident.
Does autofit work in Excel for the web?
Yes, through the Home tab's Format menu or by double-clicking a column boundary.