Data & APIs

TSV vs CSV: Choosing a Spreadsheet Export Format

Compare tabs and commas, quoting rules, locale issues, and text preservation in spreadsheet exports.

Photorealistic editorial photo for Tsv Vs Csv
Data & APIs · Practical ideas for your next build

CSV separates cells with commas; TSV uses tabs. Both can represent rows and columns as plain text. The best choice depends on the data and the importer: changing the delimiter does not remove the need to handle quoted fields, line endings, character encoding, and column types.

Match the delimiter to the receiving application

Tabs are convenient for copying cells directly from a spreadsheet because commas inside names and addresses remain ordinary text. CSV is widely supported by databases and reporting tools. Some regional spreadsheet settings export semicolon-separated files under the CSV label. Inspect the actual first line instead of trusting the extension, and select the delimiter explicitly when importing.

Do not split every row with a simple string operation

A quoted cell can contain the delimiter or a newline. A parser needs to track whether it is inside quotes and interpret doubled quotes as a literal quote. Our TSV converter supports that convention and rejects rows with inconsistent cell counts. However, TSV producers do not all share identical escaping rules; inspect exports from the application you actually use.

Preserve identifiers before converting

Postal codes, account numbers, and long IDs should generally stay strings. A spreadsheet can remove leading zeros or switch long values to scientific notation before export; a converter cannot reconstruct the original digits. Set identifier columns to text at the source. When opening untrusted exports in a spreadsheet, remember that cells beginning with formula characters may be interpreted as formulas by that application.

Worked example

EXAMPLE
name	postal_code
Ada	00123

JSON value: {"name":"Ada","postal_code":"00123"}

Does TSV avoid all quoting problems?

No. Tabs and line breaks can appear inside cells, so the exporter and importer still need an agreed escaping convention.

Reference and further reading

Read the official documentation ↗