TSV to CSV

Turn tab-separated data into properly quoted CSV.

Reverse
Input
TSV input
Output
Result

About this tool


Going from TSV to CSV means introducing quoting. Once a comma becomes the delimiter, any value that already contains a comma has to be wrapped in double quotes, and any double quote inside a value has to be doubled.

This is the direction that requires care rather than the other, because getting the quoting wrong produces a file that appears to load but has silently shifted columns.

How to use it

  1. Paste or upload TSVDrop a .tsv file onto the input pane, use the file picker, or paste the text directly.
  2. Adjust the options if neededThe defaults suit most input. Open Options to change how values are interpreted or formatted.
  3. ConvertPress Convert to CSV, or use Ctrl+Enter (Cmd+Enter on macOS).
  4. Read any warningsWarnings explain anything that could not be represented exactly in the target format.
  5. Copy or downloadCopy the result, or download it as a .csv file.

Worked examples


Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.

TSV to CSV

Input

id	city
1	London, UK
2	Paris

Output

id,city
1,"London, UK"
2,Paris

The value containing a comma is now quoted, so the column boundary stays correct.

What to watch for


The details that decide whether a conversion is correct, and where information can be lost without any error being raised.

Quoting is added exactly where RFC 4180 requires it
A field is wrapped in double quotes if it contains the comma delimiter, a double quote, or a line break. An embedded double quote is escaped by doubling it, so he said "hi" becomes "he said ""hi""". Fields with no special characters are left bare, which keeps the file readable.
Tab-separated input is unambiguous
Because TSV values cannot contain tabs, splitting the input is straightforward. There is no quoting to interpret first. That makes this conversion completely reliable in a way CSV parsing is not.
Where TSV files come from
Copying a range out of a spreadsheet produces tab-separated text on the clipboard, and many database exports and scientific data formats use tabs by default. Converting to CSV is usually about feeding a tool that expects .csv specifically.

Limitations


  • The output uses the minimal quoting style, which is valid but not byte-identical to tools that quote every field.
  • Processing happens in your browser, so very large inputs are bounded by available memory. Files above roughly 10 MB are handled but will feel slower, and multi-hundred-megabyte files are better suited to a command-line tool.

Questions


Why is only one of my values quoted?
Quoting is applied only where it is needed, a value containing a comma, a double quote or a newline. Quoting everything is valid CSV too, but it makes the file harder to read.
Is this conversion lossless?
Yes. TSV values cannot contain tabs, so the input parses unambiguously and every value is representable in CSV once quoted.