To get Excel cells to autofit text, select the column or row you want to resize, then go to Home > Format and choose AutoFit Column Width or AutoFit Row Height. You can also double-click the boundary line between two column headers (or row numbers) and Excel snaps that column or row to fit its longest entry. For wrapped text that spans several lines, turn on Home > Wrap Text first and then AutoFit the row height. These steps are for Excel for Windows and Mac; labels can differ slightly by version, device or region.
This matters because a column that is too narrow cuts text off or turns it into a row of hash marks (####), which hides real data and makes spreadsheets hard to read. Autofitting fixes that in a couple of clicks. On mobile versions of Excel the options are more limited, and the desktop apps are the best place to do this. Occasionally you may need to resize manually because a single long entry makes a column very wide.
What You'll Need
- Microsoft Excel on desktop (Windows or Mac), or Excel on the web for basic column resizing. The mobile app has fewer resize options.
- A spreadsheet open with data already entered. Autofit measures existing text, so it has nothing to work with in an empty sheet.
- Optional: per-column knowledge of which text you want wrapped versus which columns should stay narrow.
Step-by-Step
Method 1: Double-click the column edge (fastest)
- Move your mouse pointer to the vertical line between two column headings (for example between A and B) until the cursor changes to a double-headed arrow.
- Double-click. Excel widens column A to fit the longest visible entry in that column.
- Repeat for each column you want to size, or select several column headings first (click the first, hold Shift, click the last) and double-click any boundary in the selection to autofit them all at once.
Method 2: Use the Format menu (works reliably, including for rows)
- Select the column(s) or row(s) you want to resize by clicking the column letter or row number headings.
- To select the whole sheet, press Ctrl+A (Windows) or Command+A (Mac), or click the small box at the top-left corner between the headings.
- Go to Home > Format (it sits in the Cells group on the right side of the ribbon).
- Choose AutoFit Column Width for columns or AutoFit Row Height for rows.
On Excel for Mac the Format button is in the same Home tab Cells group; the wording of the menu can vary a little depending on version.
Method 3: Keyboard shortcut
- Select the column(s).
- Press Alt, then H, then O, then I to autofit column width on Windows. This is the ribbon key sequence: H opens the Home tab, O opens Format, I picks AutoFit Column Width.
- Alternatively, with rows selected, press Alt > H > O > A to autofit row height.
Method 4: Wrap text, then autofit rows
If a cell contains a long sentence and you do not want an extremely wide column, wrap the text first.
- Select the cells containing the text.
- On the Home tab, click Wrap Text. The text now flows onto several lines inside the cell height.
- If the row does not grow tall enough, select the row(s) and use Home > Format > AutoFit Row Height, or double-click the boundary between row numbers. Wrapped text is not always row-autofitted automatically, so this is often still needed.
Common Mistakes
- Autofitting only the visible cells. Excel does not count hidden or filtered-out values in some situations, so a column may look autofitted and still be too narrow after you clear a filter. Repeat the autofit after removing filters.
- Expecting one click to fix everything. AutoFit Column Width and AutoFit Row Height are separate commands. If you only autofit columns, wrapped text in a tall row may still be cut off vertically.
- Autofitting a column with one long entry. A single 200-character cell can make the column enormous and push other data off-screen. Wrap the text instead and autofit the row.
- Confusing text overflow with a formatting error. Text in a cell with an adjacent empty neighbour spills across, so it can look fine while it is not actually in one column. Remeasure after adding data to the neighbour.
- Ignoring numbers shown as hashes. A column full of #### means the column is too narrow for the number, or the number format is too long. Autofit fixes the first case, not the second.
- Merged cells. Merged cells do not autofit reliably. Unmerge them first if the column will not resize as expected.
Tips
- Select multiple columns with Ctrl+click or Shift+click and autofit once to save repeated clicks.
- Set an ideal default: select all columns, autofit them, then use Home > Format > Default Width if you want a consistent baseline for future sheets.
- For printouts, autofit then check Page Layout > Print Titles and print preview, because very wide autofitted columns can split across pages.
- Use Wrap Text with a fixed, sensible column width for long descriptions, and keep autofit for short headings and labels.
- If you resize columns often, the double-click method is quicker than the menu because it needs no ribbon clicks.
Troubleshooting
- The column will not get narrower after deleting text. Autofit only grows reliably; if the column is still wide, double-click the right boundary again or choose AutoFit Column Width from the menu to force a new measurement.
- Row height is greyed out. You may have merged cells selected or an object like an image or chart in the range. Unmerge or deselect the object, then try again.
- Text is wrapped but still clipped. The row height may be fixed rather than automatic. Select the row, right-click, choose Row Height, and confirm it is not set to a locked value, or re-run AutoFit Row Height.
- Autofit makes one column huge and shrinks the rest. That is expected when one cell holds a very long value. Split the long value or wrap the text and autofit the row instead.
- Excel on mobile will not do it. The phone and tablet apps have limited column and row resizing. Open the file in Excel for the web or the desktop app to autofit properly, then save.
Frequently Asked Questions
Does autofit work on wrapped text?
AutoFit Row Height does consider wrapped text and grows the row so all lines display. AutoFit Column Width measures text as if unwrapped, so pair wrapping with row autofit rather than column autofit for long sentences.
Can I autofit several columns at once?
Yes. Select the column headings, then double-click any boundary in the selection or use Home > Format > AutoFit Column Width. The same applies to multiple rows and row height.
Why do I see #### instead of my numbers?
The column is narrower than the number needs. Autofit the column width. If #### persists, a date or time format may be too long for the cell width even after autofit; shorten the format or widen the column manually.
Does Excel autofit without me clicking anything?
Excel does widen some columns automatically when you type, but it does not keep rows and columns fitted as data changes. Editing a cell can leave the column too narrow again, so re-run autofit after major edits.
Is there a shortcut for autofitting rows?
On Windows, select the rows and use Alt > H > O > A. A double-click on the row-number boundary also works and is usually faster.
Will autofit change my print layout?
It can. Wider columns may push content onto more pages. After autofitting, check Print Preview and adjust scaling or orientation if needed.