Treat an ID as text before Excel has a chance to change it
If 00123 is a postal code, employee ID, or account label, it is not a number you intend to calculate. Import that column as text before loading the CSV. Once Excel has removed the zeros or rounded a long numeric identifier, changing the cell format only changes how later entries are displayed; it does not reconstruct the original characters.
Microsoft's current support article applies to Excel for Microsoft 365, Microsoft 365 for Mac, Excel 2024 and 2024 for Mac, plus Excel 2021, 2019, and 2016. It says Excel can remove leading zeros and convert large numeric-looking strings for calculations. Its newer Automatic Data Conversions setting is limited to Microsoft 365 and Excel 2024, including their Mac editions, so do not assume an older desktop version has that option.
For example, a membership export may contain 000781, 004219, and a 16-digit card reference. A worksheet can display those values attractively, but a matching system needs the exact strings. Preserve a source copy of the CSV first, then use the import path rather than double-clicking the file and hoping Excel guesses correctly.
Use Data > From Text/CSV and set the identifier column to Text
In supported desktop Excel versions, open a blank workbook and choose Data > From Text/CSV. Select the CSV, inspect the preview, then choose Transform Data instead of loading immediately. In Power Query, select each identifier column and set Home > Transform > Data Type > Text before loading it into the worksheet. Microsoft documents this route for importing text data and explains that the preview can be transformed before it reaches Excel.
The menu can differ by version. Microsoft's leading-zero guidance says that if the Get Data button is absent, try New Query > From File > From Text; older interfaces may show a Text Import Wizard. The current CSV import article lists Microsoft 365, Excel 2024, 2021, 2019, and 2016, so check your installed version when labels do not match your screen. Excel for the web or a managed company installation can expose a different interface; use its documented import option or ask the administrator rather than forcing an unreviewed paste.
If you are typing a small set of codes manually, format the destination column as Text before entry, or type an apostrophe before the value. A custom format such as 00000 can display a five-digit postal code, but Microsoft warns that formatting cannot restore zeros removed earlier. Display formatting is useful for a fixed-width number; storing an identifier as Text is safer when every character matters.
Do not use numeric cells for identifiers longer than 15 digits
Excel has a maximum precision of 15 significant digits for numbers. Microsoft says digits after the fifteenth in a 16-or-more-digit number are rounded down to zero. A credit-card-sized string, tracking reference, or long account identifier therefore belongs in a Text column from the start. This is a version-independent data limit described in the Microsoft support guidance, not a cosmetic display issue.
Avoid putting a real payment-card number into a browser tool or a shared worksheet. Use a non-sensitive test value, an approved system, or a masked sample while checking an import process. If the source already opened incorrectly in Excel, go back to the untouched CSV or request a fresh export. Guessing the missing digits is not a repair method.
Before opening a CSV in Excel, the CSV Preview tool (csv-preview) can help you inspect headers, rows, sheet choices in a spreadsheet file, and obvious column shifts. It reads a file selected in the browser and displays data for review; it is not an Excel editor, does not change the workbook, and cannot restore an identifier that Excel already altered. For a large file, it displays up to 500 filtered rows, so use it as a sample check rather than proof that every row is valid.
Check the import result before you match, sort, or export
After loading, compare a handful of values from the first, middle, and last portions of the source against the worksheet. Include an entry with a leading zero and one long identifier. Confirm that the formula bar shows the intended characters, that the cell type is Text, and that a lookup uses the same data type on both sides. A visible 00123 can still fail a match if one table stores text and another stores a number.
Then test a small, non-sensitive match before processing the full list. If the CSV uses a semicolon, tab, or another delimiter, choose it in the import preview. Microsoft notes that delimiter settings and CSV export behavior vary, and that saving to CSV can discard features and saves only the current worksheet. Keep the working workbook as .xlsx when you need formulas, formats, or multiple sheets; produce CSV only as a deliberate exchange copy.
For a second sanity check, convert a harmless sample to a clearly labeled text representation with the CSV to JSON converter. That can reveal headers or quoted commas that were misunderstood, but it is not a replacement for Excel's import settings or for the receiving system's validation. Check the actual import result again after the target system accepts it.
Common questions
Can I add leading zeros after Excel has already removed them?
You can use a custom display format for fixed-width values, but Microsoft says that formatting does not restore zeros removed before the format was applied. Return to the original source and import the column as Text when the exact identifier matters.
Which Excel versions have Automatic Data Conversions?
Microsoft lists Excel for Microsoft 365, Microsoft 365 for Mac, Excel 2024, and Excel 2024 for Mac. Excel 2021, 2019, and 2016 are covered by the broader leading-zero article but are not listed for that newer setting.
Why did my 16-digit ID change even though it looked like a number?
Excel numbers have 15 significant digits of precision. Microsoft states that digits after the fifteenth in a number with 16 or more digits are rounded to zero. Import the column as Text from the original file instead.
Is opening a CSV directly the same as importing it through Power Query?
No. Direct opening can let Excel infer types immediately. The Data > From Text/CSV route gives a preview and a Transform Data option, where you can set the column type before loading.
Can ToolboxHub fix an XLSX file that Excel changed?
No. CSV Preview is a browser-side preview and review tool, not an XLSX editor or recovery service. It does not change your file, preserve Excel formatting, or reconstruct values that were converted before you loaded it.