To autofit Excel columns, select the columns you want to resize, then double-click the boundary line between any two of the selected column headers. Every selected column instantly widens to fit its longest entry. On the Home tab you can also use Format > AutoFit Column Width, and on Mac Excel the same command lives under Format > Columns > AutoFit Selection. Menu labels can vary slightly between Excel versions, platforms and regions, but the double-click method works the same everywhere.
What You'll Need
- Excel for Windows, Mac, the web, or the mobile app (the double-click shortcut is desktop-only; mobile uses a menu option).
- A spreadsheet with at least one column of data.
- No add-ins or special settings required.
Step-by-Step
- Open your workbook and click the sheet tab that contains the columns you want to resize.
- Select the columns. Click a single column header letter to select one column. To select several, drag across the header letters, or hold Ctrl (Cmd on Mac) and click each header. To select every column, click the small triangle in the top-left corner where the row numbers and column letters meet.
- Double-click the column boundary. Hover over the right edge of any selected column header until the pointer turns into a two-headed arrow, then double-click. All selected columns resize to fit their widest content.
- Alternatively, use the ribbon. With the columns selected, go to Home > Format > AutoFit Column Width (under Cell Size). On Mac Excel, use Format > Columns > AutoFit Selection. On Excel for the web, the Home tab has a Format menu with the same AutoFit option.
- Check the result. Long text, dates and numbers should now be fully visible without the ### overflow that appears in narrow numeric cells. If a column still looks wrong, see Troubleshooting below.
- Autofit rows too, if needed. Select the rows, then double-click the boundary between two row numbers, or use Home > Format > AutoFit Row Height. This is useful when wrapped text is being cut off vertically.
Common Mistakes
- Double-clicking the wrong edge. You must hit the boundary between two column headers, not the middle of a header. If the pointer is not a two-headed arrow, you will sort or select instead.
- Selecting cells instead of columns. Clicking inside the grid and then double-clicking a header edge only resizes that one column. Select the full column headers first if you want several resized at once.
- Expecting wrapped text to autofit width. If Wrap Text is on, Excel fits the column to the longest word, not the full sentence. Turn Wrap Text off or widen manually if you want the whole line on one row.
- Forgetting merged cells. Merged cells ignore AutoFit. Unmerge them (Home > Merge & Center) before resizing.
- Assuming mobile works the same. The Excel mobile app has no double-click shortcut. Tap the column header, open the context menu, and look for a column width or resize option; the exact wording varies by version.
Tips
- Double-click the top-left corner triangle twice: once to select all, once on any boundary, to autofit every column on the sheet in one go.
- To set an exact width, right-click the column header and choose Column Width, then type a number. This is more predictable than dragging.
- If you only need a quick visual check, select the columns and use Home > Format > AutoFit Column Width rather than dragging, so you do not accidentally change a neighbouring column.
- Autofit recalculates when content changes only if you repeat the step; it is not a live setting. Re-run it after pasting in longer data.
- Freeze the header row (View > Freeze Panes) before autofitting wide sheets so you can still see labels while checking results.
Troubleshooting
- Nothing happens on double-click. Make sure you are on the header boundary and that the sheet is not protected. Review > Unprotect Sheet if protection is on and you have the password.
- Columns stay too narrow. Check for merged cells or Wrap Text. Also confirm the cell does not contain a formula returning a long string that is visually truncated by a neighbouring filled cell; autofit sizes to the actual value, not the display.
- Columns become extremely wide. A single long entry, such as a pasted URL or a stray space followed by text, can stretch a column. Find and shorten that cell, or set a fixed width instead.
- Autofit is greyed out. The sheet may be protected or the workbook may be in a view that blocks formatting. Switch to Normal view (View > Normal) and unprotect if needed.
- Mobile app has no AutoFit. This is expected; the mobile app offers limited formatting. Resize by dragging the header boundary where supported, or open the file in Excel for the web or desktop to autofit.
Frequently Asked Questions
Does autofit work on hidden columns?
No. Hidden columns are skipped. Unhide them first (select the surrounding headers, right-click, choose Unhide) and then autofit.
Can I autofit all columns at once?
Yes. Click the triangle at the top-left corner of the grid to select the whole sheet, then double-click any column boundary or use Home > Format > AutoFit Column Width.
Why does autofit ignore my merged cells?
Excel cannot calculate a width for merged cells, so it leaves them alone. Unmerge, autofit, then merge again if you still need the layout.
Is there a keyboard shortcut for autofit?
There is no single default shortcut in Excel. You can use Alt, H, O, I on Windows to reach AutoFit Column Width through the ribbon, or assign your own shortcut via macro if you need one regularly.
Will autofit change my print layout?
It can. Wider columns may push content onto extra printed pages. Check Page Layout > Print Area and scaling after autofitting a sheet you plan to print.
Does autofit work in Excel for the web?
Yes, through the Home tab's Format menu. The double-click shortcut also works in most browsers, though behaviour can vary slightly by browser.