The quickest way to AutoFit a column in Excel is to double-click the right edge of its column header; for a row, double-click the bottom edge of its row number. From the keyboard, select the column and press Alt, H, O, I in sequence, or press Alt, H, O, A for row height. To expand grouped rows, click the plus button beside the row numbers or the highest numbered outline level button.
These steps are for Excel for Microsoft 365 and Excel 2013 through 2024 on Windows. The Alt shortcuts are Windows only, so Mac and web users have their own section.
Quick Reference
| Task | Mouse | Ribbon | Keyboard (Windows) |
|---|---|---|---|
| AutoFit column width | Double-click the right edge of the column header | Home > Format > AutoFit Column Width | Alt, H, O, I |
| AutoFit row height | Double-click the bottom edge of the row number | Home > Format > AutoFit Row Height | Alt, H, O, A |
| Set an exact column width | Right-click the header > Column Width | Home > Format > Column Width | Alt, H, O, W |
| Set an exact row height | Right-click the row number > Row Height | Home > Format > Row Height | Alt, H, O, H |
| Expand or collapse a row group | Click plus or minus | Data > Outline > Show Detail / Hide Detail | Alt+Shift+= or Alt+Shift+- |
How to AutoFit Columns in Excel
AutoFit makes each column just wide enough for its longest entry. It also narrows columns that are wider than they need to be.
- Select the column or columns you want to resize. Click a column letter, or drag across several letters. To pick every column, click the Select All button, the small triangle in the top-left corner where the row numbers and column letters meet.
- Point to the right edge of any selected column header. The pointer turns into a two-headed arrow.
- Double-click. Every selected column resizes to fit its own longest entry.

- If you prefer the ribbon, keep the columns selected and go to Home > Format (in the Cells group) and choose AutoFit Column Width.

When it works, nothing in the column is cut off and no numbers show as #####.
Tip: if a double-click resized only one column, you probably clicked an edge outside your selection. Double-click the boundary of a column that is part of the selection.
How to AutoFit Rows in Excel
Excel usually grows a row by itself when you type wrapped or multi-line text, but a row you sized by hand stays fixed. AutoFit puts it back to fitting its contents.
- Select the row or rows by clicking the row numbers on the left. Click Select All to choose every row.
- Point to the bottom edge of any selected row number until the pointer becomes a two-headed arrow.
- Double-click. Each selected row resizes to fit its tallest cell, so short rows shrink and tall rows grow.
- Or go to Home > Format and choose AutoFit Row Height.

AutoFit row height does not widen columns. If text is wrapping onto many lines, set the column width you want first, then AutoFit the rows.
Keyboard Shortcuts to AutoFit Columns and Rows
Excel has no single Ctrl shortcut for AutoFit. Instead, you use KeyTips, the letters Excel shows on the ribbon when you press Alt. Press the keys one after another, not all at once.
- Select what you want to resize. Press Ctrl+Spacebar to select the whole column of the active cell, Shift+Spacebar to select the whole row, or Ctrl+A to select the entire sheet. Hold Shift and press the arrow keys to extend the selection to more columns or rows.
- Press and release Alt. Letters appear on the ribbon tabs.
- Press H to open the Home tab, then O to open Format.
- Press I for AutoFit Column Width or A for AutoFit Row Height. The selection resizes right away.
Other sequences on the same menu: Alt, H, O, W opens Column Width, Alt, H, O, H opens Row Height, and Alt, H, O, D opens Default Width. If your screen shows different letters, follow the ones Excel displays. F10 also turns KeyTips on. Microsoft explains how KeyTips work in its Excel keyboard shortcuts list.
AutoFit to Part of a Column
Double-clicking a column edge sizes the column for every cell in it, including a long title in row 1. To ignore that title, select only the cells you care about (for example, B3:B200) and choose Home > Format > AutoFit Column Width. Excel fits the column to the selected cells only. The title can spill into the empty cells beside it, or you can wrap it.
AutoFit in Excel for Mac and Excel for the Web
Excel for Mac: double-click the divider on the right edge of a column heading, or the divider below a row heading. The menu bar also has Format > Column > AutoFit Selection and Format > Row > AutoFit. Set an exact size with Format > Column > Width or Format > Row > Height. To select the whole sheet, click the triangle in the upper-left corner. Microsoft covers these in Change column width or row height in Excel for Mac.
Excel for the web: double-click the header edges as on Windows, or use Home > Format > AutoFit Column Width or AutoFit Row Height. The Windows Alt sequences above are for the desktop app.
Three Ways to Change Column Width
- Drag: drag the right edge of the column header until the column is the width you want. With several columns selected, dragging one edge resizes them all to the same width.
- Type a number: right-click the column header, choose Column Width, type a value, and click OK.
- AutoFit: double-click the right edge of the column header.
Column width is measured in characters of the default font. The default is 8.43 and the maximum is 255. Row height is measured in points (1 point is 1/72 of an inch), with a default of 15 and a maximum of 409. A width or height of 0 hides the column or row. These sizes apply to whole columns and rows; to make one cell look bigger, see whether you can resize a single cell in Excel.
Change the default width for a sheet
- Click the sheet tab. To change every sheet in the workbook, right-click a sheet tab and choose Select All Sheets.
- Go to Home > Format > Default Width.
- Type a value in the Standard column width box and click OK. Columns you have not resized change to the new width; columns you already sized keep their width.
How to Set Column Width in Inches
- Go to View > Page Layout.
- Right-click the column header and choose Column Width.
- Type the width in inches and click OK.
The columns print and display at the width you entered in inches.
In Page Layout view, Excel uses inches by default. To use centimeters or millimeters, go to File > Options > Advanced and change Ruler Units under Display.
When you’re done measuring, here’s how to return the worksheet to Normal view.
How to Copy One Column’s Width to Another
Microsoft’s Change the column width and row height article explains how to match widths without measuring:
- Select a cell in the column that has the width you want.
- Press Ctrl + C, or go to Home > Clipboard > Copy.
- Right-click a cell in the target column, point to Paste Special, and select Keep Source Column Widths.

The target column takes on the same width as the source column. To copy only the width without pasting any data, press Ctrl+Alt+V after copying, choose Column widths in the Paste Special box, and click OK.
Row Height and Grouped Rows
To check a row’s height, select the row number and choose Home > Format > Row Height. The box shows the height in points. Click Cancel to leave it as is. To resize rows:
- Select the rows by their row numbers, or click Select All in the top-left corner for the whole sheet.
- Choose Home > Format > AutoFit Row Height to fit each row to its contents. For one fixed height, choose Row Height, type a value in points, and click OK.
- For a uniform grid, also choose Home > Format > Column Width with the same selection. Column width uses character units and row height uses points, so the same number doesn’t make square cells.
Group rows so you can collapse and expand them
Follow Microsoft’s outline guide. Grouping works best when the data has a header row and no blank rows inside the range.
- Select the row numbers you want in the group. Click the first one, then Shift-click the last. Leave out the total row if the group has one.
- Choose Data > Outline > Group, and pick Rows if Excel asks. Selecting whole rows skips that question. A bracket and a minus button appear to the left of the row numbers.
- Click the minus button to collapse the group and the plus button to expand it. From the keyboard, select a cell in the group and press Alt+Shift+- to hide the detail or Alt+Shift+= to show it.

- To expand every group at once, click the highest numbered outline level button (1, 2, 3, and so on) above the row numbers. Click 1 to collapse everything to the top level. Excel allows up to eight outline levels.
- To remove the grouping, select the rows and choose Data > Outline > Ungroup.
If the plus, minus, and level buttons are missing, press Ctrl+8 to show the outline symbols, or turn on Show outline symbols if an outline is applied under File > Options > Advanced. If rows are hidden rather than grouped, there is no plus button; select the rows on both sides and choose Home > Format > Hide & Unhide > Unhide Rows.
When AutoFit Is Not the Right Fix
- Wrap Text keeps the column width and stacks long text onto several lines in the same cell. Select the cells and click Wrap Text on the Home tab (Alt, H, W). Press Alt+Enter while editing a cell to start a new line where you want it.
- Shrink to fit keeps the width and makes the text smaller. Open the Alignment settings on the Home tab and check Shrink to fit. It can’t be used together with Wrap Text.
- Fit to one page is a printing setting, not AutoFit. To shrink a whole sheet onto a printed page, fit the spreadsheet on one page.
If AutoFit Doesn’t Work
- Merged cells: AutoFit can’t size a row or column that contains cells merged across it. Unmerge them with Home > Merge & Center > Unmerge Cells, or set the size by hand.
- Wrapped text is still cut off: this happens when the row has a fixed height or the text is in merged cells. Select the row and choose Home > Format > AutoFit Row Height. See Microsoft’s Wrap text in a cell page.
- The column was right, then values changed: AutoFit is a one-time resize. Formulas and new data don’t change column width, so AutoFit again after the results change.
- Nothing happens when you double-click: double-click exactly on the boundary in the header row, not inside the column.
- Format is greyed out: the sheet is probably protected. On the Review tab, choose Unprotect Sheet, or ask the owner to allow Format columns and Format rows when protecting it.
- One column is now far too wide: a single long entry sets the width for the whole column. Wrap that cell, or AutoFit a selected range that leaves it out.
Why Is Excel Showing ##### Instead of a Number?
Excel shows ##### when a column is too narrow to show the whole value. Widen the column or AutoFit it and the number appears. A few other fixes can help:
- Check Shrink to fit in the Alignment settings on the Home tab to make the text smaller.
- Use Decrease Decimal on the Home tab if the number has too many decimal places.
- Change a long date to Short Date in the Number Format list.
- If a date or time formula returns a negative value, Excel also shows #####. Fix the formula or change the cell to a number format.
If you need the opposite, such as 2.50 instead of 2.5, you can keep a trailing zero in Excel.
Sources: Microsoft’s Change the column width and row height and How to correct a ##### error articles.
Excel AutoFit Questions
What is the default column width in Excel?
The default column width is 8.43 characters, with a maximum of 255. Rows default to 15 points and can go up to 409.
Can I AutoFit every column at once?
Yes. Click the Select All button in the top-left corner (or press Ctrl+A), then double-click any column boundary. Do the same with any row boundary to fit every row.
Can Excel AutoFit columns automatically as I type?
Not by itself. Excel grows rows for wrapped text, but column widths stay put until you AutoFit again. A macro can do it, but that requires saving the file as a macro-enabled workbook.
Is there a shortcut for AutoFit on a Mac?
Not a built-in one like the Windows KeyTips. Double-click the column divider, or use Format > Column > AutoFit Selection.
More Excel Guides
- How to fit a spreadsheet on one page in Excel
- How to print gridlines in Excel
- How to fill a cell with color in Excel
- How to put Excel column A on the right side
- How to calculate a percentage in Excel
- How to merge cells in Excel

Matthew Burleigh is the founder, head writer, and editor of Solve Your Tech, which he launched in 2012. He has written technology tutorials since 2008 and worked in IT since 2003, including small-business support, IT management, and consulting. He holds Bachelor’s and Master’s degrees in Computer Science from Arizona State University.
Matthew writes practical guides for Windows, iPhone and iPad, Microsoft Office, Outlook, Google apps, and Android. Solve Your Tech’s guides are checked step by step against the device or app maker’s own documentation and tested on his own devices whenever he has the hardware or software, with clear steps, sources, and update dates.
Read more about Matthew and how Solve Your Tech writes and updates its guides, or report a correction.