This tool converts CSV (comma-separated values) to TSV (tab-separated values) in your browser. The data is parsed locally; nothing leaves your machine. For the inverse direction, see TSV to CSV.
CSV vs TSV
The two formats are near-identical. The differences:
| Aspect | CSV | TSV |
|---|---|---|
| Delimiter | , | \t (tab) |
| Quoting | Required when value contains delimiter, quote, or newline | Often not used; tabs in values are forbidden by some specs |
| Standard | RFC 4180 | IANA media type text/tab-separated-values (very brief) |
| Excel default | Yes (some locales use ;) | No (but Excel can read TSV) |
| Web copy-paste | Common (CSV download links) | Common (paste from spreadsheet) |
| Tools | Most data tools accept both | Fewer tools handle TSV-specific edge cases |
When you copy from a spreadsheet (Excel, Google Sheets, Numbers) and paste into a text editor, you usually get TSV. CSV is the file-format default; TSV is the clipboard default.
The conversion
For CSV without quoted values, the conversion is “replace , with \t”:
CSV: name,age,city
TSV: name<TAB>age<TAB>city
For CSV with quoted values, the conversion has to:
- Parse the CSV correctly (respecting quotes and escapes).
- Re-emit each cell as TSV.
CSV: Alice,"NYC, NY",30
TSV: Alice<TAB>NYC, NY<TAB>30
The comma in NYC, NY is now safely a literal — TSV doesn’t use comma as a delimiter, so no quoting is needed for it. The conversion strips the surrounding quotes that CSV required.
Tabs inside values
The single thing TSV doesn’t handle gracefully is tabs inside values. If a CSV cell contains a tab character (rare but possible), naively converting to TSV produces an extra delimiter:
CSV cell: "first\tsecond" (one cell with a tab inside)
Naive TSV: first<TAB>second ← parses as TWO cells
The IANA TSV spec forbids tabs inside fields; there’s no standard escape mechanism. Workarounds:
- Replace internal tabs with spaces (lossy but most common).
- Replace internal tabs with
\tliteral (unambiguous but the consumer needs to un-escape). - Use a different format (CSV, JSON, or a delimited-format with a richer escaping layer).
The tool above replaces internal tabs — and newlines inside quoted cells — with spaces, without a warning. If preserving them matters, stay in CSV or use JSON.
Newlines inside values
Both CSV and TSV face the same problem: a newline inside a cell looks like a row terminator. CSV’s RFC 4180 says wrap the cell in quotes and the parser tracks state; TSV has no analogous mechanism in the bare spec. Some TSV parsers extend with quote support; many don’t.
Practical advice: if your data has newlines in cells, prefer CSV (with quoting) or JSON. TSV’s lack of standard escaping makes it the wrong format for these.
When TSV is the right format
- Pasting data from a spreadsheet into a tab-supporting tool (most code editors, GitHub issue text boxes, Notion).
- Unix shell pipelines.
cut,awk,sort,joinall handle TSV more gracefully than CSV (no quote-state to track). - Bioinformatics. Most bioinformatics file formats (BED, GFF, VCF, MAF) use tab separation. The community defaults to TSV.
- Quick interchange between tools that both speak TSV. Less spec ambiguity than CSV.
When CSV is better
- Files going to or from Excel as files (not via copy-paste). Excel’s CSV import is well-trodden; its TSV import requires telling Excel the delimiter.
- Data with internal commas, quotes, or newlines. CSV’s RFC 4180 quoting handles these; TSV’s spec doesn’t.
- Public data interchange. CSV is more widely understood; TSV requires more explanation.
Common pitfalls
- Visible whitespace ambiguity. Tabs render as varying widths in different editors. A column-aligned-looking TSV file may have inconsistent tabs that break parsers. Use a editor that visualizes whitespace when troubleshooting.
- Mixing CSV and TSV in one file. A “CSV” file with some tab-separated rows and some comma-separated is corrupt. Pick one delimiter per file.
- Trailing tabs. A row ending in
\tadds an extra empty cell. Some parsers trim; some don’t. Most spreadsheets export TSV with no trailing tab. - Excel locale issues. Excel in some locales (Germany, France) uses
;as the CSV delimiter and,as the decimal separator. “CSV” in those exports isn’t comma-separated. Detect the actual delimiter before parsing. - Encoding. TSV doesn’t specify encoding; UTF-8 is the modern default. Older TSV files may be Latin-1 or Windows-1252.
For other format conversions, see CSV to JSON, TSV to CSV, CSV to Markdown table.