← All guides

CSV encoding and leading zeros: what to check

A CSV can contain the right text and still look wrong when another program opens it. Keep a copy of the original and check both the preview and your spreadsheet import settings.

If characters look wrong, check the encoding

Try UTF-8 first. For a Korean-language export that looks garbled, try EUC-KR / CP949 and preview it again. Choose the encoding that matches the original file. Changing the setting cannot reconstruct text that was already saved incorrectly.

Is 001 an identifier or a number?

product_code,quantity
001,2
002,10

The CSV can contain 001 while a spreadsheet displays 1 after treating it as a number. Use your spreadsheet's data-import feature and set the identifier column to text. Compare important values against the tool's preview and the downloaded file.

Formula protection is a separate choice

The optional CSV formula-protection setting adds an apostrophe to cells starting with =, +, -, or @. That can also change values such as -10 into text. It does not guarantee that every spreadsheet will preserve leading zeros.

Check the result in this order

  1. Review non-ASCII characters, identifiers, negative numbers and formula-like cells in the preview.
  2. Enable only the cleanup options you need and save a new CSV. The output uses UTF-8 with a BOM.
  3. Import that output into your spreadsheet using UTF-8 and the appropriate column types, then review important values again.

Files from an untrusted source can contain values interpreted as spreadsheet formulas. Review the data and the formula-protection option before opening the result in a spreadsheet.