Autofit in Excel automatically adjusts row heights and column widths to fit the content, eliminating wasted space and improving readability. No special tools or add-ins are needed—it’s built into Excel for Windows, Mac, and online. Simply select the rows or columns you want to adjust and use the built-in autofit command.

What You'll Need

  • Microsoft Excel (any modern version: Excel 2010 or later for Windows, Excel 2016 or later for Mac, or Excel for the web)
  • A worksheet with text, numbers, or objects that need better spacing
  • Access to the mouse or keyboard shortcuts (no additional software required)

Step-by-Step

  1. Open your Excel file and navigate to the worksheet where you want to autofit cells.
  2. Select the rows, columns, or range you want to adjust:
    • For a single column: Click the column header (e.g., A, B, C) at the top.
    • For multiple columns: Drag across headers or hold Ctrl (Windows) / Command (Mac) while clicking non-contiguous headers.
    • For rows: Click the row number on the left side (e.g., 1, 2, 3).
    • For a specific range: Drag to highlight cells, or click and drag across headers/row numbers.
  3. Autofit columns:
    • Mouse method: Position your cursor on the right edge of the column header (e.g., between column A and B). The cursor will change to a vertical line with left/right arrows. Double-click to autofit.
    • Menu method: With columns selected, go to the Home tab > Cells group > click Format > choose Autofit Column Width.
    • Keyboard shortcut: Select columns, press Alt (Windows) or ⌘ + Option (Mac), then press H, W, A in sequence.
  4. Autofit rows:
    • Mouse method: Position your cursor on the bottom edge of a row header (e.g., between rows 5 and 6). The cursor changes to a horizontal line with up/down arrows. Double-click to autofit.
    • Menu method: With rows selected, go to Home tab > Cells group > Format > choose Autofit Row Height.
    • Keyboard shortcut: Select rows, press Alt (Windows) or ⌘ + Option (Mac), then press H, H, A in sequence.
  5. Autofit both rows and columns for a selection:
    • Select the entire block of cells (e.g., A1:D20).
    • Press Alt (Windows) or ⌘ + Option (Mac), then press H, A, A to autofit both dimensions at once.
    • Alternatively, use the menu: Home > Format > Autofit Column Width, then repeat for rows if needed. Note: Excel applies column width to all selected columns and row height to all selected rows—no single command does both simultaneously in older versions.
  6. Verify the result: Scroll through your sheet to ensure text isn’t truncated, wrapped text displays fully, and objects like shapes or images sit properly within cells.

Common Mistakes

  • Only selecting one cell in a row/column—autofit requires selecting the full row header or column header, or a continuous block. Selecting just cell A1 won’t autofit column A.
  • Confusing Autofit with Wrap Text—autofit adjusts size, but if text is wrapped (via Home > Alignment > Wrap Text), Excel may not expand the row enough if the cell contains very long lines. Always enable Wrap Text first if you need multi-line text to fit.
  • Using single-click instead of double-click—dragging the column/row border with a single click only adjusts manually. Double-clicking is required for autofit.
  • Ignoring merged cells—merged cells often prevent accurate autofit. Excel may not expand row height to show all content inside merged cells. Unmerge if possible, or adjust manually after autofitting.
  • Overlooking hidden content—if a cell contains a hidden object (e.g., a dropdown from Data Validation or a comment), autofit may not account for it. Show comments or check for drop-down arrows.

Tips

  • Use Ctrl + A twice to select the entire used range quickly before autofitting. Press Ctrl + A once to select the current region (around blank rows/columns), twice to select the entire sheet.
  • Combine with Paste Special—when pasting data into a table, use Home > Paste > Format to paste formatting, then autofit to match the source layout.
  • Set a minimum width/height—if autofit makes a column too narrow for readability, use the mouse to drag the border to a minimum (e.g., 10 characters wide), then reapply autofit.
  • For headers, use Bold + AutoFit—format header rows first, then autofit so larger font sizes are accommodated.
  • Check print preview before printing—autofit may cause content to overflow pages. Press Ctrl + P to preview and adjust margins or scale if needed.
  • Mac users: Use Track Changes carefully—if Track Changes is enabled, autofit may behave inconsistently. Turn it off via Review > Track Changes before adjusting.

Troubleshooting

If autofit doesn’t work as expected, follow these checks:

  • Text still truncated? Ensure Wrap Text is enabled. Go to Home > Alignment > toggle Wrap Text on, then autofit again.
  • Row height didn’t change? Verify no fixed height is set. Right-click a row number > Row Height and confirm it’s not set to a low value (e.g., 12.75). Reset by entering 0 (zero) to let Excel auto-calculate.
  • Column width too wide or too narrow? Check for extra spaces or non-printing characters. Press Ctrl + A to select all, then use Home > Editing > Find & Select > Go To Special > Blanks or Comments to locate hidden content.
  • Autofit ignores images or shapes? Resize or move objects manually. Autofit works only on cell contents (text, numbers, formulas), not floating objects. Right-click the object > Size & Properties > set Move and size with cells to help align with autofit changes.
  • Excel freezes or lags during autofit? Disable automatic calculations temporarily: Formulas > Calculation Options > Manual. Then re-enable after autofitting.
  • Using Excel Online or Mac and options missing? In Excel for the web, go to Home > Cells > Format > Autofit Column Width or Autofit Row Height (both available). On Mac, the menu path is identical under the Home tab.

Frequently Asked Questions

Does autofit work with merged cells?

Not reliably. Merged cells often prevent accurate autofit because Excel calculates height/width based on the top-left cell only. Unmerge cells first, apply autofit, then re-merge if needed—but expect to adjust manually afterward.

Can I autofit only specific rows in a large table?

Yes. Select only the rows you want (e.g., rows 5–10 by clicking row headers while holding Ctrl/Command), then use the menu or double-click the bottom border of one selected row header. Excel applies autofit only to the selected rows.

Why does my column width jump unexpectedly after autofit?

Long text or formulas with many characters (e.g., =TEXT(A1,"mm/dd/yyyy")) force wider widths. Check for hidden characters by selecting the cell and pressing F2 to edit—look for trailing spaces. Use =TRIM() to clean source data.

Does autofit affect printing?

Yes—autofit changes page layout. After autofitting, go to Page Layout > Scale to Fit to adjust width/height per page, or use Print Preview (Ctrl + P) to ensure nothing gets cut off.

Can I set autofit to happen automatically when I type?

No, Excel doesn’t support real-time autofit. You must trigger it manually via double-click, menu, or shortcut. Some third-party add-ins offer this, but they’re not built-in or recommended for security or compatibility reasons.

What’s the difference between Autofit Column Width and AutoFit Row Height?

Autofit Column Width adjusts horizontal space to fit the widest content in that column (based on the largest character count or object width). Autofit Row Height adjusts vertical space to show all content, especially important for wrapped text or multi-line entries. Use them separately or in sequence for full cell optimization.