Convert a Text File to CSV
Load a .txt file, tell it what separates the values and whether the first line is a header, and download a clean CSV with correct quoting. The file is read and written in your browser and never uploaded.
How do I convert a text file to CSV format?
Drag a .txt file here
or click to browse — or paste the contents into the box below
Turning a text file into a CSV that other software will actually accept
A text file that already has values separated by something is most of the way to being a CSV. What stops it being one is usually a handful of small things: the separator is a tab rather than a comma, the first few lines are a report header rather than data, and the values are unquoted, so anything containing a comma will break the moment something reads it back.
This page fixes those. Load the file, say what separates the fields, say how many lines to skip and whether the first remaining line names the columns, and the output is written with proper quoting throughout.
Quoting is the part that matters
The CSV format has one rule that everything downstream depends on: a value containing a comma, a double quote or a line break must be wrapped in double quotes, and any quote inside it must be doubled. A converter that ignores this produces a file that looks correct in a text editor and reimports with every column after the offending value shifted by one. Every field here goes through that rule, so quoted delimiters remain inside their fields. Check your receiving application’s delimiter and column-type import settings.
Header rows, and lines that are not data
Skip counts physical lines, including blank lines, before parsing starts. Do not skip into a quoted record. The header option uses the first remaining logical record; without it, generated column names precede all input records. Malformed quotes and unequal field counts pause export until corrected. Delimited mode retains whitespace; whitespace mode trims line edges and splits runs of spaces or tabs. CSV formula-like text receives a protective apostrophe. CSV has no cell types: import identifier columns as Text in your spreadsheet to retain leading zeros.
Exported reports frequently begin with a title, a run date and a blank line before the actual table starts. Those lines are not records, and leaving them in gives you a CSV whose first row is a report title and whose column count is wrong. Set the number of leading lines to skip and they are dropped before anything else happens. If the file has no header at all, untick the header option and columns are named column_1 onwards, so the output is still valid rather than losing its first record.
Which separator to choose
Tab is the default here because a text file exported from almost anything — a database client, a report writer, a spreadsheet's "save as text" — is tab-separated far more often than comma-separated. Comma, semicolon and pipe are the other common ones, semicolon being standard in regions where the comma is a decimal separator. Any whitespace handles a report whose columns are aligned with padding rather than separated by a character.
Where this differs from splitting text
This page is file-in, file-out: a .txt on disk becomes a .csv on disk, with a filename derived from the original. Split text into columns is the paste-and-transform version — text in your clipboard, a grid on screen, CSV or XLSX out. If you want a formatted spreadsheet rather than a plain CSV, text to Excel produces a real workbook, and CSV to PDF goes the other way when the result needs to be read rather than processed.
Next steps
Related tools
- paste and transform instead — when the text is in your clipboard rather than in a file.
- produce a real workbook — when you want formatting rather than plain values.
What to do with the result
- render the result as a table — for a version people read rather than process.
Browse all text and data tools, or see every QuickMerge tool.
A checked example
Synthetic examples checked in Chromium on Linux, September 9, 2026. The HEIC input is a licensed sample.
Using Comma and headers, this multiline input produces one data row: Name is Example; Notes contains both lines, including the comma. Reopened CSV output. The splitter retains both input records because it has no separate header option.
The value-type input and saved workbook show 00127 as text, 12.50 as numeric 12.5, a 20-digit identifier and 03/04/2026 as text, and a blank third cell with later values still in columns D and E. CSV cannot store these types; choose Text when importing identifiers.