In this article:

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

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.

Automate repetitive tasks with Lido

Save hours on repetitive and tedious work. Lido is a new spreadsheet that connects your spreadsheets, forms, PDFs, and email inbox.

Trigger
Action
Select trigger
When a cell value in Google Sheets changes
Check Google Sheets for today's date
When a new row is added to Google Sheets
On new Google Form submission
Send me a daily reminder
On new Typeform submission
When a cell value in database changes
Check database for today's date
When a new row is added in database
When a new HubSpot customer is created
Select action
ADDCALENDAREVENT
Creates a one- or multiple-day calendar event with optional attendees
ADDHUBSPOT
Adds an object to Hubspot
ADDSLACKCHANNEL
Create a Slack channel, and optionally add a topic or members
CALLURL
Makes any HTTP request
CREATEGOOGLEDOC
Replaces [@column_name] values in a Google Doc with the corresponding table row's values
CREATEPDF
Replaces [@column_name] values in a Google Doc with the corresponding table row's values, then export it as a PDF
FETCH
Makes any HTTP request and returns the response
INSERTROWS
Inserts given array below defined values in given worksheet
SENDGMAIL
Sends an email using your Google account
SENDOUTLOOK
Sends an email using your Microsoft Outlook account
SENDSLACK
Sends a Slack message
SENDSMS
Sends an SMS message using your Twilio account
UPDATECELL
Updates cells with given values
UPDATEHUBSPOT
Updates a property of a Hubspot object
Trigger is required
Action is required
Get started