Autofitting text in Excel automatically adjusts column widths or row heights to display all content without truncation, making your data easier to read. This works for both single cells and selected ranges, and requires no add-ins or special tools—just the built-in Excel features.

What You'll Need

  • Microsoft Excel (any modern version: Excel 2016, 2019, 2021, Microsoft 365, or Excel for the web)
  • A spreadsheet with text that appears cut off or wrapped awkwardly
  • No additional software or permissions required

Step-by-Step

  1. Open your Excel workbook and navigate to the worksheet containing the data you want to adjust.
  2. Select the column(s), row(s), or specific cells you wish to autofit. To select an entire column, click its letter header at the top (e.g., column A). To select multiple columns, click and drag across headers or hold Ctrl (Windows) / Command (Mac) while clicking individual headers.
  3. With your selection active, go to the Home tab on the Excel ribbon.
  4. In the Cells group, click the Format button.
  5. From the dropdown menu, choose Autofit Column Width if you selected columns, or Autofit Row Height if you selected rows. If you selected both rows and columns, Excel applies the appropriate autofit for each axis.
  6. Excel will instantly resize the selected columns or rows to fit the longest text content in each, including wrapped text. You’ll see the column width or row height adjust to reveal the full content without scrolling or manual dragging.

Common Mistakes

  • Confusing Autofit with Wrap Text: Autofit changes dimensions; Wrap Text changes how text flows within a cell. You may need both: enable Wrap Text first (Home > Alignment > Wrap Text), *then* autofit row height to accommodate the wrapped lines.
  • Forgetting to select the right range: If you only select a single cell in a column, Excel may not calculate the correct width for the entire column—always select the full column or a group of cells spanning multiple rows.
  • Ignoring merged cells: Autofit does not work reliably with merged cells. If your data includes merged cells, unmerge them first (Home > Merge & Unmerge > Unmerge Cells), autofit, then re-merge if necessary.
  • Assuming it fixes hidden characters: Extra spaces, line breaks (Alt+Enter), or non-printing characters can cause unexpectedly wide columns. Clean your data with TRIM or CLEAN functions before autofitting.
  • Using it on filtered data only: If filters are applied, autofit considers only the visible rows. Turn off filters first, or manually adjust to accommodate hidden data.

Tips

  • Double-click method: Position your cursor on the right edge of a column header (e.g., between A and B) until it turns into a double-sided arrow with a small vertical line. Double-click to autofit that column instantly—no ribbon navigation needed.
  • Keyboard shortcut: Press Alt → H → O → I (on Windows) to run Autofit Column Width; use Alt → H → O → A for Autofit Row Height.
  • Combine with Ctrl+Click: Hold Ctrl while clicking column headers to select non-contiguous columns, then autofit all at once.
  • Use AutoFit for tables: If your data is formatted as an Excel Table (Ctrl+T), autofit still works—but be aware that new rows added to the table may require re-autofitting if they contain longer text.
  • Preserve manual widths: If you’ve set custom widths and want to revert to autofit, select the column(s), right-click a header, choose Column Width, and enter a standard width (e.g., 8.43 for default), but this is rarely needed—autofit is dynamic and recomputes on content change.

Troubleshooting

If autofit doesn’t expand columns or rows as expected, follow these checks:

  1. Check for frozen panes: If panes are frozen (View > Freeze Panes), autofit may behave inconsistently. Temporarily unfreeze panes, autofit, then refreeze.
  2. Verify cell formatting: If a cell is formatted as Text but contains a formula that returns text, or if the cell is set to hidden (Format Cells > Protection > Hidden), Excel might not read its full content. Right-click the cell > Format Cells > Protection, ensure Hidden is unchecked.
  3. Inspect for extreme characters: Long URLs, special symbols, or unbroken strings (e.g., base64 text) can cause columns to stretch beyond view. Use Text to Columns (Data > Text to Columns > Delimited > Finish) to split long strings, or wrap text manually.
  4. Restart Excel: Rarely, Excel’s rendering engine may glitch. Close and reopen the workbook—or restart Excel entirely—to refresh the interface.
  5. Check for protected sheets: If the worksheet is protected (Review > Protect Sheet), autofit may be disabled. Unprotect the sheet (enter password if set), autofit, then re-protect if security is needed.
  6. Try a different file: Copy your data into a new, blank workbook. If autofit works there, your original file may be corrupted. Save the new file and discard the old one.

Frequently Asked Questions

Does autofit work with merged cells?

No—Excel does not correctly calculate width or height for merged cells. Unmerge the cells first, autofit, then re-merge if your layout requires it.

How do I autofit multiple sheets at once?

Hold Ctrl (Windows) or Command (Mac) while clicking sheet tabs at the bottom to select multiple sheets simultaneously. Then apply autofit—changes apply to all selected sheets. Remember to deselect sheets afterward to avoid accidental edits.

Why does my column still cut off text after autofitting?

Autofit only considers visible content. If text is wrapped across lines and row height wasn’t autofit, or if the cell contains a line break (Alt+Enter), Excel may not expand enough. Enable Wrap Text, then autofit row height separately.

Can I autofit text in Excel on a Mac?

Yes—the steps are nearly identical. Use the ribbon (Home > Format > Autofit Column Width/Row Height) or double-click the column header divider. On Excel for Mac, the ribbon layout is consistent with Windows.

Does autofit work in Excel Online (the web version)?

Yes—Autofit Column Width and Row Height are fully supported in Excel for the web. Use the Home tab > Format dropdown, or double-click column dividers in the browser.

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

Autofit Column Width adjusts horizontal space to fit the longest *single-line* text in a column. AutoFit Row Height adjusts vertical space to fit *all lines of wrapped text* in a row. Use both when your text wraps across multiple lines.