AutoFit resizes Excel columns or rows to fit their contents automatically. It is faster and more accurate than dragging borders by eye, especially across a large sheet.
Does this affect you?
Use this for Excel for Microsoft 365, Excel 2021, and Excel 2019 on Windows or Mac when text is cut off, columns are too wide, row heights look wrong, or cells show ##### because the column is too narrow.
Autofit by double-clicking a border
This is fastest for one or two columns or rows.
- Move the pointer to the line between two column letters, such as the border between B and C.
- Wait for the double-headed arrow cursor.
- Double-click.
- Excel resizes the column on the left side of that border to fit its widest content.
- For rows, double-click the line between row numbers.
Autofit several columns or rows from the ribbon
Use this for a whole range or sheet.
- Select the columns by dragging across their header letters, or press Ctrl+A to select the sheet.
- Open the Home tab.
- In the Cells group, click Format.
- Choose AutoFit Column Width.
- For rows, select rows and choose AutoFit Row Height from the same menu.
More control
Fix columns that still look wrong
Wrap Text can change how Excel calculates height and width. Merged cells can block AutoFit because Excel cannot tell which column owns the content. Toggle Wrap Text or unmerge cells when AutoFit behaves oddly.
Set exact sizes instead
Right-click a column header and choose Column Width, or right-click a row header and choose Row Height. Column width is measured in default-font characters; row height is measured in points.
##### means a display width problem
For dates and numbers, hash marks usually mean the column is too narrow. AutoFit generally fixes it without changing the data.
Printed output can still scale
Page Layout > Scale to Fit can shrink or stretch the printed sheet after AutoFit. Check print scaling if paper output differs from the screen.
Long numbers may need text format
A 16-digit account number may turn into scientific notation under General or Number format. Format the cell as Text before entering it; AutoFit will not fix number-format conversion.
Sources
- Microsoft Support – Change the column width and row height (2025)
- Microsoft Support – Wrap text in a cell (2025)
