Why does Excel change CSV data?
One of the most common CSV problems occurs when a CSV file is opened directly in Excel. Excel does not simply display every value exactly as it appears in the file. Instead, it attempts to determine what each value represents.
This automatic type detection can cause Excel to interpret values as numbers, dates, percentages, or other data types. The result can be a CSV that looks different from the original data.
Important: A CSV file is plain text. Excel is interpreting that text when it opens the file. If a value is an identifier rather than a number, it is usually safer to explicitly treat that column as Text.
What is Excel auto formatting?
Excel auto formatting refers to the way Excel automatically interprets and formats values when you enter data, paste data, or open a CSV file.
This is convenient for ordinary spreadsheet work. For example, Excel can recognize a date and display it as a date. However, automatic formatting can be problematic when the exact text needs to be preserved.
Numbers
Excel can interpret numeric-looking identifiers as numbers and remove formatting such as leading zeros.
Dates
Excel can recognize date-like values and automatically convert them into dates.
Large values
Large numeric values may be displayed using scientific notation or may be affected by Excel's numeric precision limits.
CSV imports
When a CSV is opened, Excel has to infer the data type of each field because CSV files do not contain spreadsheet formatting.
Stop Excel removing leading zeros
Leading zeros are commonly used in customer IDs, product SKUs, ZIP codes, account numbers, order numbers, barcodes, and reference codes.
If your CSV contains 001234, Excel may interpret it as the number 1234 and display the value without the leading zeros.
Example
CSV value
001234 000567 000089
Excel may display
1234 567 89
The safest solution is to make sure Excel treats the entire column as Text before the values are interpreted.
Stop Excel changing dates
Dates are another common source of CSV formatting problems. Values such as 01/02/2026 can be interpreted differently depending on regional settings.
Prefer an unambiguous date format
2026-08-07 2026-12-31
YYYY-MM-DD is much easier for applications and databases to interpret consistently than ambiguous formats such as 07/08/2026.
If the date must remain exactly as supplied rather than being interpreted as an Excel date, import the column as Text.
Stop Excel converting numbers to scientific notation
Large numeric-looking values can be displayed by Excel using scientific notation. For example, a value such as 123456789012 may appear as 1.23457E+11.
Original
123456789012Excel display
1.23457E+11If the value is an identifier, barcode, account number, or other code where every digit matters, do not treat it as a mathematical number. Import it as Text instead.
Do not just change the visual formatting. For very long identifiers, converting the cell to a number can cause precision issues. Preserving the original value as text from the beginning is safer.
Method 1: Import the CSV as Text
If you need to open a CSV in Excel without allowing Excel to automatically change important columns, do not simply double-click the CSV file. Instead, use Excel's import workflow.
Import a CSV and set columns to Text
- 1Open Excel and create a new blank workbook.
- 2Go to Data → From Text/CSV.
- 3Select the CSV file you want to import.
- 4Check the delimiter and preview the columns.
- 5Select Transform Data if you need to control the column data types.
- 6Select the column containing IDs, SKUs, ZIP codes, barcodes, or other values that must remain unchanged.
- 7Change the column data type to Text.
- 8Select Close & Load to load the data into Excel.
This is one of the best approaches when you regularly work with CSV files containing identifiers or other values that Excel might automatically reformat.
Method 2: Format the Excel column as Text
If you are manually entering or pasting CSV values into an Excel worksheet, format the destination column as Text before entering the data.
Set the column to Text before entering values
- 1Select the entire column where the values will be entered.
- 2Right-click the selected cells and choose Format Cells.
- 3Select the Number tab.
- 4Select Text.
- 5Click OK.
- 6Enter or paste your identifiers into the column.
001234 000567 000089
Set Text formatting first. If Excel has already changed 001234 to 1234, formatting the cell as Text afterwards cannot determine how many zeros were originally present.
Method 3: Wrap CSV values in quotes
If you generate CSV files programmatically, you can explicitly quote fields that need to remain intact.
customer_id,sku "001234","00045" "000567","00078" "000089","00102"
Quoting is valid CSV syntax and is particularly useful when generating CSV files. However, quoting alone should not be treated as a guarantee that Excel will never perform its own type detection.
Best Excel workflow: when the recipient is using Excel, import the CSV through Data → From Text/CSV and explicitly set important columns to Text.
Method 4: Use the ="" trick
Another Excel-specific technique is to use a formula that returns the desired value as text.
="001234" ="000567" ="000089"
Excel evaluates these formulas and displays the resulting values while preserving the leading zeros.
When should you use this?
The ="" technique can be useful when preparing data directly inside Excel. It is less suitable as a general CSV interchange strategy because formulas can become part of the exported data depending on how the workbook is saved.
Which method should you use?
Opening an existing CSV? Use Data → From Text/CSV and set important columns to Text.
Entering data manually? Format the Excel column as Text before entering the values.
Generating CSV files in software? Keep identifiers as strings and generate valid CSV fields. Quoting fields can be useful where appropriate.
Preparing data directly in Excel? The ="" technique can be useful for forcing a value to remain text.
Excel CSV formatting best practices
The easiest way to prevent Excel CSV formatting problems is to identify which columns contain values that must remain exactly as supplied.
Quick reference: common Excel CSV problems
Prevent Excel formatting problems
Import Builder lets you create guided CSV workflows and collect clean, structured data without relying on users to manually fix spreadsheet formatting.
Start building free