scalpel@labs: ~/glossary/tsv-tab-separated-values.mdx5 sections

TSV Files: Tab-Separated Values and When to Use Them

TSV (tab-separated values) is like CSV but uses a tab between fields. Because ordinary text rarely contains a tab, TSV pastes into a spreadsheet cleanly even when cells hold commas, which is why the clipboard uses it for structured pastes.

extension: Scalpel Tablesupdated: 2026-08-14read_time: 3 min
less tsv-tab-separated-values.mdx

Why it matters

CSV is the standard portable file format for tables. But for pasting directly into a spreadsheet, TSV is better. CSV uses commas as delimiters, which is fine for a file you save to disk, but problematic when you paste. If a table cell contains a comma, the spreadsheet might split it into two columns instead of keeping it as one value.

TSV uses a tab character as the delimiter. Tabs almost never appear in ordinary text, so TSV avoids the ambiguity CSV runs into. When you paste TSV into Google Sheets, Excel, or Numbers, the columns stay intact even if cells hold commas, quotes, or line breaks.

That's why Scalpel Tables uses both: it puts both tab-separated and HTML table formats onto your clipboard at once when you click Copy. The spreadsheet picks whichever it prefers, and you get a clean paste every time.

How it works

TSV is simpler than CSV. Every cell sits between two tabs (or a newline and a tab for the last cell in a row). There is no quoting mechanism like CSV has. If a tab appears inside a cell, it's replaced with a space so the grid stays rectangular. Newlines inside a cell are also flattened to spaces.

Because tabs are unusual in normal text, TSV doesn't need the quoting rules that make CSV complex. You don't double a tab to escape it; you just replace it. That simplicity is why TSV is the natural choice for the clipboard.

The trade-off is data loss. If a cell contains a literal tab, it becomes a space. If a cell has a line break that you want to preserve, it flattens too. For export to a file that you'll use later, CSV is safer because it can round-trip those characters. For an immediate paste into a spreadsheet, TSV is better because it's more reliable.

What does not matter

TSV files don't have a standard file extension. You might see .tsv, .txt, or even no extension. The content type text/tab-separated-values is registered with IANA, but there's no standard filename. Scalpel labels its TSV exports as "copy as TSV" from the menu, but if you were to save one as a file, naming it .tsv or .txt is equally valid.

Also, TSV has no standard for headers or encoding, unlike CSV and RFC 4180. Some TSV files have a header row; some don't. Some use UTF-8; others use ASCII. When you're pasting into a spreadsheet, the tool detects the encoding automatically, so it doesn't matter much. But when exchanging TSV files between systems, agree on the format upfront.

Code example

The same data as CSV and TSV:

CSV (commas as delimiters; commas inside cells must be quoted):

Product,Price,Notes
Shoes,"$99.99, on sale"
Hats,"$29.95, red"

TSV (tabs as delimiters; tabs and newlines inside cells are replaced with spaces):

Product	Price	Notes
Shoes	$99.99, on sale	(no replacement needed; comma is fine)
Hats	$29.95, red	(tab-free)

When pasted into a spreadsheet:

  • The CSV version might split the Notes cell at the comma, creating extra columns.
  • The TSV version pastes cleanly as two columns: Product, Price, Notes.

Both formats carry the same data. TSV just handles the comma-in-cell case more gracefully for pasting.

How Scalpel shows it

Scalpel Tables doesn't show TSV as a separate download button on the card (like CSV or XLSX). Instead, TSV is the format used internally for the clipboard copy. When you click the Copy button on a table card, Scalpel writes both TSV (as text/plain) and HTML (as text/html) to the clipboard. Sheets and Excel each read whichever format they prefer. You paste and the columns stay intact.

If you want a TSV file to download and save, use the overflow menu (the three dots) on the table card and select "Copy as TSV." That copies it to your clipboard so you can paste it into a text editor and save as a file.

Sources