Tools

Developer guide

TSV vs CSV: Tabs vs Commas and the Quotes Trap

CSV and TSV look nearly identical, and the only real difference is one character: the delimiter. Yet that single character decides who has to quote half their values and who doesn't. This guide explains the practical difference, the “quotes trap” that breaks naive CSV, and when switching to TSV will save you an afternoon of debugging.

Benjamin Rotshtein

Written by Benjamin Rotshtein

Updated

What's the actual difference?
TSV separates fields with tabs, CSV with commas. Same rows, same headers, same quoting rules — a different delimiter, and very different quoting needs.
When is TSV the better choice?
When your values contain commas — addresses, descriptions, lists — or when you want to avoid quoting entirely in generated files.
Can I convert between them?
Yes, and the converters on this site do it correctly — parsing quotes first, then re-joining with the target delimiter. Runs entirely in your browser.

CSV: commas and the quotes trap

CSV (Comma-Separated Values) splits fields on commas. That sounds simple, until a value itself contains a comma:

name,city,notes
Alice,"New York, NY","Said ""hi"", then left"

To represent New York, NY the whole field must be wrapped in double quotes. A value containing a quote needs the quote doubled (""hi""). This is the quotes trap: any code that naively splits on , corrupts the data, which is why thousands of scripts and one-off exports break on real-world CSV.

TSV: tabs, where commas are just data

TSV (Tab-Separated Values) uses a tab character as the delimiter. The same record, without any quoting:

name	city	notes
Alice	New York, NY	Said "hi", then left

The comma in New York, NY and the quotes in the notes column are ordinary characters now — no escaping needed. Tabs are vanishingly rare inside human data, so TSV files are almost always quote-free and trivially safe to parse.

TSV vs CSV — the practical comparison

CriterionCSVTSV
DelimiterCommaTab
Values with commasMust be quotedFine as-is
Values with quotesMust double the quoteFine as-is
Values with tabsFine as-isMust be handled / escaped
StandardRFC 4180IANA text/tab-separated-values
Excel supportDefault, universalOpens .tsv, splits on tabs
Unix / DB toolingWorks, but quoting mattersOften the native delimiter

When TSV is the smarter choice

When CSV stays the right choice

The newline trap both share

One trap neither format dodges: a newline inside a value. Both CSV and TSV need quoted fields to carry an embedded line break, and many spreadsheet tools still mishandle it. If your data legitimately contains newlines, keep the fields quoted and always test the file in the tool that will actually open it.

Converting between TSV and CSV

A correct conversion parses the source format respecting quotes, then re-joins with the target delimiter and re-quotes only what needs it. The CSV to TSV converter and TSV to CSV converter do exactly that, and they run entirely in your browser.

Frequently asked questions

What is the difference between TSV and CSV?

Only the delimiter. TSV uses a tab character between fields; CSV uses a comma. Everything else — rows, headers, quoting — follows the same family of rules. TSV is a subset of the broader DSV (delimiter-separated values) family.

Why does CSV need quotes but TSV often doesn't?

Because commas appear inside real-world values far more often than tabs do. A value like 'New York, NY' must be wrapped in quotes in CSV, which is exactly the quoting trap that breaks naive parsers. In TSV the comma is just a character, so fewer values need escaping at all.

When should I use TSV instead of CSV?

When your data is full of commas — addresses, descriptions, lists, European numbers (1.234,56) — or when you generate files from code and want to avoid hand-rolled quote escaping. Unix tools and many database importers treat tabs as the native delimiter too.

Does Excel open TSV files correctly?

Excel opens .tsv files by splitting on tabs, which works well when your values contain commas. The main caveat is newlines inside fields: Excel expects quoted fields, and a TSV with embedded newlines can still misbehave.

What does RFC 4180 say about TSV?

RFC 4180 only standardizes the comma-separated variant. TSV has no RFC of its own — the de-facto standard is tab-separated fields with optional quotes, which is what IANA's registered text/tab-separated-values type and most tools implement.

Can a TSV field contain a tab?

Not without escaping. If a value contains a literal tab, the standard trick is to replace it with spaces or escape it in a way your downstream tool understands. This is the one character TSV cannot represent natively, while CSV has the same problem only for commas.

Related guides