← All text tools

Fix leading zeros lost in Excel

Restore zeros to a column of zip codes or IDs and save a CSV as XLSX with chosen columns kept as text so Excel cannot change them.

  • Free
  • No sign-up
  • Works on any device

About Fix leading zeros lost in Excel

Excel reads 02134 in a CSV as the number 2134, so zip codes, product codes and ID numbers lose their leading zeros. This tool pads a chosen column back to a fixed length, for example a US zip code to 5 characters, and then gives you two safe ways to keep the zeros: an XLSX where the column is stored as text, or a CSV that writes each value as ="02134" so Excel keeps it. Only values made of digits are padded by default, so entries such as N/A stay untouched.

How to use Fix leading zeros lost in Excel

  1. Paste the column or table, or open a CSV file, and choose the column to fix.
  2. Set the total length, such as 5 for US zip codes, and the character to add in front.
  3. Download the XLSX with text columns, or turn on the Excel-safe option and copy the CSV.

Why use this tool?

Also known as

Frequently asked questions

Why does Excel remove the zeros when I open a CSV?

A CSV has no cell types, so Excel guesses and treats digit-only values as numbers, and numbers have no leading zeros. Opening the file through Data, From Text and choosing Text for the column also works.

Does the XLSX keep the zeros if I edit the cells later?

Yes for the chosen columns. They are stored as text with the Text number format, so typing 00123 into one of those cells keeps its zeros too.

Can it shorten values that are too long?

No. Values already at the target length or longer are left as they are and counted in the result, because cutting digits would change the identifier.

Is Fix leading zeros lost in Excel free?

Yes. Fix leading zeros lost in Excel on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.