Skip to main content
v2026.11,858 entries · CC-BY 4.0

What Is a TSV File? Format, Rules, and How to Open It in Excel, R and Python

A TSV file is a plain-text table with one record per line and tab-separated fields. Learn its rules and how to open it in Excel, R and Python.

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.delim from the utils package, documented in the R manual.
  • Python, which reads it with pandas.read_csv and sep="\t", documented in the pandas reference.

Step by step: open a TSV file in Excel, Python or R

Excel (Get & Transform)

  1. On the Data tab, in the Get & Transform Data group, choose From Text/CSV.
  2. Select the file and choose Import.
  3. 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.
  4. 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

  1. Choose File, then Save As.
  2. In Save as type, choose Text (Tab delimited).
  3. 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)

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about What Is a TSV File? Format, Rules, and How to Open It in Excel, R and Python

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Ask CASRAI · Regulatory Radar

Research-admin question? Get an answer that links its sources.

An AI assistant specialized in research administration. Every answer links its sources to check before you act. 2 questions free, no account. $29/month after.

  • Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.
  • Every answer numbers its sources and links each one, so you can check the source yourself.