TSV MIME Type – Free, Online, Private
text/tab-separated-values is the IANA type for a tab-separated file. Tabs, not commas, separate fields.
What .tsv is
TSV is a text table whose field separator is the tab character, U+0009. Newlines separate records. Unlike CSV, a tab-separated file usually forbids a raw tab or newline inside a field, because there is no quoting convention everyone agrees on. IANA's type is text/tab-separated-values. People also send text/plain, which works as a download and loses the hint that a spreadsheet should split on tabs. There is no registered text/tsv short name. The extension is .tsv, and sometimes .tab.
IANA registers text/tab-separated-values. The media type is text/tab-separated-values. Extensions that use it on this page: .tsv. A client compares the type, not the filename, once the response has arrived. The filename still matters on disk and in Content-Disposition, which is why a wrong extension and a wrong header are two different bugs.
What sends text/tab-separated-values
What sends text/tab-separated-values: Send text/tab-separated-values; charset=utf-8. Include a filename ending in .tsv so a desktop tool picks a splitter. If you accept .tab as well, add it to the types line rather than inventing a second media type. A header row is still just the first record. Document whether you escape tabs. If a field can contain a tab, you need a rule, and the media type will not carry that rule. Prefer CSV with quoting, or JSON, when fields are free text. The file on disk is still .tsv. Once the response exists, a client trusts text/tab-separated-values, not the filename. Logs that look columnar are often spaces, not tabs. Serve those as text/plain. Reserve this type for files you can split with a single tab character and get the same number of fields on every row, or document the rows that are short.
Content-Type for .tsv
Send text/tab-separated-values; charset=utf-8. The charset parameter names the encoding of the body. Leaving it off forces the client to guess, and for several text types the registered default is not UTF-8. Do not send a charset on a redirect. The header belongs on the response that contains the bytes.
Content-TypeContent-Type: text/tab-separated-values; charset=utf-8
nginx, Apache, and Express
These snippets map .tsv to text/tab-separated-values. nginx reads the types block when it picks a type from the URL's extension. A location that sets default_type, or an application that sets the header itself, overrides that map. Apache AddType applies in the directory context where you put it. The Express static example writes the header for files ending in .tsv so a stale mime database in the framework cannot disagree with the type on this page.
nginx# /etc/nginx/mime.types, inside the types { } block
text/tab-separated-values tsv;
charset utf-8;
charset_types text/tab-separated-values;
ApacheAddType text/tab-separated-values .tsv
AddCharset UTF-8 .tsv
Expressimport express from "express";
const app = express();
app.use(express.static("public", {
setHeaders(res, filePath) {
if (filePath.endsWith(".tsv")) {
res.setHeader("Content-Type", "text/tab-separated-values; charset=utf-8");
}
},
}));
Pitfalls for text/tab-separated-values
Pitfalls that show up for text/tab-separated-values, and not for a neighboring type with a similar extension: Copying a TSV through a rich-text editor turns tabs into spaces. The type stays correct and the columns disappear. Another trap is a CSV parser pointed at a TSV URL because both are 'spreadsheet text'. Commas inside a field then become extra columns. A third is Excel's habit of turning a gene name or an identifier that looks like a date into a date. That is the application, not the header. Shipping the identifier as text in a real workbook type avoids it when the consumer is Excel. A fourth is UTF-16 TSV from a Windows export labeled with this type and charset=utf-8. The tabs are still there and the text is not UTF-8.
- text/tab-separated-values is the registered spelling. text/tsv is not.
- A file that uses two spaces instead of a tab is not TSV. Do not send this type for aligned ASCII.
- Mac classic files used CR alone. Send LF or CRLF and be consistent.
- The charset parameter matters for the same reason it matters on CSV. Send utf-8.
Frequently asked questions
What is the registered type?
text/tab-separated-values. text/tsv is not registered.
How is this different from text/csv?
The separator is a tab, and there is no shared quoting rule. CSV uses commas and has RFC 4180 quoting.
Should I send a charset?
Yes. charset=utf-8. The body is text.
Can a field contain a tab?
Not safely. If you need embedded tabs or newlines, use CSV or JSON instead of hoping the client agrees on an escape.