Skip to main content

Spreadsheet type-conversion problem

Stop Leading Zeros Disappearing from CSV Values

Preserve ZIP codes, account numbers, SKUs, and phone fields that begin with zero when opening or importing CSV data.

Use the matching tool

CSV Viewer

Open CSV Viewer

What the error actually means

CSV stores text, not spreadsheet cell types. When Excel sees 00127, it often guesses that the value is a number and displays 127. The source CSV may still contain the zeros; the damage often occurs during opening or saving.

Likely causes

  • The spreadsheet automatically inferred an identifier column as numeric.
  • The CSV was opened by double-clicking instead of imported with explicit column types.
  • A previous spreadsheet save already removed the zeros.
  • A formula or numeric conversion transformed the identifier.

Identifier treated as a number

Problem

ZIP displayed as 127

Correct pattern

ZIP imported as text: 00127

A safe repair workflow

  1. 1Inspect the original in the CSV viewer to confirm whether the zeros still exist.
  2. 2In Excel, use Data → From Text/CSV instead of opening the file directly.
  3. 3Set ZIP, SKU, phone, and account columns to Text in the import controls.
  4. 4Save a new copy and confirm the identifier length before uploading it elsewhere.

How to verify the result

A file that downloads successfully is not automatically a correct file. Check the result at both the structural and business-data levels:

  • Known fixed-width identifiers retain their full length.
  • Long account numbers do not switch to scientific notation.
  • The exported CSV text still contains the leading zeros.
  • A sample re-import matches the original values character for character.

Read the deeper guides