If you have ever exported a report, connected two systems or sent data to a developer, you have probably been asked for “a CSV” — or been handed a JSON file and wondered how to open it. CSV, TSV and JSON are the three plain-text formats that carry most of the world’s tabular and semi-structured data. They look similar enough to be confused and different enough to cause real problems when the wrong one is used.

This guide explains how each format works, what it is good and bad at, and how to decide between them. It uses one small dataset throughout so the differences are concrete rather than abstract.

Comparison of CSV, TSV and JSON: CSV and TSV store text only in a flat table and take 41 KB for 1,000 rows; JSON stores strings, numbers, booleans and null, supports nesting, and takes 88 KB for the same rows.
The same 1,000 customer records saved in each format. Sizes were measured, not estimated.

The same data, three ways

Here are two customer records in each format.

CSV (comma-separated values):

id,name,city,plan
10001,"Lee, Morgan",Leeds,pro
10002,Priya Nair,Pune,free

TSV (tab-separated values — the gaps are single tab characters):

id	name	city	plan
10001	Lee, Morgan	Leeds	pro
10002	Priya Nair	Pune	free

JSON (JavaScript Object Notation):

[
  { "id": 10001, "name": "Lee, Morgan", "city": "Leeds", "plan": "pro" },
  { "id": 10002, "name": "Priya Nair", "city": "Pune", "plan": "free" }
]

Three things stand out already. CSV had to put quotes around “Lee, Morgan” because the value contains the delimiter; TSV did not. JSON repeats every column name in every record. And JSON can say that id is a number, while in CSV and TSV everything is just text.

CSV: the universal table

CSV is the closest thing data has to a lingua franca. Every spreadsheet opens it, every database can import it, and almost every SaaS product — CRMs, email platforms, ad managers, accounting tools — offers “Export to CSV”.

The rules are short. Each line is a record; fields are separated by commas; a field that contains a comma, a double quote or a line break is wrapped in double quotes; and a double quote inside a quoted field is written twice (""). Those conventions are written down in RFC 4180, published in 2005. RFC 4180 is “informational” rather than a binding standard, which explains much of CSV’s messiness: real files vary.

Where CSV is strong

  • It is compact. There is no repeated structure, only values and separators.
  • It is readable in any text editor and opens in a spreadsheet with a double-click.
  • It streams well: a program can read one line (one record) at a time without loading the whole file.

Where CSV breaks

  • No types. 00142, 2024-03-18 and TRUE are all just text. The program reading the file decides what they mean — and spreadsheets often guess wrong, dropping leading zeros or turning codes into dates.
  • No single delimiter. In countries where the comma is the decimal separator, such as Germany, France or Brazil, Excel writes CSV files with semicolons instead. A “CSV” from a European colleague may not split correctly on commas.
  • Encoding is unstated. Nothing in the file says whether it is UTF-8 or a legacy encoding such as Windows-1252, so accented letters can come out garbled.
  • Quoting is easy to get wrong. Code that splits lines on commas, instead of using a real CSV parser, breaks on the first quoted comma or multi-line value.

TSV: CSV without the quoting headaches

TSV follows the same idea, but uses the tab character as the separator. Because tabs almost never occur inside real-world values such as names, addresses and descriptions, TSV rarely needs quoting at all. The IANA media type registration for text/tab-separated-values simply forbids tabs inside fields.

Where TSV is strong

  • Values full of commas — addresses, product descriptions, free-text notes — need no special treatment.
  • When you copy cells from Excel or Google Sheets, the clipboard holds TSV. Pasting TSV back into a spreadsheet splits columns perfectly.
  • Command-line tools such as cut, awk and sort split on tabs easily, which makes TSV popular in bioinformatics and data engineering.

Where TSV breaks

  • There is no agreed way to store a tab or a line break inside a value. Some tools wrap such fields in quotes like CSV; others use backslash escapes such as \t and \n; others reject them. A TSV file that relies on one convention can be misread by a tool that expects another.
  • Tabs are invisible. A stray space where a tab should be is hard to spot in a text editor.
  • Fewer business applications offer TSV import than CSV import.

JSON: structure and types

JSON comes from the world of web development and is defined in RFC 8259. Instead of rows and columns, it describes values: strings, numbers, true/false, null, arrays (ordered lists) and objects (named fields). Those values can be nested to any depth.

Where JSON is strong

  • Types. A number is a number and a string is a string, so a program reading "00142" knows to keep the zeros.
  • Nesting. An order can contain a customer object and a list of line items. Representing that in CSV means either several files or awkward column names such as items.0.sku.
  • Ubiquity in software. Virtually every web API, programming language and modern database speaks JSON natively. RFC 8259 also requires UTF-8 for JSON exchanged between systems, which removes the encoding guesswork.

Where JSON breaks

  • Size. Repeating every key in every record adds up. In our test, 1,000 five-field customer records took 41 KB as CSV and 88 KB as minified JSON — 2.1 times larger. Pretty-printed with two-space indentation, the same data took 124 KB.
  • Spreadsheets cannot open it directly. Business users usually need it converted to CSV first.
  • Numbers have a hidden ceiling. JSON itself allows any number, but most JavaScript-based tools store numbers as 64-bit floating point. Integers above 9,007,199,254,740,991 (253 − 1) get rounded when parsed — a real issue for order IDs and tracking numbers.
  • Strict syntax. One trailing comma or single-quoted string makes the whole file invalid.

A popular variant, JSON Lines, puts one JSON object on each line. It keeps JSON’s types while letting programs stream records one at a time like CSV, which is why it is common for logs and data pipelines.

Side-by-side summary

CSV TSV JSON
Structure Flat table Flat table Nested objects and arrays
Types None (all text) None (all text) String, number, boolean, null
Separator problems Commas in values need quotes Tabs in values have no standard None
Size (our 1,000 rows) 41 KB 41 KB 88 KB minified
Opens in spreadsheets Yes Yes (paste or import) No, convert first
Typical use Exports, imports, reporting Clipboard, scripts, science APIs, apps, configuration

How to choose

Decision guide: use JSON for nested data or when types matter; JSON Lines for streams of records; TSV when values contain many commas or for pasting and Unix tools; otherwise CSV.
A quick way to pick a format for a new export or integration.

Start with who — or what — will read the file.

  1. A person in a spreadsheet, or a business tool’s import screen? Use CSV. It is what those tools expect. If the recipient is in a comma-decimal country, ask whether they need semicolons.
  2. A program, especially through an API? Use JSON, particularly if the data has lists inside records (an order with several items) or if the difference between "42" and 42 matters.
  3. A flat table full of commas, or a command-line workflow? TSV avoids quoting entirely, as long as no value contains a tab or a line break.
  4. Millions of records processed one at a time? CSV or JSON Lines, so the reader never has to load everything into memory.

When in doubt, remember that conversion is cheap. It is common to keep data as JSON in an application and export CSV for people, or to receive CSV from a partner and turn it into JSON for your code.

Converting between formats without surprises

Most conversion problems come from tools that “help” by changing values: stripping leading zeros, rounding long numbers or reinterpreting dates. When you convert:

  • CSV to JSON: keep values as strings unless you are sure every value in a column is a real number. Our CSV to JSON converter does this by default and only infers types that round-trip exactly.
  • JSON to CSV: decide how nested objects should appear — flattened into columns like customer.name, or kept as JSON text in one cell — and make sure no property is silently dropped. The JSON to CSV converter lets you choose, and copies large numbers digit for digit.
  • CSV to TSV and back: let a real parser handle quoted fields so embedded commas and line breaks survive. The CSV ⇄ TSV converter shows exactly how each value is written.

All three run in your browser, so the file never leaves your computer.

Key takeaways

  • CSV is the default for tables that people or business tools will open. It is compact but untyped, and its delimiter and encoding vary.
  • TSV is CSV with tabs. It avoids most quoting problems and is ideal for clipboard and script work, but has no standard for tabs inside values.
  • JSON carries types and nested structure, which is why software prefers it. It is larger, and very large integers need careful handling.
  • Choose by the reader: spreadsheets and imports get CSV; programs and APIs get JSON; comma-heavy tables and Unix pipelines get TSV.