TSV vs CSV: Why Tab-Separated Text Pastes Cleanly Into Notes
TSV vs CSV in one paragraph
Both are plain-text tables: one record per line, fields split by a delimiter. CSV uses a comma and needs double quotes whenever a field contains a comma, a quote, or a line break. TSV uses a tab and, in its IANA registration, simply forbids tabs inside fields, so ordinary prose rarely needs any quoting. That's why tab-separated text tends to paste into a note without surprises.
What TSV and CSV each are
Wikipedia describes TSV as a plain text data format where the values of a record are separated by a tab character and each record is a line. It is a form of delimiter-separated values (DSV) and is similar to CSV. The format came from the University of Minnesota Internet Gopher Team, with a first release around June 1993, and the media type is text/tab-separated-values.
The IANA registration calls TSV a popular method of data interchange among databases, spreadsheets and word processors, and "the lowest common denominator in many cases between two different applications." Each record is a single line, each field value is text, and fields are separated by a tab. The first line holds the field names, and every record must have the same number of fields.
Here is the same small table both ways. In the TSV block, the gaps are real tab characters:
name city note
Ada London likes tea, and biscuits
Lin Chengdu says "hello"name,city,note
Ada,London,"likes tea, and biscuits"
Lin,Chengdu,"says ""hello"""Look at the third column: The CSV version needed quotes around the comma and doubled quotes around the inner quotation marks. The TSV version needed nothing.
Quoting and escaping
CSV has a written-down convention. RFC 4180 says fields containing line breaks, double quotes, and commas should be enclosed in double quotes, and that a double quote inside a quoted field is escaped by preceding it with another double quote. That's where "says ""hello""" comes from. We cover the details in our guide to CSV quoting rules.
TSV takes the opposite approach. The IANA registration defines no quoting or escape mechanism at all. It says only that fields containing tabs are not allowable. A tab is a character you almost never type by accident in a sentence, so a name, an address, or a note with commas in it goes straight through. The trade-off is plain too: if a value really contains a tab or a line break, plain TSV cannot represent it.
No single spec for either
Neither format is as universal as it looks, though. RFC 4180 says there is no formal specification for CSV and documents the format that seems to be followed by most implementations. It also notes that, due to the lack of a single specification, there are considerable differences among implementations.
TSV has even less. Wikipedia points out that for TSV there is only a media-type assignment, and that this can lead to inconsistent behavior with backslashes, quotation marks, and the disallowed tabs and line breaks. Some tools escape characters as \t, \n, \r, and \\. Others borrow CSV quoting. LibreOffice Calc, for one, treats TSV as a CSV variant with tab delimiters instead of comma. Some tools can't store tabs or line breaks at all.
In practice, a "TSV" from one program can differ from a "TSV" from another, just as CSV files do. If a file matters, open it in the program that will read it and check a few awkward rows.
Pasting tab-separated text into notes
The tab character is what makes TSV useful in a notes app. When you copy cells from a spreadsheet, the clipboard text is commonly tab-separated, so pasting into a plain-text note gives you aligned columns with no commas to untangle. Our post on Markdown tables shows what to do next if you want pipes instead.
Two cautions from the same Wikipedia article are worth keeping in mind:
- People editing in a text editor sometimes mix up tabs and spaces, which corrupts the data. Empty fields are also hard to count where tabs show only as whitespace.
- Terminal emulators often render tabs as multiple spaces, which prevents copying a tab correctly.
Before you trust a paste, check that the tabs survived. In an editor with visible whitespace, a tab shows as a distinct marker; a run of spaces looks different. If a column has slipped, the separator was probably converted to spaces somewhere along the way.
When to pick which
- Pasting prose-like cells into a note: TSV. Commas and quotes inside text need no special handling.
- Values that may contain tabs or line breaks: CSV with proper quoting, since TSV in its IANA form cannot hold them.
- Sending data to a tool that expects CSV: CSV, or check whether the tool lets you choose a tab delimiter.
- Ending up with a table in your notes: either works as a starting point; you can convert a CSV to a Markdown table once the data is clean.
The short version: pick the delimiter that does not appear in your data. For text, that is usually the tab.
Frequently Asked Questions
Is TSV just CSV with tabs?
Close, but not identical. Both are delimiter-separated text with one record per line. CSV (RFC 4180) defines double-quote quoting for commas, quotes and line breaks. The IANA TSV registration defines no quoting and simply disallows tabs inside fields.
Can a TSV field contain a tab or line break?
Under the IANA registration, no. Some tools escape them with \t and \n, and others borrow CSV-style quoting, so behavior varies between programs.
Which should I use for notes?
If the data is simple text without tabs, TSV pastes with fewer surprises because commas in prose do not need quoting. If fields may contain tabs or line breaks, or the receiving tool expects CSV, use CSV with proper quoting.