.tsv

What is a .tsv file?

Tab-Separated Values · Data · IANA-registered convention · 1993

TSV stores a table as plain text with columns separated by tab characters and rows by newlines. It is a close cousin of CSV that avoids the comma-quoting problems that trip CSV up.

Category
Data
Type
Plain text
Is a .tsv file safe to open? Safe. TSV is plain-text data. As with CSV, be cautious opening untrusted files in a spreadsheet, which may interpret leading = as a formula.

What is a .tsv file used for?

Because tabs rarely appear inside data values, TSV often needs no quoting or escaping, which makes it simpler and more predictable than CSV for text that contains commas. Spreadsheets and databases import and export it directly.

It is common in bioinformatics and data science, and is the default clipboard format when you copy cells from a spreadsheet, which is why pasting into a text editor gives you tab-separated columns.

How to open a .tsv file

The .tsv format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list. For a step-by-step walkthrough, see how to open a .tsv file.

Windows

  • Excel
  • VS Code
  • any text editor

macOS

  • Numbers
  • Excel
  • any text editor

Linux

  • LibreOffice Calc
  • VS Code
  • column -t

How to convert a .tsv file

You can convert a .tsv file to CSV, JSON, XLSX using a conversion tool or the export menu of an app that opens it.

.tsv file signature (magic bytes)

Programs recognise a .tsv file by the bytes at the start of the file, not by its name. These are the signatures for TSV.

Hex signatureOffsetNote
(no fixed signature)0plain text; no fixed magic bytes

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .tsv file?

TSV stores a table as plain text with columns separated by tab characters and rows by newlines. It is a close cousin of CSV that avoids the comma-quoting problems that trip CSV up.

What is the difference between TSV and CSV?

TSV separates columns with tabs, CSV with commas. Tabs seldom appear in values, so TSV usually needs no quoting, making it simpler for messy text.

How do I open a TSV file?

Open it in Excel, Numbers or LibreOffice Calc, which lay it out as a table, or view the raw tabs in any text editor.

Why did my TSV columns misalign?

Usually a value contains a stray tab or a newline, or the file mixes tabs and spaces. Viewing it in a monospaced editor with visible whitespace reveals the culprit.

Comparisons

Related formats

Sources

Details on this page were checked against authoritative references: