Why Does Google Sheets Delete Zeros (Leading Zeros)?
Discover why Google Sheets deletes zeros, especially leading zeros, and how to prevent it. This urgent, practical guide covers quick fixes, formulas, and data-import tips to keep codes intact in 2026.

Zeros vanish in Google Sheets when data is interpreted as numbers. For a quick fix: 1) format the target cells as Plain Text or prefix values with an apostrophe to force text; 2) apply a custom number format like 00000 to display leading zeros; 3) if data is already loaded, use a TEXT formula like TEXT(A2,"00000") to restore length.
why does google sheets delete 0
Zeros are lost when Sheets decides a value is numeric, which makes any leading zeros disappear. This behavior is especially common with codes, IDs, and product SKUs that rely on fixed-length formatting. Understanding why this happens helps you choose the right strategy, whether you’re cleaning a dataset, preparing a template, or importing data from elsewhere. By the end of this guide you will know exactly how to stop Google Sheets from dropping those important zeros and maintain consistent formatting across your worksheets. As a practical note, this article uses the keyword why does google sheets delete 0 to address a frequent real-world pain point encountered by students and professionals alike.
How Sheets decides if a value is a number
Sheets applies automatic type detection: if the content looks like a number, it stores and displays it as a number. This default is convenient for calculations, but it can break when your data must preserve a specific length (for example codes like 00123). We’ll cover the control you have over this behavior, including cell formatting, data validation, and formula-driven solutions. The result is predictable handling of zeros rather than surprising truncation, a must-have for workbooks that require precise identifiers. The keyword why does google sheets delete 0 appears again here to reinforce the topic.
Quick checks you can do now
Before changing formulas or reformatting data, run a quick audit: (1) check the cell format—if it’s Number, change it to Plain Text; (2) review the import method—CSV or paste can strip leading zeros; (3) test with a tiny sample of codes to confirm the effect; (4) ensure there aren’t any hidden scripts or add-ons altering values. These simple steps often reveal the root cause and save you time. This quick checklist is designed for urgent troubleshooting.
Preserve zeros with text formatting
One of the simplest fixes is to treat the codes as text. Converting cells to Plain Text prevents Sheets from dropping leading zeros. You can also directly prefix values with an apostrophe (') when typing or pasting values. Both approaches ensure the data is stored as text, preserving the full length of identifiers. Keep in mind that once data is text, you’ll need TEXT-based formulas if you need numeric operations later, which is a common trade-off for data integrity.
Use a custom number format to display leading zeros
To display zeros while keeping data numeric, apply a custom number format such as 00000. This tells Sheets to display five digits for every value, padding with zeros where needed. Note that the underlying value remains numeric, which means you can still perform arithmetic if the data is converted back to numbers. This approach is particularly useful for codes or IDs that must always render with five digits.
Formulas to reintroduce zeros
If you already have a column of numbers and need to show leading zeros, formulas are your friend. The TEXT function is the most common solution: =TEXT(A2, "00000"). You can also combine with RIGHT or CONCAT to create fixed-length codes. Keep in mind that these formulas return text, so you cannot rely on numeric operations unless you convert back to numbers. This technique provides a reliable, reversible way to preserve formatting.
Importing data without losing zeros
When bringing data from external sources (CSV, TSV, or other sheets), lead zeros are easily dropped unless you predefine the format. Use an import workflow that sets the destination column to Plain Text, or pre-format the column as text before pasting. If you must import as numbers for calculations, apply a TEXT wrapper after import to reintroduce the zeros. This step is essential for workflows that integrate legacy data.
Practical examples and edge cases
Consider a list of product codes like 00123, 00045, and 98700. If these are treated as numbers, the codes will collapse to 123, 45, and 98700. By setting the column to Plain Text or using a fixed-length format (00000), you guarantee consistent display. Edge cases include mixed data types in the same column and regional settings that interpret decimal commas differently, which can also impact how zeros are shown. Practice with test data to avoid surprises.
Safety tips and best practices
Always test any change on a copy of your data first. If your sheet is shared, communicate the formatting rule to collaborators to prevent accidental overwrites. Keep a versioning strategy so you can compare before/after formatting. Finally, document the chosen approach in your sheet’s notes or a readme tab to help future users understand why zeros are preserved.
Steps
Estimated time: 30-60 minutes
- 1
Identify where zeros disappear
Review a small sample of codes to confirm whether zeros are dropped on entry or after import. Note whether the issue occurs in multiple columns or specific sheets.
Tip: Use a test column to avoid affecting real data. - 2
Decide on the approach
Choose whether you’ll treat codes as text or keep them numeric with a padding format. Align with downstream calculations.
Tip: For codes used in lookups, text is often simplest. - 3
Change format to Plain Text
Select the affected cells and set Format > Number > Plain Text. This prevents future zeros from being dropped on entry.
Tip: If you need calculations later, plan a parallel numeric column. - 4
Apply a custom format
If you want numeric storage but display as five digits, apply a custom format like 00000 over the target range.
Tip: Custom formats affect only display, not the stored value. - 5
Use TEXT to pad zeros
Enter =TEXT(A2, "00000") in a helper column to recreate the fixed-length codes. Copy-paste values if needed.
Tip: Remember this returns text, so convert back only if necessary. - 6
Handle imports carefully
Before pasting, format destination as Text or set locale to the correct settings to preserve zeros.
Tip: Test with a small sample before a full import. - 7
Validate results
Cross-check samples to ensure the zeros display consistently across sheets and dashboards.
Tip: Automation can help enforce consistency. - 8
Document the rule
Add a note in the sheet explaining the chosen approach so collaborators don’t revert the format.
Tip: Keep a short changelog for future reference.
Diagnosis: Some cells or columns lose leading zeros when values are entered or imported.
Possible Causes
- highCells are formatted as numbers (default behavior)
- highData pasted/imported as numeric values (e.g., from CSV)
- mediumLocale settings affect number formatting (decimal separators)
- mediumCustom formats not matching the intended length
- lowNo apostrophe used to force text on codes that must stay as text
Fixes
- easyChange cell format to Plain Text for affected range
- easyPrefix inputs with an apostrophe to force text
- easyApply a custom number format like 00000 to display zeros
- easyUse TEXT(A2, "00000") to reintroduce leading zeros in existing data
- mediumWhen importing, adjust locale or set destination format to Text before paste
FAQ
Why do zeros disappear when I enter codes in Google Sheets?
Google Sheets treats values that look like numbers as numeric, which strips leading zeros. Changing the cell format to text or using a padding approach preserves the zeros.
Zeros disappear because Sheets treats the value as a number. Use text format or padding to preserve leading zeros.
How can I keep leading zeros when importing data from CSV?
Set the destination column to Plain Text before import or use a pre-import script to pad zeros; using TEXT after import also works for display.
Imports can strip zeros; set the format to text first or pad after import.
Does locale affect zero handling?
Yes. Locale settings influence how numbers and decimals are recognized, which can affect whether zeros are kept or dropped during import or entry.
Locale matters for numbers and formatting; adjust if needed.
Is there a way to automatically preserve zeros across a column?
Yes. Apply a fixed-length display format (00000) or use TEXT formulas to generate fixed-length strings automatically.
You can automate retention with formats or formulas.
Will treating codes as text hinder calculations?
If you switch to text, numeric calculations won’t work until you convert back or work with a separate numeric column.
Text values won't calc as numbers unless converted back.
Where can I learn more about preserving data formats?
Check the How To Sheets guide on data formatting and leading zeros for practical, step-by-step instructions.
Look up leading zeros in How To Sheets for more guidance.
Watch Video
The Essentials
- Preserve zeros by treating codes as text when needed.
- Use a custom format to display leading zeros without changing values.
- TEXT formulas provide a reversible fix for existing data.
- Import settings and locale can silently remove zeros.
- Document formatting choices to prevent regressions.
