Browser-native file tools

Convert TSV to CSV

Drop a tab-delimited file below — get a clean, RFC 4180 comma-delimited CSV with embedded commas properly quoted.

Tab-delimited → comma-delimited

How to convert TSV to CSV

Drop a .tsv (or .txt) file into the converter at the top, or paste tab-separated text into the input box. The tool detects tab delimiters, re-emits the data with commas, and quotes any field that contains a comma, double quote, or newline. Click Download CSV for a file or Copy to send it to your clipboard. Files never leave your browser — the conversion runs in JavaScript via PapaParse.

What’s the difference between TSV and CSV?

Both are plain-text tabular formats. The only difference is the separator between fields:

  • CSV (Comma-Separated Values) — fields separated by commas. To represent a comma inside a field, you wrap the field in double quotes. RFC 4180.
  • TSV (Tab-Separated Values) — fields separated by tab characters (\t). Strict TSV doesn’t allow tabs, newlines, or quotes inside fields at all — there’s no escaping mechanism.

TSV is simpler because tab characters almost never appear in real-world data. CSV is more universal because every spreadsheet, database, and API understands it.

TSV to CSV examples

Same data, both formats.

Input — TSV:

name	role	city
Ada Lovelace	Mathematician	London
Linus Torvalds	Engineer	Helsinki
Smith, John	Developer	New York

Output — CSV:

name,role,city
Ada Lovelace,Mathematician,London
Linus Torvalds,Engineer,Helsinki
"Smith, John",Developer,New York

Notice the last row: Smith, John has a comma inside the field, so it gets wrapped in double quotes. That’s RFC 4180.

How to convert TSV to CSV in Excel / Python / awk / sed

Excel

  1. Rename your file to .txt if it’s .tsv (Excel ignores the .tsv extension on double-click).
  2. File → Open → select the file. The Text Import Wizard appears.
  3. Choose Delimited → Next → tick Tab → Finish.
  4. File → Save As → CSV UTF-8 (Comma delimited) (*.csv).

On non-US locales, avoid plain “CSV” — it saves with semicolons.

Python (one-liner)

import csv
with open("in.tsv") as i, open("out.csv", "w", newline="") as o:
    csv.writer(o).writerows(csv.reader(i, delimiter="\t"))

csv.writer handles quoting automatically — fields with commas get wrapped, embedded quotes get doubled.

awk (fastest for huge files)

awk -F'\t' 'BEGIN{OFS=","} {$1=$1; print}' in.tsv > out.csv

The $1=$1 trick forces awk to rebuild each record using OFS. Caveat: this naive version doesn’t quote fields that contain commas. Use it only when you’ve confirmed your data has no commas.

For RFC-correct quoting in pure awk:

awk -F'\t' 'BEGIN{OFS=","} {
  for (i=1; i<=NF; i++) if ($i ~ /[",\n]/) { gsub(/"/,"\"\"",$i); $i="\"" $i "\"" }
  print
}' in.tsv > out.csv

sed (only if data has no commas or quotes)

sed 's/\t/,/g' in.tsv > out.csv

This is dumb replacement — it will corrupt any row where a field already contains a comma. Use awk or this tool for anything serious.

Common pitfalls

Commas already in fields. A naive tr '\t' ',' or sed 's/\t/,/g' will silently corrupt rows where the field text contains commas. The output looks valid but has the wrong number of columns. Always quote-aware-convert (this tool, Python’s csv module, or the second awk above).

Embedded quotes. If your TSV cell contains a ", RFC 4180 says you double it: She said "hi" becomes "She said ""hi""". Strict TSV doesn’t allow quotes at all, but real-world TSV exports often contain them. PapaParse and Python’s csv module handle this automatically.

Encoding mismatches. TSV files from Linux servers are usually UTF-8; old Excel exports may be Windows-1252 or UTF-16 with a BOM. If accented characters render as café, open the file in VS Code, change encoding to UTF-8, save, and re-convert.

Line endings. Mac (legacy) \r, Unix \n, Windows \r\n. PapaParse handles all three. Hand-rolled awk/sed pipelines on Windows files can produce hybrid line endings — pipe through dos2unix first if you’re on Linux.

Trailing tabs. A trailing tab on each line creates a phantom empty column. awk -F'\t' '{print NF}' file.tsv | sort -u tells you if every row has the same column count.

When TSV is actually better than CSV

Stick with TSV when:

  • Your fields contain commas. Addresses, prices in EU format (1,99 €), product descriptions. TSV needs zero quoting; CSV needs quotes everywhere.
  • You’re piping between Unix tools. cut, awk -F'\t', sort -t$'\t', join -t$'\t' — they all handle tabs more cleanly than commas with embedded quoting.
  • You’re exporting from a database for engineers. Postgres \copy ... TO ... DELIMITER E'\t' and MySQL INTO OUTFILE with FIELDS TERMINATED BY '\t' produce TSV that’s trivially parseable by every shell tool.
  • The downstream consumer is human eyeballs in a terminal. TSV aligns visibly when piped to column -t -s$'\t'.

Convert to CSV only when the next consumer demands it — Excel on a US locale, a SaaS importer, an old script that only knows commas.

Privacy: nothing is uploaded

The converter runs entirely in your browser. PapaParse parses the TSV, generates the CSV, and the result lives only in your tab’s memory until you download or close it. Open DevTools → Network and convert a file — you’ll see zero outbound requests. That matters when your data has customer names, internal IDs, or anything you’d rather not hand to a third-party server.

  • CSV Comma Delimited — convert between comma, semicolon, tab, and pipe delimiters in any direction.
  • CSV Viewer — preview a CSV (or the converted output) in a sortable table without opening Excel.
  • CSV to Excel — turn the CSV from this tool into a real .xlsx file with proper types.

Related tools

Frequently asked questions

  • When should I use TSV instead of CSV?

    Use TSV when your data contains lots of commas — addresses, free-text descriptions, European decimal numbers (1,99). Tabs almost never appear in real data, so you avoid quoting and escaping headaches entirely.

  • What happens to commas inside fields when I convert TSV to CSV?

    They're preserved. The converter wraps any field containing a comma, double quote, or newline in double quotes — that's the RFC 4180 rule. So a TSV cell like `Smith, John` becomes `"Smith, John"` in the CSV output.

  • What if my TSV has tab characters inside a field?

    Real TSV doesn't allow literal tabs inside fields — there's no quoting in the strict TSV spec. If your file has tabs that aren't column separators, it's malformed; clean it before converting, or the columns will be misaligned.

  • How do I open a TSV file in Excel?

    Rename it to .txt, then File → Open → pick the file → Excel runs the import wizard and lets you choose Tab as the delimiter. Or convert it to CSV with this tool first — Excel opens .csv files directly without the wizard.

  • Will this tool handle large TSV files?

    Yes, up to a few hundred MB depending on your browser's available memory. Everything runs locally with PapaParse — no upload, no server timeout. For multi-gigabyte files, use the awk one-liner from the article below instead.

  • What about encoding — UTF-8 vs Latin-1?

    The browser reads files using the encoding declared in the file or assumes UTF-8. If accented characters look wrong (`café` → `café`), open the file in VS Code, set encoding to UTF-8, save, then re-upload.

  • When should I NOT convert TSV to CSV?

    If your data has lots of commas in fields and you control both producer and consumer, stick with TSV — it's cleaner. Only convert when the downstream tool (Excel on a US locale, an old import script, an API) specifically demands CSV.

  • Is my file uploaded anywhere?

    No. The conversion runs entirely in your browser using PapaParse. Open DevTools → Network and confirm — no requests are made when you convert.