Excel can automatically adjust column widths and row heights to fit content, eliminating manual resizing and ensuring all data is visible without overflow or excessive white space. This feature, called AutoFit, works instantly and requires no add-ins or special setup—just a few clicks or keyboard shortcuts. It’s ideal for preparing reports, cleaning imported data, or formatting sheets for printing.

What You'll Need

  • Microsoft Excel (any recent version: 2016, 2019, 2021, or Microsoft 365)
  • A worksheet with data that needs resizing

Step-by-Step

  1. Open your Excel workbook and navigate to the worksheet containing the cells you want to resize.
  2. To AutoFit a single column: position your cursor over the right edge of the column header (e.g., the line between 'B' and 'C') until it turns into a double-headed arrow, then double-click. The column will instantly widen to fit the longest entry in that column.
  3. To AutoFit multiple columns: click and drag to select the column headers you want to adjust (e.g., click 'B', hold Shift, and click 'D' to select columns B through D), then double-click the right edge of any selected column header. All selected columns will resize to fit their content.
  4. To AutoFit all columns on the sheet: click the triangle icon in the top-left corner of the worksheet (above row 1 and left of column A) to select the entire sheet, then double-click any column boundary (e.g., between any two column headers). Every column will now AutoFit.
  5. To AutoFit row height: position your cursor over the bottom edge of a row number (e.g., the line between '5' and '6') until it becomes a double-headed arrow, then double-click. The row will adjust to fit the tallest content in that row.
  6. To AutoFit multiple rows: select the row numbers you want to adjust (click and drag or use Shift-click), then double-click the bottom edge of any selected row number.
  7. To AutoFit all rows: select the entire sheet using the top-left triangle, then double-click any row boundary (e.g., between any two row numbers). All rows will resize to fit their content.
  8. Alternative method using the ribbon: select the columns or rows you want to resize, go to the Home tab, click Format in the Cells group, then choose AutoFit Column Width or AutoFit Row Height.
  9. Keyboard shortcut: after selecting columns, press Alt + H, O, I to AutoFit width; for rows, use Alt + H, O, A. These sequences work in all modern Excel versions on Windows.

Common Mistakes

  • Trying to AutoFit merged cells: AutoFit does not work on merged cells because Excel cannot determine a single width or height for the combined area. Unmerge cells first (Home > Merge & Center > Unmerge Cells) if you need AutoFit to function.
  • Assuming AutoFit wraps text: AutoFit only adjusts size based on current content; it does not enable text wrapping. If text is cut off despite AutoFit, wrap the text first (Home > Wrap Text) then reapply AutoFit.
  • Using AutoFit on columns with very long text: if a cell contains hundreds of characters, AutoFit may make the column excessively wide. In such cases, consider wrapping text or manually setting a max width.
  • Forgetting to select the entire sheet: clicking just one cell and double-clicking a border only affects that cell’s column or row, not the whole sheet. Always select the target range first.
  • Confusing AutoFit with manual resizing: dragging column borders manually sets a fixed width; AutoFit resets to content-based sizing. If you manually resize after AutoFit, you override the automatic behavior.

Tips

  • Use AutoFit before printing or sharing: it ensures no data is cut off and improves readability without manual tweaking.
  • Combine with text wrapping: for paragraphs or long descriptions, enable Wrap Text (Home tab) then AutoFit row height to neatly display multi-line content.
  • Apply AutoFit after pasting data: imported data from websites or CSV files often has mismatched widths; AutoFit quickly cleans it up.
  • Double-click speed matters: if you click too slowly, Excel may interpret it as two separate clicks instead of a double-click. Practice a firm, quick double-click on the boundary line.
  • Use Format > AutoFit for precision: if you’re unsure about double-clicking, the ribbon method is more reliable and works the same way.
  • AutoFit respects hidden characters: spaces, line breaks (Alt+Enter), and non-printing characters affect the result. Clean data with TRIM or CLEAN if sizing seems off.
  • For consistent formatting, consider setting a default column width: go to Home > Format > Default Width to set a baseline for new columns, then use AutoFit as needed.

Troubleshooting

  • If AutoFit does nothing: first, ensure you’ve selected the correct columns or rows. Click the column or row header to highlight it fully before double-clicking the boundary.
  • If the column or row doesn’t change: check if the worksheet is protected. Go to Review > Unprotect Sheet (if a password is set, you’ll need it). Protection prevents AutoFit from working.
  • If AutoFit makes columns too wide: look for hidden spaces, extra characters, or unusually long formulas. Use TRIM() or CLEAN() functions to clean data, then reapply AutoFit.
  • If rows don’t adjust after wrapping text: verify that Wrap Text is actually enabled. Select the cell, go to Home, and confirm the Wrap Text button is highlighted. If not, click it, then double-click the row boundary.
  • If AutoFit behaves differently on Mac: the double-click method works the same, but keyboard shortcuts differ. Use Option + Command + 0 to AutoFit columns and Option + Command + 9 for rows in Excel for Mac.
  • If the double-click doesn’t register: try clicking slightly slower or faster, or use the ribbon method (Home > Format > AutoFit) as a more reliable alternative.
  • If only some cells respond: you may have accidentally selected non-adjacent columns. Hold Ctrl (Cmd on Mac) while clicking headers to add or remove from selection, then try again.

Frequently Asked Questions

Can AutoFit work on merged cells?

No, Excel cannot AutoFit merged cells because it cannot determine a single width or height for the merged range. You must unmerge the cells first (Home > Merge & Center > Unmerge Cells) before AutoFit will function.

Will AutoFit change my formatting like font size or color?

No, AutoFit only adjusts column width or row height. It leaves font size, color, alignment, and all other formatting unchanged.

Is there a way to AutoFit everything with one click?

Yes: click the triangle in the top-left corner of the worksheet to select all cells, then double-click any column boundary to AutoFit all columns, or any row boundary to AutoFit all rows. You’ll need to do columns and rows separately.

Why does AutoFit make my column extremely wide after pasting from a website?

Web data often includes invisible characters, wide spaces, or hidden formatting that increases the perceived width. Use the TRIM or CLEAN function to remove extra spaces and non-printing characters, then reapply AutoFit.

Can I set AutoFit to happen automatically when I enter data?

Not natively. Excel does not have a live AutoFit feature that triggers on data entry. You must manually apply AutoFit after updating content, or use a VBA macro if automation is required.

Does AutoFit work in Excel Online or mobile apps?

Yes, the core AutoFit function is available in Excel Online and the Excel mobile apps (iOS and Android). In Excel Online, select columns or rows, then choose AutoFit from the Home tab. In mobile apps, tap to select, then look for the AutoFit option in the format or layout menu—labels may vary slightly by app version.