Comparison

CSV vs TSV

CSV separates fields with commas and TSV with tabs. Because commas appear constantly in ordinary text, CSV needs quoting rules that many parsers implement badly. Tabs are rare inside real data, so TSV usually needs no quoting at all. CSV is more widely supported; TSV is more predictable. Choose TSV when your data is full of commas.

CSV to TSV Converter

Convert comma-separated data to tab-separated values.

Open the tool

The difference is one character, and it has larger consequences than it should. Commas are everywhere in real data — in names, addresses, prices and free text — so any CSV parser must handle quoted fields, escaped quotes and newlines inside quotes. Plenty of hand-written parsers do not.

Tabs almost never appear inside real field values, so TSV sidesteps most of that complexity. The trade-off is that tabs are invisible, which makes a malformed TSV file harder to diagnose by eye.

The quoting problem

In CSV, a field containing a comma must be quoted, and a quote inside a quoted field must be doubled. RFC 4180 specifies this, but plenty of exporters and importers only partially implement it, which is why splitting a CSV line on commas is one of the most reliable ways to corrupt data.

  • A field with a comma must be wrapped in double quotes.
  • A literal double quote inside is written as two.
  • A field may contain newlines if it is quoted.
  • Any of these can break a naive parser.

The locale problem

In locales where the comma is the decimal separator — much of continental Europe — spreadsheet software exports CSV using semicolons instead, to avoid ambiguity with numbers. A file called .csv may therefore be comma, semicolon or tab delimited, and you cannot tell from the extension. TSV has no equivalent ambiguity.

When to choose each

Use CSV when the consumer is unknown or the format is dictated: it is the most universally accepted tabular format and every tool imports it. Use TSV when your data contains commas, when you control both ends, or when you are piping through Unix text tools, which handle tab-delimited input naturally.

Example

The same two records. CSV needs quoting for the comma; TSV does not.

CSV

id,name,notes
1,"Smith, John","Said ""yes"" twice"

TSV (tabs shown as arrows)

id→name→notes
1→Smith, John→Said "yes" twice

Frequently asked questions

Which format should I send someone?
CSV, unless you know their tooling. It is the most universally supported tabular format. Send TSV when the data is full of commas and you know the recipient can handle it, or when both ends are systems you control.
Why is my CSV semicolon-delimited?
It was exported in a locale where the comma is the decimal separator, so spreadsheet software uses semicolons to avoid ambiguity with numbers. The extension is still .csv. Set the delimiter explicitly when importing rather than assuming a comma.
Can TSV contain tabs inside a field?
Only if escaped, and support for that varies between implementations. In practice the assumption is that fields contain no tabs, which is what makes TSV simple. If your data genuinely contains tabs, use CSV with proper quoting.
Do these formats support types?
No. Every value is text. Whether "42" is a number or a string, and whether "007" keeps its leading zeros, is decided entirely by whatever imports the file — which is why spreadsheet software so often mangles product codes and postcodes.
What about the header row?
Neither format requires one, and neither has a way to signal whether one is present. It is a convention agreed out of band, which is why every converter needs an explicit setting for it.

Tools used in this guide

All tools →
All guides →

Last reviewed .