How to Autofit in Microsoft Excel: Rows and Columns

How-to basics · Updated November 20, 2026

To autofit in Microsoft Excel for Microsoft 365 on Windows, select the column or row, then double-click the boundary on its header; Excel resizes it to fit the contents. You can also use Home > Format > AutoFit Column Width or AutoFit Row Height. Autofit is useful when text, numbers, or formula results are cut off, and it changes the size of cells rather than changing their contents.

What You’ll Need

  • An Excel workbook with the rows or columns you want to resize.
  • Permission to edit the worksheet. If the sheet is protected, you may need the password or the owner to allow formatting changes.
  • A moment to check the result: autofit uses the displayed contents and can make a column wider or a row taller than you want.

Step-by-Step

  1. Open the worksheet and identify what is cut off. Look at the column letters across the top and row numbers down the left. If a cell shows only part of a word, or a number appears as number signs, its column may be too narrow. If text in a row is hidden, the row height may need adjustment. Select the worksheet tab where the issue appears; sizing changes apply to the active sheet and do not automatically change every sheet in the workbook.
  2. Autofit one column with the mouse. Move the pointer to the right edge of the column letter at the top of the sheet. When the pointer changes to a horizontal resize symbol, double-click the boundary. Excel adjusts that column to fit the widest displayed cell content in it. For example, if column B contains short product names and one long name, Excel sizes B to show the long name without clipping it. You can also drag the boundary instead, but dragging sets a width by eye rather than using AutoFit.
  3. Autofit one row with the mouse. Move the pointer to the lower edge of the row number, then double-click when the vertical resize symbol appears. Excel adjusts the row height to fit its contents. This is especially useful after turning on text wrapping or pasting a longer description into a cell. If the row contains several cells, the height must accommodate the tallest displayed content in that row.
  4. Autofit several adjacent columns or rows. Select the column headers or row numbers you want to change. To select adjacent columns, click the first letter and drag across the others, or click the first and Shift-click the last. For adjacent rows, use the same approach on their row numbers. Double-click a boundary within the selected headers. Excel applies AutoFit to the selected columns or rows, allowing each one to size to its own contents. This is quicker than repeating the operation one at a time.
  5. Use the ribbon for precise commands. Select a cell in the column or row you want to resize, or select multiple columns or rows. On the Home tab, find the Cells group and choose Format. Choose AutoFit Column Width for selected columns or AutoFit Row Height for selected rows. If you select a cell rather than a whole column, Excel applies the relevant sizing command to the cell’s column or row. The ribbon is a useful alternative when the header boundary is difficult to target.
  6. Fit all columns or rows on the worksheet. Click the Select All button at the top-left corner of the grid, where the row and column headers meet. With the whole sheet selected, choose Home > Format > AutoFit Column Width. If you also need to fit row heights, choose Home > Format > AutoFit Row Height. You can instead double-click a column boundary or row boundary after selecting the whole sheet. Use this whole-sheet method thoughtfully: it can make many columns wider and produce a worksheet that is harder to scan.
  7. Use the Windows keyboard sequences if preferred. Select the target cells, columns, or rows. Press Alt, then H, then O, then I to run AutoFit Column Width. To run AutoFit Row Height, press Alt, then H, then O, then A. These are ribbon Key Tips: press the keys in sequence rather than holding them all down together. If your Excel language or ribbon layout uses different Key Tips, follow the letters displayed on screen or use the Home > Format menu path instead.
  8. Check the result and make a manual adjustment if needed. Review the resized area at normal zoom. Autofit may create very wide columns when a cell contains a long entry, or rows may become tall when wrapping is enabled. Drag a header boundary to set a more compact size, or use Home > Format > Column Width or Row Height to enter a specific measurement. AutoFit is a starting point, not a requirement to keep the exact size it chooses.

In Excel for Mac, the double-click method works on the row and column header boundaries. The ribbon also includes AutoFit Column Width and AutoFit Row Height under Home > Format. The Windows Alt, H, O sequences are not the Mac equivalent, so use the ribbon or the mouse on Mac. In Excel for the web, select the relevant headers and use the Home tab’s Format options; the double-click boundary method is also available in the worksheet grid.

Common Mistakes

Double-clicking the cell edge instead of the header boundary: The resize target is the line between column letters or row numbers, not the border between cells in the grid. If the pointer does not show a resize symbol, move it back to the header.

Expecting AutoFit to wrap text: AutoFit Column Width makes a column wide enough for its contents; it does not turn on Wrap Text. If you want a narrow column with several lines of text, select the cells and choose Home > Wrap Text, then use AutoFit Row Height. Wrapping changes how the text is displayed, not what is stored in the cell.

Applying AutoFit to an entire sheet unnecessarily: One unusually long note, address, or pasted URL can make a column very wide. Select only the affected columns or rows when possible, then manually reduce the width if the result is impractical.

Expecting merged cells to behave like ordinary cells: Excel may not AutoFit a row or column correctly when the relevant content is in merged cells. Merged-cell sizing often needs a manual adjustment. Also check that you have selected the intended rows or columns rather than just a small range of cells.

Confusing hidden content with clipped content: AutoFit does not reveal a row or column that has been hidden. A hidden row or column must first be unhidden; otherwise, changing the size of nearby visible cells will not display it.

Tips

For a one-off correction, AutoFit just the affected column or row. For a report or data table that needs consistent proportions, use AutoFit first and then set a shared width or height where a uniform layout matters. You can select multiple columns and use Home > Format > Column Width to give them the same measurement; this is different from AutoFit, which measures each column’s contents.

When text should remain readable without making a column excessively wide, consider wrapping it. Select the cells, choose Home > Wrap Text, and then autofit the row heights. If a row still does not show all lines, increase its height manually. Check for manual line breaks in the cell, as they can add extra lines and make the row taller than expected.

Remember that AutoFit responds to what Excel displays. A formula cell is sized for its visible result, not for the length of the formula typed in the formula bar. Number formats matter too: a date, currency amount, or percentage may need more width than the underlying value alone suggests. If a column shows number signs, increase its width or choose a more compact number format; the signs usually indicate that the value cannot fit in the current display width.

For a cleaner printout, inspect the worksheet in Print Preview after sizing. A column that fits perfectly on screen can still make the printed page too wide. You may need to change page orientation, scaling, or margins separately; AutoFit adjusts worksheet dimensions but does not set print layout. Consider saving the workbook after making a large whole-sheet adjustment so you can easily return to the intended layout if needed.

Troubleshooting

AutoFit does not change the column width or row height: Confirm that the correct worksheet is active and that you selected the intended column or row. Check whether the sheet is protected; protection can prevent formatting changes. If a particular boundary is hard to reach, select the header and use Home > Format > AutoFit Column Width or AutoFit Row Height instead.

The text still looks cut off after AutoFit: Check for merged cells, since AutoFit may not size them as expected. Also check whether the content is in a hidden row or column, whether another cell’s content is obscuring the display, and whether the column contains a long entry that would require an impractical width. Try unmerging only if appropriate for the worksheet, then autofit again; otherwise set the size manually or use wrapping.

A wrapped row is still too short: Confirm that Wrap Text is enabled for the cell, then run AutoFit Row Height again. If the cell is merged, or the row has a manually fixed height, AutoFit may not produce the expected result. Drag the bottom edge of the row number to make it taller, or choose Home > Format > Row Height and enter a larger value.

The column becomes much wider than expected: Find the longest cell entry in that column, including content far down the worksheet. A long URL or note may be setting the width. Autofit only the rows or columns you need, wrap long text, or set a practical width manually. If the extra-wide content is accidental, correct or remove it before running AutoFit again.

The command is unavailable or has no effect: Look for a protected-sheet notice, verify that the workbook is not in a restricted editing state, and try selecting the headers rather than individual cells. In Excel for the web, confirm you are in editing mode rather than viewing the workbook. If the ribbon is collapsed, expand it or use the header-boundary method.

Frequently Asked Questions

What does AutoFit do in Excel?
AutoFit adjusts selected column widths or row heights to show their displayed contents. It does not edit cell values, apply wrapping, or choose a print layout.

Is there a shortcut to AutoFit columns in Excel?
On Windows, select the target and press Alt, H, O, I in sequence. For row height, press Alt, H, O, A. On Mac, use Home > Format or double-click the relevant header boundary.

Can I autofit every column and row at once?
Yes. Click the Select All button at the top-left of the grid, then run AutoFit Column Width and AutoFit Row Height from Home > Format. You can run only the command you need.

Why does AutoFit make a column too wide?
Excel sizes it to fit the longest displayed entry in that column. A long note, URL, or other outlier can set the width. Wrap that text, select a smaller area to autofit, or set the column width manually.

Does AutoFit work with merged cells?
Not reliably. Merged cells can prevent Excel from calculating the needed dimensions automatically. Adjust the row height or column width manually, or consider a layout that does not rely on merged cells.

Will AutoFit change my data?
No. It changes the display dimensions of rows or columns only. It does not change cell values or formulas, though a different width can make more or less of a value visible.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.