Excel CSV Leading Zeros Missing? Import IDs as Text Before Loading

If Excel removes leading zeros from a CSV, import the original file through Data → From Text/CSV, keep identifier columns as Text before any numeric conversion, and check the loaded values against the source. Changing a damaged cell to Text afterward cannot recover digits that were already lost.

This guide separates three problems that can look like a bad CSV: changed identifiers, unreadable characters, and columns that do not split correctly. The walkthrough targets Windows desktop Excel with the Power Query Text/CSV importer, such as Microsoft 365 or Excel 2024. Menu names and available controls vary by build; it is not a verified Mac or Excel-for-the-web walkthrough.

First, find out whether the original CSV is still intact

Make a copy before importing. Open that copy in a plain-text editor, not by double-clicking it into Excel. For a real work file, use only an editor and storage location approved by your organization; do not upload customer records to an unknown converter.

What you see What to check first
00073 becomes 73 Identifier was interpreted as a number
A long reference loses its final digits Numeric conversion and precision, not just column width
Café becomes unreadable Character encoding
A whole record sits in column A Actual field delimiter

If the text file already contains the wrong digits, stop and obtain a fresh export. Do not guess the original ID by adding zeros. This is especially unsafe when valid identifiers have different lengths.

Microsoft documents Excel’s leading-zero conversion and 15-digit numeric precision limit. An identifier is a label, even if it contains only digits; it usually belongs in a text column, not a calculation.

Try a three-record practice file

Create customer-import-demo.csv in a plain-text editor and save it as UTF-8. These are invented records and reference numbers, not real customers, shipment data, or payment details. Keep the quotation marks around the customer containing a comma.

CustomerID,PostalCode,ShipmentRef,Customer,Amount
00073,02108,1234567890123456,"Café North, Inc.",120.50
00120,00501,1234567890123457,Blue Office,80.00
00121,SW1A 1AA,1234567890123458,South Desk,49.50

The mixed US-style ZIP codes and UK-style postcode are deliberate. Postal codes are not amounts. The expected result has three records, five columns, and an Amount total of 250.00. Those are checks derived from the fictional input, not a screenshot or a claim that Excel was run for this article.

Import the CSV without converting the identifiers

1. Choose the file and inspect the preview

In a blank workbook, choose Data → From Text/CSV. Some ribbons put it under Get Data → From File. Select the practice CSV, then inspect the preview rather than loading immediately. Microsoft describes the import route in its text and CSV import guide.

For this sample, set the delimiter to Comma and the file origin to 65001: Unicode (UTF-8) when those controls are available. You should see five fields and the complete customer name in one field. Use the file’s actual encoding and delimiter for other exports; UTF-8 is not a universal repair setting.

Where available, set data type detection to Do not detect data types, then choose Transform Data. The Text/CSV connector reference documents its encoding, delimiter, and detection controls. Turning detection off starts the columns as text; you can convert actual amounts deliberately afterward.

2. Check the transformation steps before setting types

In Power Query, inspect Applied Steps. If an automatic Changed Type step converted IDs to numbers, remove that step in this new practice query and inspect the earlier result. Do not merely add a Text conversion after the damaging conversion.

Microsoft explains that automatic detection can add a Changed Type step, and that selecting an applied step displays its result. Comparing the earlier and later ID values is our diagnostic use of those features. If the earliest available source values are already wrong, return to the untouched export.

Confirm that the first line is used as the five column names, not as an extra record. If you still have Column1 through Column5 with the header text in the first data row, choose Use First Row as Headers from the table menu at the upper-left of the preview, once. Microsoft documents this header-promotion operation. Recheck Applied Steps for any newly added automatic type conversion before proceeding.

Set CustomerID, PostalCode, ShipmentRef, and Customer explicitly to Text. Set Amount to Decimal Number. If decimal conversion fails because your locale expects a comma, use Change Type → Using Locale with English (United States) for this sample’s dot-decimal amounts. That sample-specific setting is not a recommendation to change your computer’s regional settings.

3. Load and check the values, not just their appearance

Choose Close & Load. Before using the result, compare these checks with the original text file:

Check Expected value
Records / columns 3 / 5
CustomerID values 00073, 00120, 00121
PostalCode values 02108, 00501, SW1A 1AA
ShipmentRef values Exact 16-character strings ending 456, 457, 458
First customer Café North, Inc. in one cell
Amount count / total 3 numeric values / 250.00

For the sample loaded at A1:E4, =COUNT(E2:E4) should be 3 and =SUM(E2:E4) should be 250. Check the full reference strings in the formula bar too; a wide column alone does not prove that the stored value is correct. Treat any mismatch as review required, even if the total is right.

Common fixes that do not solve the same problem

“Can I just apply a custom number format?”

A display mask can be appropriate for a deliberately fixed-width number, but it is not proof that the imported ID was preserved. Keep the source string for joins, exports, and mixed-format postal codes. Do not use a guessed width to reconstruct unknown data.

“Will a UTF-8 BOM preserve leading zeros?”

No. Microsoft says a UTF-8 CSV with a BOM can open with the correct UTF-8 interpretation. That addresses character decoding, not identifier types. You still need the text-column checks.

“Should I change Excel’s automatic conversion settings?”

Microsoft 365 and Excel 2024 have automatic data conversion controls. Availability is version-dependent. This guide uses explicit import settings so you can inspect one file without assuming another person’s Excel has the same defaults.

Related guide

Once your inputs are checked and saved as workbooks with the same column layout, see how to merge Excel files with Power Automate Desktop. Keep the original CSV exports separate from the combined review file.

Keep a reviewable result

Save the checked working result as a separate .xlsx workbook; retain the untouched CSV. If another system needs a CSV, inspect that export in a plain-text editor and validate the destination’s required schema. Reopening it by double-clicking is not a reliable round-trip test of text identifiers.

Validation note — October 22, 2026: Official Microsoft pages linked above were accessed, and the fictional CSV’s field count, exact strings, numeric count, and arithmetic were checked locally. A native Excel import and an organization-specific workflow test were not performed. This documentation-based guide was prepared with AI assistance; the expected results are acceptance criteria, not fabricated product-test results.

1 thought on “Excel CSV Leading Zeros Missing? Import IDs as Text Before Loading”

Comments are closed.