Windows guide

Convert Text to CSV in Windows

Convert text to CSV on Windows using built-in tools: save a comma file from Notepad, import and split text in Excel, or automate with PowerShell. Includes tips to keep zeros and encoding correct.

Step by stepCopy-paste codeFree converter included
Prefer not to code? Use the text to CSV converter — it runs in your browser, free, with nothing uploaded.

Open the converter

Advertisement
Overview

Convert text to CSV on Windows

Windows gives you several routes from text to CSV depending on the data and how often you do it: Notepad for already-comma-separated text, Excel for a guided split, and PowerShell for automation. Each is covered below.

For a quick, no-install conversion, the browser converter runs in Edge or any Windows browser, free and private.

Method 1: Notepad (save as .csv)

If your text is already comma-separated (one record per line), Notepad can save it as CSV:

  1. Open the text in Notepad.
  2. Choose File → Save As.
  3. Set Save as type to All Files, name it data.csv, and set Encoding to UTF-8.
  4. Click Save.

Important: renaming to .csv does not change the delimiter. If your text uses tabs, spaces or pipes, you must convert it first — use Excel (below) or the online tool, which re-delimits the data for you.

Method 2: Import and split in Excel

Excel is the most reliable Windows method because it splits the columns and exports a real CSV:

  1. Open Excel and go to Data → From Text/CSV, then select your file.
  2. Choose the delimiter so the preview splits correctly, set the file origin to UTF-8, and click Load.
  3. Set ID and zip-code columns to Text if you need to keep leading zeros.
  4. Save with File → Save As → CSV UTF-8 (Comma delimited).

The full walkthrough, including Text to Columns, is in convert text file to CSV in Excel.

Method 3: Automate with PowerShell

For repeatable jobs, PowerShell converts in one pipeline. To re-delimit a tab file to CSV:

PowerShell — tab text to CSV
Import-Csv "input.txt" -Delimiter "`t" |
    Export-Csv "output.csv" -NoTypeInformation -Encoding UTF8

See the full PowerShell guide for parsing unstructured text and batch-converting folders.

Good to know

Windows tips and common mistakes

The biggest Windows misconception is that renaming a .txt to .csv converts it. It does not — it only changes the extension. If the text is separated by tabs, spaces or pipes, the data must actually be re-delimited first, which is what the Excel import or the online tool does. Renaming only works when the content is already comma-separated.

When importing in Excel, set identifier and zip-code columns to Text in the import step to preserve leading zeros, and choose UTF-8 as the file origin so accented characters are read correctly. Saving as CSV UTF-8 (Comma delimited) rather than plain CSV keeps that encoding in the output. For repeatable work, PowerShell’s Import-Csv/Export-Csv is the most reliable automation, and the batch converter handles many files at once without any scripting. Verify a saved CSV by reopening it in Notepad to confirm the separators and encoding before sharing it.

For occasional conversions the order of preference on Windows is simple: if the text is already comma-separated, Notepad is enough; if it needs splitting, import with Excel; and if you do it repeatedly, script it in PowerShell. Keeping that in mind avoids the trap of renaming files that are not actually comma-delimited, which is the single most common Windows mistake when producing CSV.

In short, match the method to the data: rename only true comma files, import anything that needs splitting through Excel, and script the repetitive jobs with PowerShell. Set the column types and encoding correctly during import and the CSV you produce opens cleanly everywhere, first time.

FAQ

Convert Text to CSV in Windows — FAQ

Can I just rename a .txt to .csv on Windows?

Only if the text is already comma-separated. Otherwise convert it first in Excel or the online tool — renaming does not change the delimiter.

What is the most reliable Windows method?

Importing with Excel’s From Text/CSV, which splits columns and saves a proper CSV.

How do I keep leading zeros?

Set the column type to Text during the Excel import, or use the tool’s Excel-safe numbers option.

How do I automate it?

Use PowerShell’s Import-Csv/Export-Csv, or the batch converter for many files.