TSV to CSV: Convert Tab-Separated Data for Universal Compatibility
TSV files use tab characters to separate columns — common in bioinformatics, database exports, and spreadsheet data. CSV is the more universally accepted format. This converter handles the key challenge: if a field contains a comma, it must be wrapped in double quotes in the CSV output. Paste your TSV and get RFC 4180-compliant CSV instantly.
RFC 4180 defines the standard: quoted fields use double-quote delimiters, embedded quotes are doubled.
TSV vs CSV: When to Use Each
TSV avoids the quoting complexity of CSV because commas in data don't need escaping. TSV works well when data never contains tabs. CSV is more universally supported — Excel, Google Sheets, database importers, and virtually every data tool accepts CSV. If you're moving data between systems that expect CSV, converting from TSV is a one-step fix.
RFC 4180 Quoting Rules
The CSV standard (RFC 4180) specifies: fields may be enclosed in double quotes; if fields are enclosed, a double quote appearing inside must be escaped by preceding it with another double quote. A field containing a comma, double quote, or line break must be enclosed. This converter applies these rules: any field from the TSV that contains a comma or quote gets double-quoted in the CSV output.
Common TSV Sources
TSV is frequently exported by: MySQL SELECT ... INTO OUTFILE, PostgreSQL COPY command, Excel and Google Sheets 'Save as TSV', bioinformatics tools (BLAST, BEDtools, VCF format rows), and many data warehouse export utilities. Most of these can also export CSV directly — but when you receive a TSV and need CSV, this converter handles the quoting correctly.
Practical Examples
Converting a Database Export to CSV
A database export from MySQL or PostgreSQL often defaults to tab-separated format.
- 1.Run your query with tab output: SELECT * FROM table INTO OUTFILE '/tmp/out.tsv' FIELDS TERMINATED BY '\t'
- 2.Open the TSV in a text editor and copy the content
- 3.Paste into the TSV input above
- 4.Copy the CSV output and import into your target tool
What This Converter Does
- Replaces tab separators with commas
- Wraps fields containing commas in double quotes
- Escapes embedded double quotes as ""
- Handles blank lines (preserved as-is)
- Processes files of any size in the browser
Frequently Asked Questions
What is TSV?
TSV (Tab-Separated Values) is a plain-text format where each row is a line and columns are separated by tab characters (\t). It is commonly exported by spreadsheets, databases, and bioinformatics tools. Like CSV, the first row is usually a header. Unlike CSV, no quoting standard is universally enforced, so tools handle embedded tabs and newlines differently.
Why convert TSV to CSV?
CSV is more widely supported than TSV. Most data processing tools, APIs, and import dialogs accept CSV but may not accept TSV. Converting to CSV makes your data compatible with Excel, Google Sheets, database importers, and virtually every data tool that accepts delimited text.
How are commas in fields handled?
If a TSV field contains a comma, the converter wraps it in double quotes when outputting CSV, per RFC 4180. For example, the value San Francisco, CA becomes "San Francisco, CA" in the CSV output. This ensures the comma is not interpreted as a column delimiter.
How are quotes in fields handled?
If a TSV field contains a double quote, the converter wraps the field in double quotes and escapes each embedded quote as two double quotes: "". This is the standard CSV escaping per RFC 4180. For example, say "hello" becomes "say ""hello""" in the output.