Skip to main content
FreeOnlineTools Go
English
comparison

CSV vs TSV: Which Delimiter Format Should You Use?

By · Updated 2026-09-02

Quick Answer

Use CSV for general-purpose data exchange, spreadsheet import/export, and maximum compatibility. Use TSV when your data contains commas but not tabs, to avoid quoting and escaping complexity. TSV is common in bioinformatics and NLP; CSV is the universal default for tabular data.

Introduction

CSV (Comma-Separated Values) and TSV (Tab-Separated Values) are two plain-text formats for tabular data. Both store rows as lines with fields separated by a delimiter. CSV uses commas; TSV uses tab characters. The choice of delimiter affects escaping, compatibility with spreadsheet apps, and handling of text fields containing the delimiter.

Step by Step

  1. Compare delimiter and escaping

    CSV uses commas. If a field contains a comma, it must be wrapped in quotes: "Smith, John". If a field contains quotes, they must be escaped: "He said ""hello""". TSV uses tabs. Tabs rarely appear in text data, so TSV fields usually need no quoting or escaping — simpler parsing.

  2. Compare compatibility

    CSV is universally supported: Excel, Google Sheets=Sheets, every database, every programming language. TSV is also widely supported but less standardized — some tools interpret tabs differently. Excel auto-detects both, but CSV is the default export format.

  3. Compare parsing complexity

    CSV parsing requires a state machine to handle quoting rules (RFC 4180). TSV parsing is trivial: split each line by tab character. This makes TSV faster to parse and less error-prone. However, CSV has a formal spec (RFC 4180); TSV has no formal standard.

  4. Compare use cases

    CSV: spreadsheet import/export, data APIs, ETL pipelines, config files, universal data exchange. TSV: bioinformatics (BLAST, GFF), NLP (CoNLL format), clipboard data (copy from Excel = TSV), log files with tab delimiters.

  5. Decide based on your data

    If your data contains commas (names, addresses, sentences): TSV avoids quoting. If your data contains tabs (rare in text): CSV avoids quoting. If you need maximum compatibility: CSV. If you want simpler parsing and your data is tab-free: TSV.

Examples

Same data in CSV and TSV

Input: CSV: name,age,city\n"Smith, John",30,"New York, NY"\nTSV: name\tage\tcity\nSmith, John\t30\tNew York, NY

Output: CSV requires quotes for fields with commas. TSV needs no quoting because tabs don't appear in the data.

Common Problems

  • CSV quoting edge cases: fields containing commas, quotes, or newlines require RFC 4180 quoting rules — a naive split by comma will corrupt data with embedded commas.
  • TSV has no formal standard: unlike CSV (RFC 4180), TSV has no official spec, so tools may handle edge cases differently — use TSV only within controlled pipelines.
  • Excel encoding issues: Excel may export CSV with BOM or locale-specific delimiters (semicolon in EU locales) — specify UTF-8 encoding and verify delimiter on import.
  • Newline ambiguity: CSV fields with embedded newlines are valid but break line-by-line parsing — TSV rarely has this problem because tabs are uncommon in text data.

Tips

  • Use CSV for maximum compatibility — every spreadsheet, database, and programming language supports it natively.
  • Use TSV when your data contains commas but not tabs (names, addresses, sentences) to avoid quoting complexity entirely.
  • Always use a proper CSV parser (not string.split) to handle RFC 4180 quoting rules — naive splitting corrupts fields with embedded commas or quotes.
  • When copying data from Excel to a text editor, the clipboard uses TSV format — paste into a .tsv file to preserve fields with commas correctly.

Related Tools

Related Guides

References