About TSV to CSV
Convert TSV (tab-separated values) to CSV (comma-separated) and back. Fields that contain the new delimiter are re-quoted. Useful when copying from a spreadsheet (which puts tabs between cells), pasting into a tool that expects commas, or vice versa.
Why this exists
Spreadsheets put tabs between cells when you copy. Most data tools want commas. The conversion is so common it deserves a dedicated tool — one paste, one click, done.
What the tool does
- Splits on the source delimiter (tab or comma)
- Handles RFC 4180 quoting on either side
- Re-quotes fields containing the new delimiter
- Preserves cell content byte-for-byte
- Auto-detects direction by sniffing the first line
Common workflows
Paste from Sheets into a CSV-only tool. Copy the cell range, paste into the input, hit convert. CSV out.
Round-trip via clipboard. Sheets → CSV import → edit → CSV → paste back into Sheets (Sheets handles the de-quoting).
Bridge between data tools. A Postgres client outputs TSV; your downstream tool wants CSV.
Pipe through a Markdown converter. TSV → CSV → CSV to Markdown → paste in docs.
How to convert TSV to CSV in code
The one-line shortcut tr '\t' ',' < in.tsv > out.csv works only when no field contains a comma. For safe, quote-aware conversion:
import pandas as pd
pd.read_csv("in.tsv", sep="\t").to_csv("out.csv", index=False) # pandas
csvformat -T in.tsv > out.csv # csvkit: TSV in, CSV out, quoting handled
Reverse (CSV → TSV) is pd.read_csv("in.csv").to_csv("out.tsv", sep="\t", index=False). The catch either way is quoting and embedded delimiters — the part this tool handles automatically while auto-detecting which direction you need.
Why a one-trick tool
Single-purpose, one-paste, no setup. The conversion is too common to deserve a CLI script and too simple to justify a full data tool. Open the page, do the swap, close the tab.
Frequently asked questions
Why is TSV more common than I'd expect?
How is re-quoting handled?
Are line endings preserved?
What if my TSV has no header?
Multi-line cells?
Dates and locales?
How do I convert TSV to CSV in Python or pandas?
pandas.read_csv("in.tsv", sep="\t").to_csv("out.csv", index=False). stdlib: read with csv.reader(f, delimiter="\t") and write with a comma csv.writer — this preserves RFC 4180 quoting for fields that contain commas. This tool does the same, plus auto-detects direction, without a Python install.How do I convert TSV to CSV in Bash or Excel?
tr '\t' ',' < in.tsv > out.csv — but this breaks if any field contains a comma, so prefer csvformat -T (csvkit) for safety. Excel: open the TSV, then Save As → CSV (Comma delimited); the tool here skips the round-trip and re-quotes comma-bearing fields automatically.Related tools
Last updated: 2026-07-04