How to Indent Text in Google Sheets

Learn how to indent text in Google Sheets with a custom number format, or use formulas to add spaces on your computer or phone.

Contents

Don't Miss the Good Stuff

Get tech news that matters delivered to your inbox.

To indent text in Google Sheets on a computer, select the text cells, open Format > Number > Custom number format, enter " "@, and click Apply. Include the quotation marks and four spaces between them. This adds a visual indent without changing the stored text.

For indentation that becomes part of the text, use a formula that adds leading spaces in another cell. Formulas also work in the Android, iPhone, and iPad apps, so you can use them on your phone.

The short version

  • Keep values unchanged: Apply a custom number format to indent the displayed text.
  • Add real spaces: Use a formula in a separate cell when the spaces must become part of the text.
  • Work on mobile: Enter an indentation formula and tap Done.
  • Handle multiple lines: Prefix explicit line breaks or use a spacer column for a wider layout offset.

MethodBest useEffect on text
Custom number formatVisual indentation on desktopPreserves stored values
Paint format or Paste format onlyReusing an existing indentCopies other formatting too
REPT formulaAdjustable spacing on desktop or mobileCreates text with leading spaces
ARRAYFORMULAIndenting a range at onceUses a separate output range
Nonbreaking space formulaSpacing that resists trimmingAdds actual characters
Explicit line prefix formulaIndenting manually separated linesAdds characters before each line
Spacer columnOutlines and layout offsetsUses adjacent columns

Apply a visual indent on your computer

Select the cells containing your text, then click Format > Number > Custom number format. To indent an entire column, select its column letter before opening the menu. Enter this pattern in the format field:

"    "@

Click Apply to display four spaces before the text. Increase or decrease the spaces inside the quotation marks to adjust the indent, keeping the @ after the closing quotation mark. The underlying cell value stays unchanged, so use this method when you only need a visual indent.

This pattern is intended for text cells. It does not establish a paragraph margin for every line created by automatic text wrapping. For text with explicit line breaks, use the multiline formula below.

Copy the indent to other cells

Select a cell that already has the indent you want, click Paint format in the toolbar, then select the destination cells. For several separate destinations, double-click Paint format before selecting them. Click Paint format again when you finish.

Alternatively, copy the formatted cell with Ctrl + C on Windows or ChromeOS, or Command + C on Mac. Select the destination cells, then click Edit > Paste special > Paste format only. Both approaches copy other cell formatting along with the indent, and Paste special works within a single spreadsheet.

Add actual spaces with a formula

Use a formula when you need leading spaces in the resulting text value. With your original text in A2, select an empty output cell and enter the following formula. Press Enter on a computer to finish:

=REPT(" ",4)&A2

The formula repeats a space four times, then joins those spaces to the text in A2. Change 4 to adjust the amount of indentation. The result contains actual leading spaces, which can affect matching, sorting, and calculations.

For an outline with different indentation levels, store a level number in B2 and enter the following formula in another empty cell. Level 0 adds no spaces, level 1 adds four, and level 2 adds eight:

=REPT(" ",B2*4)&A2

When ordinary whitespace would otherwise be trimmed, use nonbreaking spaces instead. Enter the following formula in an empty output cell to add four nonbreaking spaces before the text in A2. These characters become part of the output text:

=REPT(CHAR(160),4)&A2

Indent a range with one formula

For a list in A2:A20, leave B2:B20 empty and select B2. Enter this formula to add four spaces before each nonempty source cell while keeping blank source rows blank:

=ARRAYFORMULA(IF(A2:A20="","","    "&A2:A20))

The results expand into the output range, so keep B2:B20 clear. If the formula cannot expand because those cells contain other content, move the output to an empty range. Adjust both references to A2:A20 when your source list uses different rows.

Enter indentation formulas on your phone

On Android, open the spreadsheet and tap an empty output cell. Enter the following formula, replacing A2 with the cell containing your text, then tap Done:

=REPT(" ",4)&A2

On iPhone or iPad, double-tap an empty output cell, enter the same formula, and tap Done. You can also enter the nonbreaking space or array formulas in the mobile cell editor. Formula entry provides a mobile alternative to creating custom number formats on a computer.

Indent separate lines within a cell

Adding spaces at the beginning of a cell does not create an indent for every automatically wrapped line. If A2 contains explicit line breaks, enter the following formula in another cell to add four nonbreaking spaces before the first line and after each line break:

=REPT(CHAR(160),4)&SUBSTITUTE(A2,CHAR(10),CHAR(10)&REPT(CHAR(160),4))

Enable Wrap text for the output when needed; you can follow the steps to wrap text in Google Sheets to display the multiline result. The added prefixes follow explicit line breaks, so any additional lines created by automatic wrapping will not receive their own prefix.

Use a spacer column for an outline

A narrow column gives you a layout offset without adding spaces inside a cell. On a computer, right-click the column letter containing your list and choose Insert 1 left. Drag the new column's right edge to make it narrow; you can also add columns in Google Sheets when you need more room for the layout.

Put parent labels in the left column and child labels in the next column, leaving the parent column blank on child rows. For a uniform offset, leave the spacer column empty and keep every label in the next column. This offsets the cells themselves without prefixing their text.

On Android, touch and hold the spacer column's letter, tap Resize column, enter the width, and tap Save. On iPhone or iPad, select the spacer column and drag the edge of the cell containing its column letter to narrow it. To insert a column in either mobile app, select a column, tap Insert, and choose the appropriate insertion option.

Remove or adjust the indentation

To remove a custom-format indent, select the affected text cells and open Format > Number > Custom number format. Replace the indentation pattern with the following format, then click Apply:

@

This removes the display prefix, but it does not delete spaces stored in the text. For a REPT formula, reduce the repeat count to make the indent smaller or change it to 0 to add no spaces. Spaces manually pasted into a cell must be removed from the cell's text.

Frequently Asked Questions

Does Google Sheets have an Increase indent button or shortcut?

Google's current Sheets formatting help and keyboard shortcut list do not include an Increase indent or Decrease indent command or a dedicated indentation shortcut, so use custom number formatting or a formula instead.

Can you open the custom format editor with the keyboard?

Select your cells and press Alt + / on Windows or ChromeOS, or Option + / on Mac. Type Custom number format and select the matching command. Enter " "@ and click Apply. Shortcut availability can depend on your keyboard and language.

Why do spaces typed before text disappear?

Google Sheets trims text input by default, so ordinary spaces typed before text are not a reliable manual indentation method. Nonbreaking spaces are not trimmed, which makes them an alternative when you need to insert spacing directly into existing text.

Can you indent by a character width instead of a number of spaces?

Google's number format help documents an underscore token that adds a space equal in width to the following character, but its format reference also says the @ text token is not compatible with other special characters. For text cells, set the indent width by changing the number of spaces inside the quotation marks in " "@.

Why does an indentation formula reject its commas?

Your spreadsheet's locale can require semicolons instead of commas between formula arguments. The examples use English function names and comma separators, so adjust the separators to match your spreadsheet's locale.

Can you paste nonbreaking spaces directly into an existing cell?

Generate a nonbreaking space in a spare cell with =CHAR(160), then copy the resulting character. Double-click the destination cell on a computer or double-tap it on mobile, place the insertion point before the text, and paste the character as many times as needed. Finish with Enter on a computer or tap Done on mobile.

Share