Why does Excel change CSV data?
One of the most common CSV problems is Excel automatically changing values when you open a CSV file. Excel tries to determine what each value represents and automatically assigns a data type.
A value such as 001234 may be interpreted as a number. A value such as 01/02/2026 may be interpreted as a date. A long number may be displayed using scientific notation.
This is known as Excel auto formatting or Excel's automatic type detection. The CSV itself may contain the original text correctly — the problem occurs when Excel interprets that text.
Leading zeros disappear
001234 can become 1234 when Excel interprets the value as a number.
Dates are automatically converted
Values such as 03/04/2026 can be interpreted differently depending on regional settings.
Large numbers become scientific notation
Long numeric values may be displayed as values such as 1.23457E+11.
Data can be changed when the file is saved
If Excel has converted your values and you save the CSV again, the changed values may be written back into the file.
What is Excel auto formatting?
Excel auto formatting happens when Excel automatically interprets the contents of a cell and changes how the value is represented.
This is useful for normal spreadsheet work. If you type 1000, Excel can recognize it as a number. If you type a date, Excel can recognize it as a date. However, this behavior can be undesirable when working with CSV files containing identifiers and other structured data.
Excel may automatically interpret:
001234 → number → 1234000045 → number → 4501/02/2026 → date123456789012 → scientific notation00001 → number → 1Important: CSV files do not contain the same spreadsheet formatting and data-type information as an Excel workbook. When Excel opens a CSV, it has to interpret the text and decide how to represent each value.
Stop Excel removing leading zeros
Leading zeros are commonly used in customer IDs, product SKUs, ZIP codes, account numbers, barcodes, and reference numbers. In a shipping label upload, a ZIP code without its zero is no longer a valid address.
customer_id 001234 000567 000089
Excel may interpret these values as numbers and display:
customer_id 1234 567 89
Treat identifiers as text. If a value is an ID rather than a quantity, there is usually no reason for Excel to perform mathematical operations on it.
Stop Excel changing CSV dates
Dates are another major source of CSV formatting problems. Excel attempts to recognize date-like values automatically, which can cause ambiguous dates to be interpreted according to the computer's regional settings.
03/04/2026
Depending on the regional convention, this could be interpreted as March 4 or April 3.
Prefer an unambiguous format
2026-03-04 2026-04-03
For application imports, YYYY-MM-DD is generally much easier to interpret consistently than ambiguous day/month formats.
Stop Excel converting numbers to scientific notation
Excel may display long numeric values using scientific notation. For example:
123456789012
1.23457E+11
Scientific notation does not always mean that the underlying value has immediately been destroyed. However, long identifiers should not generally be treated as numbers in the first place.
If every digit is significant — such as with a barcode, account number, transaction reference, or customer ID — store the value as text.
Method 1: Import the CSV as Text
One of the safest ways to prevent Excel auto formatting is to avoid opening the CSV by double-clicking it. Instead, import the CSV through Excel's data import workflow and specify the correct column type.
Import a CSV without letting Excel guess
- 1Open Excel and create a new blank workbook.
- 2Select the Data tab in the Excel ribbon.
- 3Choose From Text/CSV.
- 4Select the CSV file you want to import.
- 5Review the preview and confirm the delimiter is correct.
- 6Select Transform Data if you need to control the column data types.
- 7Select columns containing IDs, SKUs, barcodes, ZIP codes, or other values that must remain unchanged.
- 8Change the column data type to Text.
- 9Select Close & Load to load the data into Excel.
Why this works: you are telling Excel how the column should be interpreted before it converts the values.
Method 2: Format cells as Text
If you are entering or pasting values into Excel manually, format the destination cells as Text before entering the values.
Set an Excel column to Text
- 1Select the column or cells where you will enter the values.
- 2Right-click the selection and choose Format Cells.
- 3Select the Number tab.
- 4Choose Text.
- 5Click OK.
- 6Now enter or paste your identifiers.
001234 000567 000089
Set Text before entering the data. If Excel has already converted 001234 to 1234, changing the cell format afterwards does not automatically know that two zeros were originally present.
Method 3: Wrap CSV values in quotes
When generating CSV files, values can be represented as quoted CSV fields.
customer_id,sku "001234","00045" "000567","00078" "000089","00102"
Quoting is part of standard CSV syntax and is particularly useful when generating CSV data programmatically. It also helps distinguish fields that contain characters requiring CSV escaping.
If you need to protect an identifier
Generate the CSV field with quotes around the value rather than relying on Excel to decide what the value means.
customer_id,reference "000123","REF-00045" "000456","REF-00078"
However, quoting alone should not be treated as a universal instruction to Excel to preserve every value exactly as text. If you control the Excel import process, explicitly selecting Text for the affected column is more reliable.
Method 4: Use the ="" trick
Another Excel-specific technique is to use a formula that returns the identifier as text.
="001234" ="000567" ="000089"
Excel evaluates the formula and displays:
001234 000567 000089
This is an Excel workaround. It is useful when working directly inside Excel, but it is not generally the preferred representation for data interchange. For CSV imports, storing identifiers as text and controlling the import type is easier to maintain.
How should you stop Excel auto formatting?
Opening an existing CSV? Use Data → From Text/CSV and set important identifier columns to Text.
Entering values manually? Format the destination cells as Text before entering the values.
Generating CSV files? Keep IDs, SKUs, barcodes, and other identifiers as strings and generate valid CSV fields. Quoting values can be useful where appropriate.
Working directly in Excel? The ="" method can be useful for forcing a value to remain text.
Excel CSV formatting best practices
Prevent Excel formatting problems
Build CSV workflows that validate, transform, and protect your data before it reaches your application.
Start building free