Skip to content

Text to CSV Converter

Paste text or open a .txt file and get valid CSV back, escaped to RFC 4180. It reads the usual separators and also handles text whose columns are lined up with spaces — terminal output, report tables, anything copied out of a PDF — which a plain separator cannot do. It then tells you what it found: any row with the wrong number of columns, named by line, and every value it had to quote because it contained a comma. Nothing is uploaded.

Paste something above. The CSV appears below as a table so you can see the columns landed where you expected.

Everything runs in your browser. Your text is never uploaded, and there is no server step for the awkward inputs either — the column detection happens here, on your machine.

Runs in your browser. Nothing uploaded.

How to use it

  1. Paste your rows, or open a .txt file. The file is read on your machine. Nothing is sent anywhere.
  2. Check the separator. The tool guesses and tells you what it picked. If your columns are lined up with spaces rather than split by a character, choose Aligned columns.
  3. Read what it found. Any row with the wrong number of columns is named by line. That is the part worth reading — one ragged row is enough for most importers to reject the whole file.
  4. Copy or download. Output is escaped to RFC 4180.

When your columns are lined up with spaces

This is the case most converters get wrong, and it is extremely common — anything copied out of a terminal, a report, or a PDF table.

Text like this has no separator character at all:

NAME     AGE   CITY
John     25    New York
Sarah    31    Chicago
Priya    34    San Francisco

The columns are held apart by runs of spaces of varying width. Pick “space” as your delimiter, which is what other tools offer, and two things break at once: every extra space becomes an empty column, and New York splits into two fields. You get a grid that looks vaguely right and is wrong in every row.

What this tool does instead

It looks for gutters — character positions that are blank on every single line. In the example above, columns 8 and 9 are blank in all four rows, and so are 13 and 14. Those are real column boundaries. Everything between them is one value, spaces included, so San Francisco stays intact.

A gutter has to be at least two characters wide. A single shared space is far more likely to be coincidence — New York and Los Angeles both happen to have a space in the middle, and treating that as a boundary would shred them.

If your text is aligned but slightly off — a row indented by one character, which pasted output often is — gutter detection finds nothing and the tool falls back to splitting on any run of two or more spaces. Less precise, still far better than a single-space delimiter.

Supported separators

Separator Typically comes from
Tab Spreadsheet copy-paste, TSV exports, database clients
Comma An existing CSV you are re-shaping
Semicolon Excel in most of Europe, where the comma is a decimal separator
Pipe Log files, legacy exports, mainframe extracts
Aligned columns Terminal output, printed reports, PDF tables

How the guess works

Detection scores each candidate on consistency, not on how often it appears. A comma that shows up forty times in one line and never again is prose. A tab that produces exactly four fields on every single line is the separator.

When two candidates are equally consistent, the tab wins. A tab in the middle of a line is a deliberate structural character; commas followed by spaces are how people write sentences.

How CSV escaping actually works

CSV looks trivial and has one genuinely awkward problem: what happens when a value contains the separator?

Take a name field holding Smith, John. Written naively into a comma-separated file you get:

Smith, John,Boston

Three fields where you meant two. RFC 4180’s answer is to wrap the value in double quotes:

"Smith, John",Boston

Which raises the next question — what if the value contains a double quote? The answer is to double it:

"She said ""hello"" loudly",Boston

Not a backslash. Backslash escaping is a C convention that some readers tolerate, but it is not CSV, and a file that relies on it will fail against a strict parser.

This tool quotes a value when it contains the separator, a double quote, a line break, or leading or trailing whitespace that would otherwise be eaten. Everything else is left bare, which keeps the file readable. Quote every value is available if the system you are feeding demands it.

Common problems, and what they mean

What you see What it means What to do
One row has more columns than the rest A value contained the separator and was not quoted Go to the line named in the report and quote it, or switch separator
Everything came out as one column Wrong separator Try Aligned columns, or set it manually
Row count dropped after converting Blank lines were skipped — the tool counts them Nothing. It is reported so the number is explainable
Excel shows café instead of café Excel guessed the encoding wrong Turn on the UTF-8 BOM and re-download
Excel puts every row in one cell Your Excel expects semicolons, not commas Set the CSV separator to semicolon
An importer rejects the whole file Usually a single ragged row Fix the line the report names

The BOM question

“CSV UTF-8” means a normal UTF-8 file with three extra bytes at the front — the byte order mark. Excel on Windows uses it to know the encoding. Without it, Excel guesses, and it usually guesses a legacy codepage, which is why accented characters and emoji arrive mangled.

Turn the BOM on for Excel on Windows. Leave it off for everything else — Google Sheets, databases, Python, Numbers all read plain UTF-8 correctly, and some of them will treat the BOM as part of your first column name.

Why one bad row matters so much

Most converters emit whatever they parsed and say nothing. That is fine right up until you feed the result to something strict.

A database import, a WooCommerce product upload, a BI tool — most of them read the first row, decide the shape of the table, and then reject the entire file the moment a row disagrees. Not the row. The file. You get one line of error text referring to a row number in a file you did not create, and no indication of what was actually wrong.

So this tool names the line in your original text, counting blank lines, so the number matches what you see in your editor. If you are about to import a product CSV, our WooCommerce Product CSV Checker goes further and validates the columns themselves.

What it will not do

It converts and reports. It does not edit, sort, filter, calculate or chart — there are spreadsheets for that, and a converter that grows into a spreadsheet stops being fast at the one job you came for.

It also cannot know whether your data is correct. It can prove that every row has five columns; it cannot know that column three was supposed to be a date. If a field will not match after import even though it looks identical, the cause is usually an invisible character rather than the CSV — our Invisible Character Detector finds those, and the Text Cleaner strips them before you convert.

Frequently asked questions

How do I convert text to CSV?

Paste it in. The tool works out how your columns are separated, converts the whole thing, and shows the result as a table so you can see the columns landed where you expected. Then copy it or download a .csv. It handles tab, comma, semicolon and pipe separated text, and text whose columns are simply lined up with spaces.

How do I convert a TXT file to CSV?

Open the .txt file with the file button rather than pasting. It is read locally in your browser — there is no upload, so file size is limited by your machine rather than by us, up to the 5MB guard. Conversion is identical either way; a .txt and the same text pasted produce the same CSV.

My columns are lined up with spaces, not separated by commas. Will this work?

Yes, and this is the case most converters get wrong. Choose Aligned columns. The tool looks for the vertical gaps that run down every line and cuts there, which keeps multi-word values together — "New York" stays one value instead of becoming two. Picking a space as your separator instead would split it, and would also create an empty column for every extra space.

What happens to a value that contains a comma?

It gets wrapped in double quotes, which is what CSV requires, and the tool counts how many values needed it. So "Smith, John" survives as a single field. If a program later reads that file without honouring quotes it will still split the value — that is a fault in the reader, not the file, and it is why the count is shown rather than hidden.

Why does it say one of my rows has the wrong number of columns?

Because it does, and almost every importer rejects the entire file over it. A ragged row usually means a value contained the separator without being quoted, or a line wrapped somewhere it should not have. The line number given is the line in your original text, counting blank lines, so you can go straight to it.

What is CSV UTF-8, and do I need the BOM option?

Turn it on if you are opening the file in Excel on Windows and your text contains accents, non-Latin scripts or emoji. Without those three leading bytes Excel guesses the encoding and usually guesses wrong, turning café into café. Almost everything else — Google Sheets, databases, Python, Numbers — reads plain UTF-8 correctly and does not want the BOM.

Does the tool upload my text?

No. Everything runs in the page in your browser and no request is made at any point. Worth checking on any converter you use for this: several tools that describe themselves as private hand messy input to an AI service to work out the columns, which is an upload however it is labelled.

Which line endings does it use?

CRLF by default, because that is what RFC 4180 specifies and what Excel expects. Switch to LF if the file is destined for a Unix pipeline or a git repository. It changes nothing about the data.

Can it handle a value with a line break inside it?

On output, yes — the value is quoted, which is the correct CSV representation, and the tool warns you that it did. It is worth the warning because plenty of importers cannot read multi-line fields even though the file is valid.

Last updated: September 6, 2026