CSV vs TSV: choose a delimited format

Compare CSV and TSV by delimiter, quoting, editability and compatibility. Learn what conversion changes, where each format fits, and how to check output before use.

CSV and TSV both store a table as plain text, with one record per line and fields separated by a delimiter. CSV uses a comma and TSV uses a tab character. That one difference shapes how each format handles values that contain the delimiter, how easy the file is to read and edit, and how reliably it moves between tools. This guide explains what changes when you convert between the two, compares them on the same criteria, and covers the checks that confirm the output works where you need it.

What converting between CSV and TSV actually changes

A correct conversion changes only the structure around the data: the field delimiter and the rules for protecting values that would otherwise break that structure. The cell values, their order, the number of columns and the number of records should all stay the same. If anything else changes, the conversion has altered the data rather than its format.

In CSV, a comma separates fields. A field that contains a comma, a double quote or a line break is wrapped in double quotes, and any double quote inside it is written twice. RFC 4180 documents this common convention, but it describes existing practice rather than a rule every tool follows. Some applications use a semicolon instead of a comma, often in locales where the comma is the decimal separator, and still call the file CSV.

In TSV, a tab separates fields. The registered media type for tab-separated values does not allow tab characters inside fields, and it defines no quoting mechanism. In practice, tools differ. Some reject or strip embedded tabs and line breaks. Some use backslash escapes such as \t and \n. Others accept CSV-style double quoting. A TSV file that relies on any of these conventions works only with tools that use the same one.

Neither format records data types. Whether a column is read as text, a number or a date is decided by the program that opens the file. Many spreadsheet applications interpret values automatically on import, for example by dropping leading zeros or reading some strings as dates. That reinterpretation happens on import with either format, not during conversion.

The same data in both formats

The following is an illustrative example written by hand, not output from a particular tool. It shows one small table with a value that contains a comma and another that contains double quotes.

id,name,note
001,"Smith, Jordan",standard
002,Lee Avery,"said ""ok"""

The same table as TSV, with each gap between fields being a single tab character:

id	name	note
001	Smith, Jordan	standard
002	Lee Avery	said "ok"

The CSV version needs quoting for the second and third rows. The TSV version needs none, because neither value contains a tab or a line break. If a value did contain a tab or a line break, the TSV version would need whatever escaping convention the receiving tool expects.

CSV or TSV: comparing the two formats

Criterion | CSV | TSV
Delimiter | Comma (sometimes semicolon, depending on the tool or locale) | Tab character
Conflict with typical content | Frequent, because commas are common in names, addresses and prose | Rare, because tabs seldom appear in ordinary text
Handling of the delimiter inside a value | Double-quote the field and double any internal quotes | Not allowed by the media type definition; tools that permit it use their own escaping
Line breaks inside a value | Allowed inside a quoted field | Not allowed by the media type definition; tools that permit it use their own escaping
Reading raw text | Quoting can make rows harder to scan | Usually cleaner, but tabs are invisible and columns may not line up
Hand editing | A misplaced quote can shift every later field | Some editors convert tabs to spaces, which breaks the structure
Tool support | Very broad; the format most import and export features offer first | Common in spreadsheets, databases and data pipelines, but less often the default
Reliable round trip | Yes, when every tool follows the same quoting rules | Yes, when no value contains a tab or line break, or both tools share an escaping convention

Choosing by situation

  • Choose CSV when the receiving system explicitly asks for it. Import forms, reporting tools and many APIs name CSV as their expected format, and matching the expected format matters more than any other advantage.
  • Choose CSV when values contain line breaks, such as multi-line comments or addresses. Quoted fields are the most widely recognized way to keep them inside one record.
  • Choose TSV when values often contain commas and never contain tabs, for example free-text descriptions or names in a "Last, First" format. You avoid most quoting and the raw file is easier to read.
  • Choose TSV when you are moving data to or from a spreadsheet through the clipboard. Many spreadsheet applications place copied cells on the clipboard as tab-separated text and split pasted tab-separated text into columns. Check this behavior in your own application.
  • Choose TSV for simple line-by-line processing with command-line tools. Splitting on a tab is reliable when no field can contain one, while CSV usually needs a parser that understands quoting.
  • When both formats would work, follow the convention your team or downstream tools already use. Consistency prevents more errors than either format's design does.

Where conversions go wrong

  • Find-and-replace instead of parsing. Replacing every comma with a tab also splits values like "Smith, Jordan" and leaves stray quote marks. A proper converter reads the CSV quoting rules first and then writes the TSV.
  • Tabs or line breaks already inside values. When converting to TSV, these must be removed, replaced or escaped. Each option changes the stored text or depends on the destination supporting the escape. Decide deliberately rather than relying on a tool's default.
  • Assuming a comma delimiter. A file named CSV may use semicolons. Confirm the actual delimiter before converting.
  • Character encoding. Text outside basic ASCII, such as accented letters, can become garbled if the source and destination assume different encodings. UTF-8 is a common choice. Some tools add a byte order mark at the start of the file and others expect one, which can show up as stray characters in the first header.
  • Spreadsheet reinterpretation. Opening the result in a spreadsheet can change identifiers, ZIP codes, long numbers or date-like strings. If those values must stay exact, import them as text rather than opening the file directly.
  • Line endings and trailing blank lines. Different systems use different line-ending characters, and an extra blank line at the end can appear as an empty record in some tools.

Will the output stay readable and usable where you need it?

Both formats are plain text, so they survive copying and saving as long as nothing alters the delimiter characters. Tabs are the more fragile of the two in transit. Some text editors, chat applications, web forms and code-formatting tools convert tabs to spaces, and the result looks the same but is no longer valid TSV. Commas rarely change in transit, but CSV quoting can be damaged when someone edits the file by hand or when a tool converts straight quotes to curly ones.

Raw delimited text is not a table to people who read it. On screen, tab-separated columns only line up when values happen to be similar in width, and comma-separated rows become hard to scan as they grow. Assistive technology will generally present the raw file as a stream of text, not as rows and columns with headers. If the goal is for people to read the data, publish it as a real table in a document, spreadsheet or web page, and keep CSV or TSV for exchange between programs.

Before relying on a converted file, run a destination check with a small sample that includes difficult values: a comma, a double quote, a tab, a line break inside a field, a value with leading zeros, an empty field and a non-ASCII character. Import the sample into the actual destination and confirm that the column count, the values and the number of records match the source.

Converting with a web-based tool usually means sending the data to someone else's server. For files that contain personal, financial, health or confidential business information, use a local option instead, such as your spreadsheet application's export feature, a command-line tool or a script using a CSV library. If you must use an online converter, test it with sample data first and review how it handles uploaded content.

Limits of this comparison

The examples above are illustrative and were not produced by a particular converter. Specific applications differ in their defaults for delimiters, quoting, escaping, encoding and type detection, and this guide does not claim that any one product behaves a certain way. Confirm behavior with the documentation for your tools and with a test file in your own environment.