To autofit a row in Excel for Microsoft 365 on Windows, select the row or cells in it, then choose Home > Format > AutoFit Row Height. You can also double-click the lower border of the row number; Excel adjusts the height to display the cell content it can fit.
What AutoFit changes
AutoFit Row Height changes the height of selected rows, not their column widths. Excel calculates a height based on the visible cell contents, the widths of the columns, font settings, and text-wrapping settings. The goal is to show the contents without clipping them vertically. If a row contains a short value in every cell, AutoFit may leave it at its current or standard-looking height because no extra space is needed.
Row height is measured in points, while column width is based on character measurements. You generally do not need to convert between those units: AutoFit makes the adjustment for you. But the distinction matters when diagnosing a crowded worksheet. If a long heading is cut off at the right edge, the problem may be column width. If wrapped lines are hidden at the bottom of a cell, the problem may be row height.
AutoFit is not a permanent rule that keeps a row fitted as you edit. It adjusts the height when you run the command. If you later add text, change the font, or narrow a column, run AutoFit again if the contents become clipped.
Autofit one row in Excel
For a quick adjustment, use the row headers along the left side of the worksheet:
- Find the numbered row that needs more or less height.
- Move the pointer to the line between that row number and the next one.
- When the pointer changes to a vertical resize cursor, double-click the boundary.
Excel resizes that row to fit its contents. This method is convenient when you are working on one visible row and want to make a quick correction without opening the ribbon. To use the command instead, click any cell in the row, open Home > Format, and choose AutoFit Row Height. Selecting a cell in the row is enough; you do not have to select the entire row first.
If the height does not change, that does not necessarily mean AutoFit failed. Excel may already consider the current height sufficient, or the cell contents may be clipped for a reason that row height cannot fix, such as a narrow column or a merged-cell layout.
Autofit several rows at once
You can fit a group of rows in one operation. Select the row headers for the rows you want, then choose Home > Format > AutoFit Row Height. To select a continuous range, click the first row number and drag down to the last, or click the first row number, hold Shift, and click the last. For rows that are not next to one another, hold Ctrl on Windows while selecting each row header, then run AutoFit.
You can also select cells across multiple rows rather than selecting row headers. The command adjusts the height of every row touched by the selection. For the whole worksheet, click the Select All button at the top-left corner where the row and column headings meet, then choose AutoFit Row Height. This is useful after pasting a large block of content, though it may make the sheet harder to scan if different rows contain very different amounts of text.
On Windows, the ribbon key sequence Alt, H, O, A opens the Home tab’s Format menu and runs AutoFit Row Height. Press the keys in sequence rather than holding them all at once. Keyboard sequences can vary with interface language or customization, so the ribbon command or boundary double-click is a reliable alternative.
Use Wrap Text when content needs more lines
AutoFit is especially useful with wrapped text. Wrap Text keeps a long entry inside a column by displaying it on multiple lines; AutoFit then gives the row enough height to show those lines. Select the relevant cells and choose Home > Wrap Text. Then select the affected rows and choose Home > Format > AutoFit Row Height.
For example, suppose a cell contains a sentence explaining a product return policy. In a wide column it may fit on one line, but in a narrow column it might wrap to four lines. The row height needed depends on that column width and the font. Widening the column may reduce the number of lines and therefore the fitted row height. Conversely, narrowing it can create more lines, so the row may need to be autofitted again.
Wrapping and fitting are related but separate actions. Turning on Wrap Text does not always correct a row height that was previously set to a fixed value. Running AutoFit after enabling wrapping is a useful way to make the displayed text and row height agree. If the row still looks clipped, check whether the text is in a merged cell and whether the column is wide enough to be practical.
Why AutoFit may not work as expected
A common source of confusion is merged cells. Excel may not automatically calculate the required row height for text in a cell merged across multiple columns. The double-click method can appear to do nothing, or the result may not show all the wrapped lines. If you can change the layout, unmerge the cells and use Center Across Selection or adjust the column arrangement instead. If the merged layout is required, you may need to set the row height manually and check the result after changing the text or column widths.
Other situations can also affect the result:
- Wrap Text is off: a long entry may extend visually into empty cells or appear cut off at a neighboring value, rather than making the row taller. Enable wrapping if the text should occupy multiple lines within its cell.
- The column is too narrow: AutoFit Row Height cannot make a cell wider. Widen the column, wrap the text, or use a shorter display value.
- The row is hidden: a manually hidden row is not made visible just because you run AutoFit. Unhide it first if you need to inspect or adjust it.
- The height is already sufficient: a row with a deliberately large height may remain large because AutoFit is not a command to shrink every row to a preferred uniform size in all circumstances. Check the contents and try the command again after removing any manual sizing issue.
- The content exceeds Excel’s row-height limit: Excel cannot make a row taller than its maximum, which is about 409 points. Very large fonts or an unusually large amount of wrapped text can exceed what one row can display.
Also check font size, superscript or subscript formatting, and cells with line breaks inserted inside the text. These can change the vertical space required. If a row looks wrong only after printing, inspect Print Preview as well: page scaling and print layout can affect how the worksheet appears on paper, even though they do not replace the worksheet’s row-height setting.
Set a row height manually
AutoFit is best when the objective is to show all cell content. A fixed height is often better when a report needs consistent row spacing or when unusually long notes should not make the worksheet excessively tall. To set a specific height, select one or more row headers, choose Home > Format > Row Height, enter a value in points, and confirm.
For example, a table of monthly figures may be easier to read if every data row has the same height, even though one row contains a longer note. You could keep the data rows uniform and place the full note in a separate comments or details column. Another option is to let the data rows expand but apply a consistent height only to headings. Choose based on whether the sheet prioritizes showing every word in place or maintaining a compact, regular layout.
To return to a content-based height, select the relevant rows and run AutoFit Row Height again. If you need both uniform heights and readable long text, consider widening the column, shortening the displayed text, or separating detailed notes from the main table rather than forcing every row to accommodate the longest entry.
Windows, Mac, and Excel for the web
In Excel for Microsoft 365 on Windows, the ribbon route is Home > Format > AutoFit Row Height. The row-boundary double-click works as well. You can also use the Alt, H, O, A key sequence on a standard Windows installation.
In Excel for Microsoft 365 on Mac, select the row or cells and use Home > Format > AutoFit Row Height if that command is visible in the ribbon. Depending on the Mac interface and window size, you may need to open the Format menu or expand the ribbon controls. Double-clicking a row boundary is another direct method. The Windows Alt sequence is not a Mac shortcut; use the ribbon or the Mac menu commands instead.
Excel for the web also provides row-height controls on the Home tab, including AutoFit Row Height in the Format menu in supported layouts. The row-boundary double-click is a useful alternative in the browser. If the command is not visible, check the Format menu or open the workbook in the desktop app. Exact ribbon presentation can vary as Microsoft updates the web interface, but the underlying task is still to select the rows and fit their height to the contents.
When to choose AutoFit or another approach
Use AutoFit when rows should grow or shrink to display their contents, especially after changing column widths or enabling Wrap Text. Use a fixed height when a uniform report layout matters more than displaying every long entry in its original cell. For a sheet that will be read on screen, wrapping and fitting can make notes accessible without requiring horizontal scrolling. For a compact dashboard, a fixed height and carefully chosen column widths may be easier to navigate.
AutoFit is not the same as AutoFit Column Width. The row command changes vertical space; the column command changes horizontal space. Both commands are in Home > Format, and each can be useful after pasting content. If a worksheet has many long descriptions, first decide whether they should wrap in the table, be abbreviated, or appear in a separate detail area. That decision helps avoid a sheet where a few very long entries make scrolling cumbersome.
Before applying a change to a large worksheet, consider selecting a small sample of rows and checking the result. This is particularly useful when the sheet has merged headings, manually formatted heights, or many different font sizes. AutoFit is quick, but it cannot resolve layout choices that conflict with one another, such as requiring one merged heading to display several lines while also insisting that its row remain very short.
Frequently Asked Questions
What is the shortcut to autofit row height in Excel?
On Windows, select the row or cells and press Alt, H, O, A in sequence. You can also double-click the lower boundary of the row number. On Mac, use Home > Format > AutoFit Row Height or the row-boundary double-click; the Windows key sequence does not apply.
How do I autofit all rows in Excel?
Click the Select All button at the upper-left corner of the worksheet, where the row and column headings meet. Then choose Home > Format > AutoFit Row Height. This adjusts rows across the selected sheet, including rows that may not need a height change.
Why does AutoFit not work on merged cells?
Excel may not calculate the correct height for wrapped text in merged cells. Unmerge the cell if the layout permits, or set the row height manually and verify that the full text is visible. Adjusting the column layout can also help avoid the problem.
Does AutoFit work with wrapped text?
Yes. Turn on Home > Wrap Text, then run AutoFit Row Height for the affected rows. If the column width or text changes later, run AutoFit again because the number of wrapped lines may have changed.
How do I make every row the same height?
Select the rows, choose Home > Format > Row Height, and enter a height in points. AutoFit is designed to fit content, so it is not the best choice when your priority is a consistent height across rows.
Related
- Protect Sheet in Excel: Allow Editing Specific Cells
- Excel Conditional Formatting Icon Sets Explained
- Markdown Table Merge Cells? What You Can Do
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Double Space in WordTo double-space text in Microsoft Word, select the text, then choose Home > Line and Paragraph Spacing >…
- Excel Date Without Year: Display a Date Without Its YearTo show an Excel date without its year, select the date cells, press Ctrl+1 on Windows, choose Number…
- Sort Data in Google Sheets by Date: Step-by-Step GuideTo sort data in Google Sheets by date, select the entire table, choose Data > Sort range >…
- How to Add Page Numbers in Word Documents, Step by StepTo add page numbers in Word for Microsoft 365 on Windows, open the document and select Insert >…
- Track Changes in Microsoft Word: Review and Manage EditsTo use Track Changes in Microsoft Word, open the document, select Review > Track Changes, and edit as…
- Make a Flowchart in Word 2016: Steps, Layout, and TipsTo make a flowchart in Word 2016, choose Insert > Shapes, select flowchart shapes and connectors, then place,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.