Introduction
TSV is a plain text table like CSV, but with a tab character between fields instead of a comma. Because tabs rarely appear in ordinary text, most TSV files need no quoting at all, which makes them simple to write and to split with command-line tools.
It is common in science, especially in bioinformatics, and is what spreadsheets put
on the clipboard when cells are copied. Some programs save the same format with a
.tab or .txt extension.
Structure
A TSV file has no header bytes or magic number. Each record is one line, and the fields
in it are separated by a single tab (byte 09). The first line usually names
the columns. The IANA registration of the text/tab-separated-values type
says every line has the same number of fields and that a field may not contain a tab or
a line break.
Real files do not always follow that. Some programs quote fields that contain tabs, as
CSV does, and others write escapes such as \t and \n
instead, so a reader has to know which convention the writer used.
Links
Software
- Microsoft Excel (Windows, macOS, web)
- LibreOffice Calc (Windows, macOS, Linux)
- Google Sheets (web)
- Visual Studio Code (Windows, macOS, Linux)
Developers
Reference
- text/tab-separated-values, the IANA media type registration