Written and maintained by CASRAI Editorial Board
Last updated
A TSV file is a plain-text table in which each record sits on its own line and the fields within a record are separated by tab characters. TSV stands for tab-separated values. The only formal specification is the IANA media type registration for text/tab-separated-values, which is short: it fixes the one-record-per-line layout and says that fields containing tabs cannot be represented. Everything else, including how to handle quotes and line breaks inside a field, is left to the software reading the file, and that is where most loading problems come from.
What the TSV format specifies
The IANA registration for text/tab-separated-values (checked 2026-10-29) states four things that matter in practice:
- Each record is represented as a single line.
- The first line holds the field names, and every record has the same number of fields.
- Fields that contain tabs are not allowable in this encoding.
- Character set and encoding type are required parameters of the media type.
The registration does not assign a file extension, so .tsv is a convention rather than something IANA defines. It also does not set out how a line break inside a field should be written. Two tools can therefore both claim to read “TSV” and still disagree on a file that has quotes or embedded line breaks. After writing a TSV from one program and reading it in another, compare the row count and a few of the longest text fields rather than assuming the round trip was lossless.
What it is used for in research
TSV is a common way to move tables between tools because any program that can read text can read it, and tab characters rarely occur inside short fields such as identifiers, counts and codes. Bioinformatics formats are an example: the data lines of a VCF are tab-separated, as explained in reading a VCF file. For how to lay out the table itself, see tidy data rules for structuring research data. Other plain-text interchange formats covered on CASRAI include the RIS reference format, BibTeX and the BED genomic interval format.
Install or access: nothing to install
A TSV file needs no special software. You can open it with the tools below, all of which have official documentation for the steps in the next section:
- Microsoft Excel (Data tab, From Text/CSV), documented by Microsoft Support.
- R, which reads it with
read.delimfrom the utils package, documented in the R manual. - Python, which reads it with
pandas.read_csvandsep="\t", documented in the pandas reference.
Step by step: open a TSV file in Excel, Python or R
Excel (Get & Transform)
- On the Data tab, in the Get & Transform Data group, choose From Text/CSV.
- Select the file and choose Import.
- In the preview window, check that Tab is selected as the delimiter. If it is not, choose Tab from the Delimiter list; the preview updates immediately so you can confirm the columns split correctly.
- Choose Load, Load to, or Transform Data if you need to clean the table first.
Python (pandas)
The default separator of pandas.read_csv is a comma, so for a TSV you must set it:
import pandas as pd
df = pd.read_csv("data.tsv", sep="\t")
By default header is inferred, which means the first line is used as column names when you do not pass names. If your file has no header line, pass header=None and supply names=[...] yourself. The default quoting mode is csv.QUOTE_MINIMAL with " as the quote character.
R
df <- read.delim("data.tsv")
According to the R manual, read.delim is called as read.delim(file, header = TRUE, sep = "\t", quote = "\"", ...), defaulting to the tab character as the delimiter. In this variant fill is TRUE and the comment character is disabled.
Save a TSV from Excel
- Choose File, then Save As.
- In Save as type, choose Text (Tab delimited).
- Choose Save.
Excel’s documentation describes the result as a text file; it does not say the file will carry a .tsv extension, so check the file name before you hand the file to a pipeline that expects one.
Output and how to read it
Once loaded, the first line of the file becomes the column names and every later line becomes one row. Because the format requires every record to have the same number of fields, a loaded table should be rectangular. Two quick checks catch most problems: the number of columns equals the number of names in the header line, and the number of rows equals the number of lines minus one. If you see a single wide column containing the whole line, the tool did not split on tabs; if you see one column too many in the data, a field probably contained a tab or a stray quote.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Everything lands in one column (pandas) | read_csv splits on commas unless told otherwise |
Pass sep="\t" |
| First data row is treated as column names, or column names are missing | Header inference does not match the file | Use header=None with names=[...] if there is no header line |
| Rows have different numbers of fields (R) | Ragged lines, often from a field containing a tab | read.delim uses fill = TRUE, so short rows are padded with blank fields; inspect the rows with blanks at the end |
| Rows are merged or the row count is too low | A stray double quote opens a quoted field that swallows following lines | In R pass quote = "" to disable quoting; in pandas pass quoting=csv.QUOTE_NONE after import csv |
| Excel’s saved file is not named .tsv | Excel’s Text (Tab delimited) option produces a text file | Check the extension your downstream tool expects |
| Other sheets are missing from the saved file | Excel saves only the active worksheet in this format | Save each sheet in turn |
Alternatives to Excel for opening a TSV file
| Tool | How | Documentation |
|---|---|---|
| R | read.delim("data.tsv") (header, tab separator, fill on by default) |
R manual, utils: read.table |
| Python with pandas | pd.read_csv("data.tsv", sep="\t") |
pandas reference, read_csv |
| A plain-text editor | Opens the raw lines, so you can check the header line and look for stray quotes before loading | IANA text/tab-separated-values registration |
FAQ
What is the difference between a TSV and a CSV file?
The delimiter. A CSV separates fields with commas and a TSV with tabs. In pandas the default separator is a comma, so a TSV needs sep="\t", whereas R’s read.delim already defaults to tab.
Can a TSV field contain a tab?
Not under the IANA registration, which says fields that contain tabs are not allowable in this encoding. Some programs write quotes or escape sequences to get around this, but that is a convention of the individual program, so test it before relying on it.
Is .tsv defined by a standard?
The IANA registration defines the media type text/tab-separated-values but does not name a file extension. The .tsv extension is a widespread convention.
Why does Excel save my table as a .txt file?
Excel’s Save As option is called Text (Tab delimited), and Microsoft’s documentation describes it as saving a text file. Rename or export it under the name your downstream tool expects.
Sources (official documentation)
- IANA, Media type registration: text/tab-separated-values, checked 2026-10-29.
- pandas, pandas.read_csv (version 3.1.0), checked 2026-10-29.
- R Core Team, utils: Data Input (read.table, read.delim), checked 2026-10-29.
- Microsoft Support, Import or export text (.txt or .csv) files, checked 2026-10-29.








