Text to CSV
Paste structured text and choose the delimiter that separates its fields: tabs, commas, semicolons, vertical bars, spaces or a custom separator. For a report whose columns occupy fixed positions, choose fixed width and enter their widths instead. The output is comma-separated CSV with quotes around values that need them. Uneven rows are kept and reported, and you can choose trimming, blank-line handling and optional padding before copying or downloading the result.
Paste your text into the first box and the CSV appears in the second. It is converted in this tab and nothing is uploaded.
How the text is read
The fields come from a setting, never from a guess: a delimiter you pick, or column widths you type. Nothing is sorted, deduplicated or reordered on the way through.
How the CSV is written
The file that comes out is comma separated and quoted by RFC 4180: a field holding a comma, a double quote, a carriage return or a line feed is wrapped in double quotes, and its own quotes are doubled.
Worked examples
The text and the settings are remembered in this browser alone, so they are still here when you come back. Start over, above the tool, forgets them. A paste longer than 20,000 characters is converted in full but is not written to storage. One pass reads up to 2,000,000 characters and writes up to 200,000 rows and 1,000 columns.
Common questions
- How do I convert text to CSV?
- Paste the text into the text box. It is read as tab separated to start, which is what text copied out of a spreadsheet looks like, and the CSV appears as you type. If your text uses something else, pick it on the delimiter strip: comma, semicolon, vertical bar, space, any run of spaces, or a character you type yourself. Copy puts the whole file on your clipboard and Download writes it as converted.csv.
- What is the difference between a delimiter and fixed width?
- A delimiter is a character that sits between the fields, so the line is cut wherever that character appears. Fixed width has no such character: the columns are a certain number of characters wide, the way a printed report or a mainframe export is laid out, so you type the widths instead, for example 10, 5, 20. Anything left over past the last width becomes one more field rather than being thrown away, and a line that stops before the widths run out is listed with its length so you can see which lines were short.
- What happens to a line with the wrong number of fields?
- It is converted and then named. The column count comes from the header row, from the first row when the header setting is off, or from the widths you typed in fixed width mode, and any line that does not match is written into the CSV exactly as it was read and listed below the readout with its line number and its field count. A row is never dropped and a field is never cut off the end. Pad short rows to the column count is a switch, off to start, and a row it pads is still listed with what the padding did.
- Does a comma or a quote inside a field survive?
- Yes, that is what the RFC 4180 quoting is for. A field holding a comma, a double quote, a carriage return or a line feed is wrapped in double quotes, and any double quote inside it is written twice, so 8mm, steel comes out as "8mm, steel" and he said "yes" comes out as "he said ""yes""". A spreadsheet reads both back as the single value you started with. Quote every field is there as well for importers that expect it, and wrapping a field that did not need it is still valid CSV.
- What does the header setting do?
- It says that the first row holds the column names. That row is written out as the first line of the CSV, and its field count is the number every other row is measured against. With the setting off, no names are invented and no row is spent on them: every line is data, and the first row sets the column count instead. In fixed width mode the widths set it either way. The Header cell in the readout says which of the two is on.
- My text already has quotes in it. Will they be doubled up?
- Only if you leave the already quoted setting off, because then a quotation mark is just a character in a field. Switch on the text already uses quotes and the pasted text is read by the RFC 4180 rule too, so a quoted field may hold the delimiter or even a line break and comes back as one field. That reader needs a single character delimiter, and a quote that never closes is refused with the line it opened on rather than guessed at.
- How do I stop Excel running a field as a formula?
- Switch on the apostrophe setting. A field that starts with =, +, - or @ is given a leading apostrophe, which is how a spreadsheet is told to store what follows as text. A field that is a plain number is left alone, so -5 stays the number minus five and only something like -5+3 is guarded, and the line under the readout says how many fields were changed. The setting is off to start, because it does change your values. Line endings are the other Excel detail: LF is the default and CRLF, which RFC 4180 specifies, is one click away.
- How much text can it take, and is any of it uploaded?
- One pass reads up to 2,000,000 characters and writes up to 200,000 rows, 1,000 columns and 2,000,000 characters of CSV. Those are memory limits rather than a plan, and they are enforced honestly: the size of the file is worked out from the written fields before it is built, so a paste past the cap tells you how many rows did fit instead of handing back a file that was cut short. Nothing is uploaded. The conversion runs in your browser, the text and the settings are remembered in this browser alone, and Start over above the tool forgets them. A paste longer than 20,000 characters is still converted in full but is not written to storage.
- How do I convert a TXT file, TSV or pipe-delimited text to CSV?
- Open the text file in a text editor and paste its contents here; this tool has no file picker. Choose Tab for TSV or copied spreadsheet cells, Vertical bar for pipe-delimited text, Semicolon for semicolon-delimited records, or Custom for another separator. If the input already quotes fields, enable The text already uses quotes. For example, name|note followed by Ava|8mm, steel produces a CSV whose note is quoted as "8mm, steel". Renaming a TXT file does not choose its field layout.
- Can I convert fixed width text to CSV without splitting names at spaces?
- Yes. Use the <a href="/text-to-csv/fixed-width">fixed width to CSV page</a>, enter the widths in their original order, then inspect the result. Spaces inside a column do not split it. Trim removes padding at the edges of each field; switch it off to preserve that padding. Extra text past the final width becomes another field, and short lines are reported.
- Can I export Excel data or keep identifiers like 0012?
- Copy a range of spreadsheet cells and paste the tab-separated values here, or paste a delimited text export. The CSV preserves the text 0012, but Excel may infer a number or date when importing it. Choose Text for that column in your spreadsheet import, or open the generated CSV in <a href="/spreadsheet-converter/csv-to-xlsx">CSV to XLSX</a> and set its type to Text. The apostrophe option guards formula-like text; it does not force every numeric-looking identifier to stay text in every spreadsheet.
- Can this convert CSV to TXT, TSV or a fixed width report?
- This page always writes comma-separated CSV. CSV is already a plain-text format, but changing its extension does not change its delimiter. Use <a href="/spreadsheet-converter">Spreadsheet Converter</a> for CSV or TSV output and delimiter choices. This tool does not write padded fixed width reports, combine multiple files, export phone messages or use AI to extract tables from unstructured prose.
Exact conversion under the settings you choose, quoted by RFC 4180 so a comma or a quotation mark inside a field survives. A line that does not fit the column count is reported rather than silently dropped or padded.