Convert Text File to CSV in Excel
Two reliable ways to turn a text file into CSV using Excel — importing with the Get Data wizard, or splitting pasted text with Text to Columns — plus how to save as CSV UTF-8 and avoid Excel mangling your data.
Convert text to CSV in Excel the right way
Excel can both import a text file into columns and export the result as CSV, but the details matter: pick the wrong delimiter and your data lands in one column; save the wrong way and accents break or leading zeros vanish. This guide covers the two dependable methods and the settings that keep your data intact.
If you would rather skip the wizard entirely, the TXT to CSV converter does the same job in your browser in one step — but the Excel route below is worth knowing when Excel is already open.
Method 1: Import the text file with Get Data
This is the most controlled way to convert a text file, because Excel shows a preview and lets you choose the delimiter before anything lands in the grid.
- Open a blank workbook and go to the Data tab.
- Click Get Data → From File → From Text/CSV (in older Excel, From Text).
- Select your
.txtfile. Excel opens a preview window. - Set Delimiter to Comma, Tab, Semicolon, Space or Custom so the preview splits into the correct columns.
- Choose File Origin as 65001: Unicode (UTF-8) if your text has accents or non-Latin characters.
- Click Load to place the table in the sheet.
Excel now has your data in clean columns, ready to save as CSV (Method 3).
Method 2: Paste text and use Text to Columns
When the text is already on your clipboard, this is the fastest route.
- Paste the text into column A of a blank sheet.
- Select the column, then choose Data → Text to Columns.
- Pick Delimited (for comma/tab/pipe/space) or Fixed width (for space-aligned columns) and click Next.
- Tick the delimiter(s) that separate your data; the preview updates live. For pipe or other characters, use Other.
- Optionally set each column’s data type. Choose Text for IDs and zip codes to protect leading zeros, then click Finish.
Your single column is now split into proper columns.
Method 3: Save the workbook as CSV
Once the data is in columns, export it:
- Go to File → Save As.
- Choose CSV UTF-8 (Comma delimited) (*.csv) — the UTF-8 variant keeps accents and CJK characters correct.
- Name the file and save. If Excel warns that features will be lost, click Yes — that simply means a CSV holds only the values.
If your locale uses a comma as the decimal separator, Excel may export with semicolons; either re-import with the matching delimiter or use the comma-delimited tool to normalize it.
Avoid common Excel formatting problems
Excel likes to “help” by reformatting data. The usual casualties are leading zeros (007 becomes 7), long IDs (shown as scientific notation), and broken accents. The fixes — importing columns as Text, using a UTF-8 BOM, and the ="..." trick — are covered in detail in fix CSV Excel formatting issues. The online converter has UTF-8 BOM and Excel-safe numbers toggles that apply these automatically.
Pitfalls to watch for in Excel
Two issues catch people out. First, double-clicking a CSV lets Excel auto-detect types, which is where leading zeros and long IDs get mangled; importing through Data → From Text/CSV (or Text to Columns with columns set to Text) avoids it. Second, the delimiter Excel exports with follows your Windows regional settings — in comma-decimal locales it may write semicolons, so a file that looks wrong elsewhere is often just locale-delimited. If you share CSVs across regions, state the delimiter you used, or normalize with the converter so everyone gets the same comma format. To verify, reopen the saved CSV in a plain text editor (not Excel) and confirm the separators and quoting look right before sending it on.
Convert Text File to CSV in Excel — FAQ
How do I stop Excel changing numbers to scientific notation?
Import the column as Text (Text to Columns → column data format Text), or use the converter’s Excel-safe numbers option, which wraps long numbers so Excel keeps them as text.
How do I keep leading zeros?
Set the column type to Text during import, or enable Excel-safe numbers in the online tool.
Which CSV format should I save as?
CSV UTF-8 (Comma delimited). The UTF-8 variant preserves international characters.
Why is all my data in one column?
The wrong delimiter was chosen. Re-run Text to Columns or the import and pick the separator your file actually uses.