Treat identifiers as text before the spreadsheet interprets them. Keep an untouched source file, import into a separate working copy, and compare a few deliberately awkward values before editing. This routine protects data accuracy; it is not a guarantee that an untrusted file is safe to open.

An intact row of small ring-shaped character tokens moves from a source-file tray to a gridded working sheet without losing its first pieces.
AI-generated editorial illustration of preserving identifier strings when moving data into a spreadsheet. AI-generated editorial illustration.

A client sends a product list. The code 00123 becomes 123, and a long reference number appears in scientific notation. The spreadsheet still looks tidy, so the problem may remain hidden until an upload or lookup fails.

Decide which columns are identifiers

Digits do not always represent quantities. Product codes, postal codes and reference IDs identify things. Their exact characters matter, including leading zeros. Prices and quantities usually need numeric types for calculation.

Make a small import plan before opening the file:

Column Intended type Example to preserve
Product code Text 00123
Reference ID Text 1234567890123456
Variant code Text 1E10
Quantity Number 12

These are invented sample values. Never use real customer identifiers when asking for help in a public forum.

Microsoft documents Excel’s automatic conversions, including removing leading zeros, interpreting some strings as dates, and limiting numeric precision to 15 digits. Formatting an already-altered value as text cannot recreate missing characters.

Three invented identifier examples—00123, 1234567890123456 and 1E10—belong to text columns so that their exact characters survive. The invented quantity 12 belongs to a numeric column for arithmetic.
Decide column types before import. These are sample values for illustration, not real customer data. Original explanatory graphic. Artwork credit: Jinian. Source 1.

Preserve the original CSV

Save the download separately and work from a copy. If you need to inspect a suspicious value, open the copy in a plain-text editor rather than immediately resaving it through a spreadsheet.

Look for the header, delimiter and a few complete rows. CSV files commonly use commas, but other separators exist. A name containing a comma may be enclosed in quotation marks; do not split every comma manually and assume the result is correct.

Microsoft’s text-import documentation explains that opening a CSV directly uses Excel’s default interpretation settings. Controlled import gives you more opportunity to choose the types.

The workflow keeps an untouched original CSV, a working workbook imported with controlled types, and a separately named new CSV export. A return arrow reminds the reader to compare the same awkward sample values with the source after export.
Keep each stage distinct so you can trace changes and reimport from an untouched source. A preservation routine is not a security guarantee for untrusted files. Original explanatory graphic. Artwork credit: Jinian. Source 1. Source 2. Source 3.

In Excel, set text types before loading

In a desktop Excel version with Power Query, start from Data → From Text/CSV. Select the original file and review the delimiter and character encoding. Choose Transform Data when you need to control column types.

Where the import dialog offers data-type detection, choose the option that does not detect types. Microsoft’s Text/CSV connector documentation says this leaves columns as text. Then assign numeric types only to columns that genuinely need arithmetic.

If a query already contains an automatic Changed Type step, inspect it before proceeding. Remove or revise the conversion that changes your identifier columns, and confirm the original strings are restored from the source. Adding a text-conversion step after zeros have disappeared will not repair them.

Microsoft explains how automatic Power Query type detection adds conversion steps. Check the preview, then load into a new worksheet and retain a workbook copy. Menu wording and available import features differ between Excel versions.

If using the legacy Text Import Wizard, select the identifier columns and choose Text in the column-format step before finishing.

In Google Sheets, import into a separate sheet

Use File → Import, choose your CSV and select a new spreadsheet or new sheet rather than replacing working data. Google’s official import guide describes the destination and separator choices.

Google’s linked import help describes the import destinations and separator choices, but does not document every conversion control. This guide has not verified the current dialog. Review the controls actually present before importing. If the dialog presents Convert text to numbers, dates, and formulas, clear that option for the preservation-first copy. Then check the imported identifiers immediately. If that control is unavailable or the sample changes, discard the test import and keep the untouched CSV. Do not continue with real identifiers on the assumption that a format change will repair them. If you have access to Excel with Power Query, the documented no-type-detection route above is an alternative to test; otherwise have the person maintaining your import process verify a string-preserving route first.

For an automated workflow, Google documents a precise alternative: the Sheets API’s RAW input option stores supplied values without parsing. Identifiers must be supplied as strings; a number that already lost zeros elsewhere cannot be repaired by RAW.

Keep quantities and prices separate from identifiers when converting the working copy. Also check the spreadsheet’s locale settings, which affect default date, number and currency formatting.

An invented source identifier 00123 becomes 123 after numeric parsing, then remains 123 when formatted as text. An arrow returns to the untouched source for a text-preserving import. Both correct characters and text storage are needed.
Once leading zeros are lost, changing the type to text does not restore them. Reimport from the original instead of guessing the missing characters. Original explanatory graphic. Artwork credit: Jinian. Source 1. Source 2.

Try a harmless five-row fixture first

Download the synthetic CSV fixture and keep its original file untouched. It contains no real identifiers. Import it into a disposable new sheet using the route you plan to use. A quoted CSV field can still be converted by spreadsheet software, so quotation marks are not the success criterion.

Expected identifier textExpected lengthWhat the row exposes
0001236Leading-zero loss
12345678901234567818Long-number precision loss
1E104Scientific-notation conversion
03-045Date-like conversion
001005Another leading-zero value to check after export

For the first data row, =EXACT(A2,"000123") should be true, =ISTEXT(A2) should be true and =LEN(A2) should be 6. Apply the corresponding literal and length from the table to each remaining row. Then export a copy and inspect its identifier characters in a plain-text viewer. Do not double-click the exported CSV and treat a second automatic spreadsheet conversion as proof of what the file contains.

The expected-length column is only an answer aid; it does not force the identifier column to remain text. These are input fixtures and expected checks, not a report that an Excel or Sheets version passed them.

Run a five-part check

Choose samples from the beginning, middle and end of the file, including the longest identifier and one beginning with zero. Check:

  1. The full character sequence matches the source.
  2. The identifier is stored as text.
  3. No code became a date or exponent.
  4. Row counts and column alignment are sensible.
  5. Non-English characters survived the import.

In Sheets, =ISTEXT(A2) checks whether a value is text, while =EXACT(A2,"000123") checks that illustrative value’s characters. Google documents ISTEXT and EXACT. Text type alone does not establish that the contents are correct.

Invented awkward samples include a zero-prefixed code, a 16-digit identifier and a code resembling exponent notation. Both exact-character equality with the source and text storage must pass. If either fails, stop and reimport; if both pass, continue checking row counts, alignment and non-English characters, then repeat after export.
Check characters and type separately. Sample values are invented; a failed preservation check means returning to the source, not adding guessed zeros. Original explanatory graphic. Artwork credit: Jinian. Source 1. Source 2. Source 3.

Check the export too

A custom display format can make a number look padded with zeros, but appearance is weaker evidence than a correctly stored identifier. If digits were lost, return to the original export. Do not guess how many zeros to add unless a documented fixed-width rule establishes the answer.

After editing, export a new CSV and inspect the same sample values in a text editor. If the receiving system offers a preview, check it before committing the upload. Keep the original, working workbook and final export clearly named so you can trace what changed.

Documentation rechecked October 6, 2026. Procedures are documentation-based; no live Excel or Google Sheets import was tested for this article.

Once the export is verified, use the client file-delivery checklist to check access and download timing.