Excel Autofit: How to Resize Rows and Columns
In this article
Autofit makes Excel resize a column or row so the content fits without cutting off text or numbers. The quickest method: select the column or row headers you want to fix, then double-click the boundary line between two headers — Excel snaps that column or row to the widest or tallest cell inside it. You can also use Home > Format > AutoFit Column Width (or AutoFit Row Height) from the ribbon, which does the same thing without hunting for the exact pixel of the divider. Nothing needs to be installed or enabled first; the feature is built into every current desktop version of Excel for Windows and Mac.
What You'll Need
- Excel for Windows or Mac (the desktop app). The browser version has a more limited Format menu, and the mobile apps do not offer a true autofit command — see the FAQ below.
- A workbook with at least one column or row containing content you want to fit.
- Optional: a mouse or trackpad for the double-click method. Keyboard-only users can use the ribbon menu instead.
Menu labels can differ slightly between Excel versions, between Windows and Mac, and by region, so if a label below does not match exactly, look for the closest equivalent in the same menu.
Step-by-Step
- Open your workbook and go to the sheet you want to adjust. Autofit only affects the sheet you are working on, not the whole file.
- Select the columns or rows you want to resize. Click a single column letter (for example, A) to select one column. Drag across letters to select several. Click the small square at the top-left corner where the row and column headers meet to select the entire sheet. To select non-adjacent columns, hold Ctrl (Windows) or Command (Mac) while clicking each header.
- Use the double-click method. Move the pointer over the boundary line between two column headers — the cursor changes to a double-headed arrow. Double-click, and Excel resizes the column to the left of that line to fit its widest entry. For rows, double-click the line between two row numbers.
- Or use the ribbon. With the columns or rows still selected, go to the Home tab, find the Cells group, click Format, then choose AutoFit Column Width or AutoFit Row Height. On Mac, the same commands live under Format > Columns > AutoFit Selection and Format > Rows > AutoFit Selection, though the exact wording depends on your version.
- Check the result. Wrapped text may still look clipped until you also adjust row height — autofit on a column changes width, not height. If a cell uses Wrap Text, autofit the row as well so the wrapped lines are visible.
- Repeat for other sheets if needed. Autofit is per-sheet. If you want consistent sizing across a workbook, select all sheets first by holding Ctrl (Windows) or Command (Mac) and clicking each sheet tab, then run the autofit command once. Remember to ungroup the sheets afterwards, or later edits will apply to every selected sheet.
Common Mistakes
- Double-clicking the wrong line. The boundary you double-click resizes the column or row to its left (or above). If the wrong column changes size, you clicked the next divider over.
- Expecting autofit to fix wrapped text alone. Column autofit widens to the longest unbroken string; it does not unwrap text. Turn off Wrap Text first if you want a single wide column, or autofit the row height if you want to keep the wrap.
- Autofitting a merged cell. Excel cannot autofit a column that contains a merged cell — it will size to the merged block's combined width or not resize at all. Unmerge, autofit, then merge again if you need to.
- Forgetting that hidden rows and columns are skipped. Autofit ignores hidden content, so a column can look correct until you unhide a row with a long entry.
- Assuming autofit applies to the whole workbook. It applies only to the selected columns or rows on the active sheet unless you group the sheets first.
Tips
- Set a default width for new sheets by selecting all columns, autofitting, then saving the workbook as a template — new sheets will inherit the sizing.
- If you want a minimum width, autofit first, then drag the boundary slightly wider. Excel will not shrink below the content width unless you drag manually.
- Use the keyboard shortcut Alt+H+O+I (Windows) to run AutoFit Column Width from the ribbon without a mouse. On Mac, the ribbon shortcuts differ by version, so the menu path is more reliable.
- To autofit every column on a sheet at once, click the corner square above row 1 and left of column A, then double-click any column boundary. All columns resize together.
- If a column still shows ##### for a date or number, the issue is width, not formatting — autofit should fix it, but a very long number may need a wider manual drag.
Troubleshooting
The column will not resize at all. Check whether the sheet is protected. On the Review tab, look for Unprotect Sheet; if it is active, you will need the password to change column widths. Also check whether the workbook is shared or marked as final, which can lock formatting.
Autofit makes a column enormous. A single long entry — a URL, a paragraph, or a stray space-filled cell — drives the width. Find the longest cell, shorten it, or turn on Wrap Text and autofit the row height instead.
The double-click does nothing. Make sure you are on the header boundary, not inside a cell. If the pointer does not change to a double arrow, you are in the wrong spot. Try the ribbon method instead.
Rows stay short after autofit. A row with a manually set height will not autofit until you reset it. Select the row, go to Home > Format > Row Height, and clear the value, or double-click the row boundary directly.
If that did not work, close and reopen the workbook, confirm you are in the desktop app rather than the browser version, and check that no add-in is locking formatting. As a last resort, copy the data into a fresh sheet and autofit there — that rules out corruption in the original sheet's formatting.
Frequently Asked Questions
Does autofit work in Excel for the web?
Partially. Excel for the web lets you resize columns and rows manually, and the Format menu includes autofit options in most current versions, but the feature set is smaller than the desktop app. If the command is missing, open the file in the desktop app to run it.
Can I autofit on the Excel mobile app?
The iPhone and Android apps do not offer a dedicated autofit command. You can drag column boundaries manually, but for true autofit, use the desktop or web version.
Why does autofit ignore some cells?
Hidden rows and columns, merged cells, and cells with manual row heights are the usual culprits. Unhide, unmerge, or reset the height, then run autofit again.
Does autofit change my formatting?
No. It only changes column width or row height. Fonts, colours, borders, and number formats stay as they are.
Can I autofit every sheet at once?
Yes, if you group the sheets first. Hold Ctrl (Windows) or Command (Mac) and click each sheet tab, run autofit, then right-click a tab and choose Ungroup Sheets so later edits do not affect all of them.
What is the keyboard shortcut for autofit?
On Windows, Alt+H+O+I runs AutoFit Column Width and Alt+H+O+A runs AutoFit Row Height. Mac shortcuts vary by version, so the Format menu is the safer route.