Prevent Excel from Converting CSV Text Columns
Question details
Import and save CSV values without losing leading zeros or other text-like data needed by another system.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A CSV file contains columns that must be treated as text when uploaded to another system.
- Observed behavior
- Opening the CSV directly in Excel causes automatic type conversion, which can remove leading zeros and trigger import errors.
Identify the columns that must be read as text, such as account numbers or IDs. If Excel has already removed leading zeros and the CSV was saved, use the original CSV if available; changing the column to Text afterward will not restore the lost zeros.
Import the CSV as text with Power Query
Use Excel's CSV import tools to control column types before loading the data into a worksheet.
CSV files store values, not Excel formatting or column types. The receiving system must also be configured to interpret the relevant fields as text.
In Excel, open a blank workbook and select Data > From Text/CSV. Choose the original CSV file.
In the import preview, set Data Type Detection to Do not detect data types if that option is available, then select Transform Data.
In Power Query, inspect Applied Steps and remove any automatic Changed Type step that converted the values. Select each affected column, then choose Data Type > Text.
Select Home > Close & Load, then check the imported columns in the worksheet to confirm that leading zeros and other text values are intact.
Use File > Save As and choose CSV. In the receiving system's import settings, assign the affected fields a text or string type before uploading.

Use Excel's legacy Text Import Wizard
Use the legacy wizard when it is available and you want to set each column's format during import.
Import CSV Columns as Text in WPS Spreadsheets
Use the text import options in WPS Spreadsheets to preserve values such as leading-zero IDs, then save the data as CSV for upload.
- 1. Start the import: Open WPS Spreadsheets and select Data > Import Data, or the text import option available in your version. Choose the original CSV file.
- 2. Set the delimiter: In the import wizard, select the delimiter used by the file, usually Comma, and review the column preview.
- 3. Choose text columns: Select each column that must retain leading zeros and set its column data format to Text. Finish the import and check the values in the worksheet.
- 4. Save the CSV: Select File > Save As and choose CSV. Configure the receiving system to import the affected fields as text.

Frequently Asked Questions
Why does Excel remove leading zeros when I open a CSV?
Excel may interpret fields containing only digits as numbers when you open a CSV directly. Use Data > From Text/CSV and set those columns to Text before loading.
Can a CSV file store Excel's Text formatting?
No. A CSV stores values, not Excel formatting or column types. Set the relevant fields to text in the receiving system's import settings.
Will changing a column to Text restore missing leading zeros?
No. If the values were already converted, changing the format does not recreate lost zeros. Import the original CSV again and set the column to Text before loading it.
How can I check the saved CSV without Excel converting it again?
Open the saved CSV in a text editor and inspect the affected fields. Avoid double-clicking the file if that opens it directly in Excel.




