Convert TXT to CSV
Turn a text file, report or list into a CSV table.
- Nothing is uploaded
- Free · no account
- Tested on 400k-row files
Reference
TXT to CSV: how it works
The tool is above. Below: a short overview, optional step-by-step detail, honest browser limits, and answers to common questions.
Last updated 3 min read
About this tool
PrivateCSV converts a text file (.txt) to CSV for Excel or Google Sheets. It detects how the columns are separated: tabs, pipes, semicolons or other characters, runs of spaces, fixed-width columns in printed reports (using the dashed line under the header when there is one), or one value per line. Report titles and ruling lines are left out, values are trimmed, and you see the table before converting. The file is converted in your browser and never uploaded.
Read the step-by-step guideHow-to, example and use cases (~3 min)
How to convert a TXT file to CSV
- Drop the .txt file on the picker above, or paste the text.
- Check the preview: the detected layout is shown under the table. If the columns are wrong, choose the separator yourself in the options.
- Choose the CSV delimiter: comma, or semicolon for Excel in much of Europe.
- Click Convert to CSV and open the file in Excel or Google Sheets.
Example
A fixed-width report and the CSV it becomes.
SKU Product Qty
-------- -------------------------- ----
A-1001 Steel water bottle 750 ml 120
B-2002 Fountain penSKU,Product,Qty
A-1001,Steel water bottle 750 ml,120
B-2002,Fountain pen,When you need it
- Reports from old systems
- ERP, banking, mainframe and SQL tools print reports with aligned columns. Converting them to CSV turns each column into a spreadsheet column, even when some cells are empty.
- Tab or pipe exports saved as .txt
- Many programs export “Text (Tab delimited)” or pipe-separated files with a .txt extension. Excel opens them through an import wizard; as CSV they open with a double-click.
- A list to a column
- A list of emails, IDs or names, one per line, becomes a one-column CSV ready to import into a mailing tool, a CRM or a database.
How columns are detected
A character that appears the same number of times on most lines (tab, pipe, semicolon, comma, tilde or caret) is taken as the separator; quoted values are respected. Otherwise, a dashed line under the header (“----- --- -----”) gives the exact columns of a report, and without one, positions that are blank on every line are used. Text whose columns are separated by two or more spaces, or by any space, and plain lists with one value per line are recognized too.
Tables drawn with borders, such as MySQL or psql output (+----+------+ and | id | name |), lose their borders. Up to three title lines above a report table are skipped.
Encoding
UTF-8, UTF-16 and Windows-1252 (ANSI) text files are read, so accented letters from older Windows programs come out right. The CSV is written in UTF-8, with a byte order mark when “Excel-compatible” is ticked.
Browser and file limits (not a trial)
These are technical limits of running in your browser—device memory, encoding and what this tool does not do. They are not a free trial, account quota or paid plan. There is no subscription.
- Files up to 100 MB are converted.
- Fixed-width detection needs columns that line up. When a value overflows into the next column, choose “Two or more spaces” instead.
- Free-form text such as sentences is not a table: each line becomes one row.
Frequently asked questions
How do I convert a TXT file to CSV?
Choose the .txt file above, check that the preview shows the right columns, and click Convert to CSV. The columns are detected automatically; you can force the separator in the options. Nothing is uploaded.
How do I convert a text file to CSV in Excel?
In Excel, use Data > From Text/CSV, pick the delimiter or fixed width in the wizard, load the data, then File > Save As > CSV UTF-8. This converter does the same in one step, detects the columns for you and handles reports with title lines.
Can it convert a fixed-width text file to CSV?
Yes. Aligned columns are detected from the dashed line under the header or from the blank positions shared by every line. Empty cells stay empty instead of shifting the next value left.
How do I convert a tab-delimited text file to CSV?
Choose the file: tabs are detected automatically, and values containing commas are quoted in the CSV so they stay in one column.
How do I turn a list into a CSV file?
Paste the list or choose the text file, with one value per line. Each line becomes one row of a one-column CSV.
Related tools
Go further
Your files never leave your device
PrivateCSV runs this tool in your browser. No upload, no account, no trial and nothing to install.