How Do You Autofit Row Height in Google Sheets?

Dave | November 16, 2022 |

You’ve seen sheets where the row heights seem to fit perfectly around the data inside them. Maybe you asked someone how to size your rows perfectly and they did it in a second whilst you weren’t looking. Either way, you are here to learn how it’s done and I’m here to show you. It’s pretty easy when you know how. But there is more than just 1 way to size a row, as you’ll see.

The quickest, niftiest and most impressive being…

Double click the sizing arrow to Autofit row height

When you move your mouse over the bottom edge of a row heading, it will turn blue and your cursor will turn from an arrow into a vertical sizing cursor. This cursor is an up and down arrow. When you see this cursor, all you need to do is double-click your left mouse button. That’s the primary mouse button. Some left-handers may have it configured to be the right button. But it’s rare!

Double click the sizing cursor to auto-fit row height

Neat yeah? Here are the other ways you can resize a row (or all the rows in your sheet).

What is Auto-fit row height and what does it do?

Auto fit, or Fit to data as it’s known in Google Sheets will automatically size the selected row or rows so that they are high enough to show all the contents of all the cells in that row. If you select multiple rows, they will size their heights independently to allow all the contents to show.

The following example has 3 rows that were all sized using Fit to data. You can see they are all sized to ensure all the text is visible in each row.

3 rows with different height contents after 'Fit to contents' is used.
‘Fit to contents’ sizes rows independently

Use the column menu to ‘Specify row height’ or ‘Fit to data’

If you select an entire row by clicking on the row header. Then click the secondary mouse button (right click for most). It shows you the following menu.

Selected row context menu

Click the Resize the row option and you will see the following dialog.

The row resize dialog
You can choose to specify the row height or fit to data

This gives you the options of being able to specify the row height by entering a height in pixels or you can select Fit to data. Fit to data is the same as auto-fit row height and will make the row automatically size to make everything visible.

Resize a row by pasting row height

Whilst you CAN resize a row by pasting a column width, unfortunately you CAN’T do the same with row height!

When you select a column and hit ‘copy or CTRL+C, you are copying the data values, the formatting (font, bold, underline, highlighting), and also the size of the column. What’s cool is that when you right click and select Paste special you can select to paste Column width only.

Paste special menu showing 'column width only'
You can paste a column width, but not a row height

This allows you to size one column to your perfect width and then replicate that sizing across any other columns by just pasting it. But you CAN’T do it with row height!

What is the shortcut key for autofit in Google Sheets?

There is no keyboard shortcut for autofit or Fit to data in Google Sheets. The quickest way to access the Resize menu from a keyboard is to select a row using the row select shortcut, and then use the context menu shortcut to open the row context menu, and then either switch to mouse or hit the down arrow 9 times to select the row Resize options for the row.

Here’s the keyboard sequence:

  1. Select a row: Shift+Space
  2. Open the context menu:
    Ctrl+Shift+\ or
    Ctrl+Shift+x or
    Shift+F10
    (replace Ctrl with for Mac)
  3. Select Resize using the down arrow nine times x 9
  4. Use Tab and the up and down arrows to select the option you want: Fit to contents or specify a size
  5. Hit Enter () to confirm your choice

It’s tedious. Until they add a shortcut to this feature, I think double clicking on the row sizing line will win every time!

How do I get row height to all cells in Google Sheets?

First, select all cells by clicking the square where the row and cell headers meet, or to hit Ctrl+a (Win, ChromeOS), +a (Mac)

Select all click location
Select all by clicking here

Then you need to mouse over the border of a row until you see the vertical sizing cursor, and double click.

Double click the sizing cursor to auto-fit row height

Another way, if all your rows have data and are together, is to select them using the shortcut for Select All Ctrl+a (Win, ChromeOS), +a (Mac). Be sure not to click this twice. Doing this will select the entire sheet (column header included) and you will not see the row resize options on the context menu.

Then right click or open the context menu using Ctrl+Shift+x (Win, ChromeOS), +Shift+x (Mac).

From here, you will see an option to resize the rows you have selected.

Resize selected rows

Then you can choose either to enter a specific row size using the pixel size box, or to select Fit to data for all the rows in your sheet with data.

How do I lock row height in Google Sheets?

Locking only the row height in Google Sheets it not possible.

It is possible in to protect an entire sheet, or a range of cells. This allows you to set permissions that only allow certain users to edit those cells or throw up a warning before they make cell edits. Adjusting a row height counts as editing a cell and you can stop it or warn about it using this method.

To protect a sheet, or range of sheets, use the option in the Data menu.

Protect sheets and ranges in the data menu
Protect sheets and ranges in the data menu

This is a useful feature, however it stops or warns you about ANY type of edit to a cell, even entering data, not just changing the row height.

Dave

I'm a Google Product Expert and mainly post on the subject of Google Sheets.

I've been a software engineer for over 20 years. The constant through all that time? Spreadheets.... Even though I can write programs I use them.... a lot. Sometimes there's just no better alternative!

Find out more about me here.

Leave a Comment