Skip to content

text/tab-separated-values MIME Type — Meaning, Usage & Examples

text/tab-separated-values
Extensions: .tsv Class: text Spec: IANA (IANA registered)
View IANA registration ↗

text/tab-separated-values means: text/tab-separated-values is the registered media type for TSV, a tabular plain-text format where fields are separated by tab characters instead of commas. Because tabs rarely appear inside data, TSV often needs less quoting than CSV and is convenient for command-line and scientific data. Text media types carry human-readable character data. Because they are text, the charset parameter matters: without an explicit charset=utf-8, receivers may guess a legacy encoding and mangle non-ASCII characters. Text types are also the ones browsers render or display inline, so the subtype decides whether content is treated as markup, code, or plain prose. You will encounter text/tab-separated-values in contexts such as unix command-line pipelines using cut, awk and sort on columns; scientific and bioinformatics data tables exported from analysis tools; database bulk loads where tab delimiters avoid comma-quoting complexity. It is commonly associated with the file extension(s) .tsv. TSV has no formal RFC; the IANA registration defines the convention. Literal tabs and newlines inside fields are problematic because they are the delimiters — escape or avoid them, and agree on whether a header row is present.

Advertisement
Ad slot · ref-top

When you'll see text/tab-separated-values

  • Unix command-line pipelines using cut, awk and sort on columns
  • Scientific and bioinformatics data tables exported from analysis tools
  • Database bulk loads where tab delimiters avoid comma-quoting complexity

How to handle it

When serving a text type, always declare charset=utf-8 unless the specification fixes another encoding, and escape or sanitize content according to how it will be rendered. Treat text/html as executable: never inject untrusted strings into it without encoding. For text/plain and text/csv, preserve line endings and quoting rules so downstream parsers do not split fields incorrectly, and set Content-Disposition when you want a download instead of inline display. As a final checklist for text types: declare charset=utf-8 everywhere, normalize line endings for cross-platform consumers, escape output for the rendering context to prevent injection, and set Content-Disposition deliberately so browsers either display inline or download rather than guessing.

Notes & gotchas

TSV has no formal RFC; the IANA registration defines the convention. Literal tabs and newlines inside fields are problematic because they are the delimiters — escape or avoid them, and agree on whether a header row is present.

Examples

HTTP
HTTP/1.1 200 OK
Content-Type: text/tab-separated-values; charset=utf-8
Content-Length: 88

Sample text/tab-separated-values content delivered with the correct Content-Type header.
curl
curl -i -H "Accept: text/tab-separated-values" https://api.example.com/v1/resource   # inspect the returned Content-Type
JavaScript (fetch)
const res = await fetch("/data.csv", { headers: { Accept: "text/tab-separated-values" } });
const text = await res.text();
const rows = text.trim().split("\n").map(line => line.split(","));  // use a real CSV parser for quoted fields
Python (requests)
import requests

res = requests.get("https://api.example.com/v1/resource",
                   headers={"Accept": "text/tab-separated-values"}, timeout=10)
res.raise_for_status()
# confirm the server declared the expected type
assert res.headers["Content-Type"].startswith("text/tab-separated-values")
text = res.text   # decode/handle according to the type

Frequently asked questions

When should I choose TSV over CSV?

When your data rarely contains tabs but frequently contains commas, TSV avoids most quoting. It is also easier to process with simple Unix tools that split on whitespace.

Does TSV support quoted fields?

Not in a standardized way like CSV. Most TSV conventions forbid embedded tabs/newlines rather than quoting them, so clean or escape such values before export.

Do I need to specify charset for text types?

Yes — append ; charset=utf-8 unless the type defines its own encoding rules. Without it, receivers may fall back to a legacy encoding and corrupt non-ASCII characters. UTF-8 is the safe default for the modern web.

What is the difference between text/plain and text/html?

text/plain is displayed verbatim with no markup interpretation; text/html is parsed as a document, executing styles and scripts. Serving user content as text/html when you meant plain text is a cross-site scripting risk.

Why do my non-ASCII characters appear corrupted?

The receiver guessed the wrong encoding because no charset was declared. Send charset=utf-8 in the Content-Type, ensure the bytes are actually UTF-8, and for HTML add a matching meta charset tag.

Advertisement
Ad slot · ref-in-article

Try the CSV to JSON

Parse CSV into typed JSON with header and delimiter detection.

Open tool →