How to use the text to csv converter
- Paste or type your text into the Input text box. Each line becomes a CSV row.
- Choose the Separator that splits each line into fields: Space, Tab, Comma, Semicolon, Pipe, or Custom.
- If you chose Custom, enter the exact separator string in Custom separator.
- Enable Trim whitespace to remove leading and trailing spaces from each field.
- Set Quote fields to Auto (quotes only when needed), Always, or Never. The CSV appears instantly.
How the conversion works
The tool reads the input line by line. Each line is split using the chosen separator. For space the split uses a regular expression that treats consecutive spaces as one delimiter. For tab, comma, semicolon, and pipe the exact character is used. For custom the provided string is used as a literal separator (not a regular expression).
After splitting, each field is optionally trimmed. Then the fields are joined with commas to form a CSV row. Quoting follows the CSV RFC 4180 rule: a field is quoted when it contains a comma, a double quote, or a newline. In Auto mode this rule is applied. In Always mode every field is wrapped in double quotes. In Never mode no quoting is added; if a field contains a comma or quote the output may not be valid CSV. This text to csv logic ensures predictable output for any delimiter.
Common separators and when to use them
Tab is the default because many copy-paste operations from spreadsheets produce tab-separated lines. Comma works when the input is already comma-delimited but lacks quoting. Semicolon is common in European CSV files. Pipe appears in log files and markdown tables. Space splits on runs of whitespace, useful for aligned columns. Custom handles any other delimiter such as :: or ||. Choosing the right separator is the key to a clean text to csv conversion.
Quoting rules
CSV fields that contain commas, double quotes, or line breaks must be enclosed in double quotes. Any double quotes inside the field are escaped by doubling them (""). The Auto setting applies this rule automatically. Always quotes every field, which some downstream parsers prefer. Never skips quoting entirely; use only when you are certain no field contains a comma or quote. Understanding quoting helps avoid broken imports in Excel or databases.
Handling uneven rows
If lines split into different numbers of fields, the output CSV will have the maximum column count across all rows. Shorter rows are padded with empty fields so every row has the same number of columns. This matches typical spreadsheet behaviour and prevents ragged arrays when you open the file later.
Example: converting a markdown table
Copy a markdown table without the header separator line:
| Name | Age | City |
| Alice | 30 | New York |
| Bob | 25 | London |
Paste it, choose Pipe as the separator, enable Trim whitespace, and the tool produces clean CSV. The leading and trailing pipes create an empty first and last field; you can delete those columns in your spreadsheet if needed. This example shows how a text to csv workflow can turn markdown into data.
Worked examples
| Example | Input | Result |
|---|---|---|
| Tab-separated | Input text: Name Age City / Alice 30 New York / Bob 25 London; Separator: tab; Trim whitespace: yes; Quote fields: auto | Name,Age,City / Alice,30,New York / Bob,25,London |
| Space-separated | Input text: Name Age City / Alice 30 New York / Bob 25 London; Separator: space; Trim whitespace: yes; Quote fields: auto | Name,Age,City, / Alice,30,New,York / Bob,25,London, |
| Custom separator | Input text: Name::Age::City / Alice::30::New York / Bob::25::London; Separator: custom; Custom separator: ::; Trim whitespace: yes; Quote fields: auto | Name,Age,City / Alice,30,New York / Bob,25,London |
FAQ
Does this tool send my data to a server?
No. The conversion runs entirely in your browser. Nothing is uploaded.
Can I convert a file with mixed separators?
Each line uses the same separator. If your file mixes tabs and commas, preprocess it first or use a script.
What happens if the custom separator is empty?
The tool shows an error. Enter at least one character.
Why does Auto quoting add quotes around some fields?
Auto follows RFC 4180: fields containing commas, double quotes, or newlines are quoted, and internal double quotes are doubled.
Can I use this for TSV to CSV?
Yes. Choose Tab as the separator and the output is standard CSV.
Does the tool handle quoted fields in the input?
The tool treats the separator as a literal delimiter. It does not parse existing CSV quoting. If your input is already quoted CSV, use a CSV parser instead.
How many times can I run the text to csv conversion?
As many as you like. The tool is free, runs locally, and has no usage limits.