In this article:

How to Keep Leading Zeros in Google Sheets (2024 Update)

December 5, 2024

How to Keep Leading Zeros in Google Sheets

There are a number of methods on how to add leading zeros in Google Sheets. We will explore these methods through step by step tutorials below. 

Keep Leading Zeros in Google Sheets with Apostrophes

Before typing your number, add an apostrophe ('). For example, enter '001234 for Employee IDs. Google Sheets treats the entry as text and keeps the leading zeros. Check that each cell correctly shows the leading zeros. The apostrophe will not be visible in the cell once you press enter, only in the formula bar.

google sheets leading zeros

Formatting Cells as Text

Follow the steps below to format cells as text. 

1. Select the Cells for Data Entry

Click on the cell or drag over the range where you’ll enter data. Select all cells where you plan to input numbers with leading zeros.

how to keep leading zeros in google sheets

2. Change Cell Format to Text

Go to the "Format" menu, navigate to "Number", and then select "Plain text". This action sets the cell format to text.

how to add leading zeros in google sheets

3. Input Your Data

Now, type your numbers into these cells. Because they are formatted as text, Google Sheets will keep the leading zeros.

google sheets keep leading zeros

Using Custom Formats to Preserve Leading Zeros

Follow the steps  below to preserve leading zeros using custom formats.

1. Select Cells for Formatting

Highlight the cells where you want to keep leading zeros. This method is useful for numerical data where format consistency is important.

keep leading zeros in google sheets

2. Access Custom Number Format Options

With the cells selected, click on "Format", choose "Number", then "Custom number format".

google sheets add leading zeros

3. Create and Apply a Custom Format

In the custom format field, enter the format with leading zeros. For example, use 000000 for six-digit Employee IDs, 000000 for six-digit Product Codes, and 00000 for five-digit ZIP Codes. Click "Apply".

how to stop google sheets from removing leading zeros

4. Confirm Custom Formatting

Ensure your data appears correctly with leading zeros. Custom formats allow numerical values to retain leading zeros and stay in a consistent format.

We hope that you now have a better understanding of how to keep leading zeros in Google Sheets. If you enjoyed this article, you might also like our article on how to add emojis to Google Sheets or our article on how to crop an image in Google Sheets.

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->