Restore leading zeros Excel stripped from a CSV

A CSV has no types. When Excel opens 00501, it stores the number 501 and throws the zeros away. Save the file, and the ZIP, UPC, routing number, or employee ID is permanently shorter. Carriers, barcode scanners, and payroll systems then reject the row.

Before

name,zip,state
Holtsville,501,NY
Boston,2115,MA

After

name,zip,state
Holtsville,00501,NY
Boston,02115,MA

The tool looks at the column name (ZIP, UPC, EAN, routing, and other ID-like headers) and pads digit-only values to the usual width — five digits for a US ZIP, twelve for UPC-A, and so on. A plain quantity column is left alone. Padding is a best effort: the tool cannot know a width that no standard defines, so always read the preview.

Zeros that were already missing, with no hint of the original width, cannot be invented safely. Re-export from the source and import the column as text, or use a custom fix if you can provide the rule (for example “employee IDs are always six digits”).

Open the tool

FAQ

How do I stop Excel eating the zeros again?

Download the Excel-safe CSV. ID columns are written as ="00501" text formulas, and you can add a UTF-8 BOM so Excel recognises the encoding. Opening the file with the Text Import wizard and setting the column to Text is still the most reliable habit.

Does this work for UK postcodes or alphanumeric SKUs?

No automatic padding is applied to mixed letters and numbers, and UK postcodes are not a fixed digit width. The diagnosis will still catch scientific notation and quoting problems in the same file.

Who runs CSV Clinic?

Short Solutions runs CSV Clinic. The repair tool on this site is free and stays in your browser. Optional paid fixes are listed on the pricing section.