OnlineTextLab
Esc

TSV to CSV Converter

Tab-separated text in, standards-compliant CSV out, with commas quoted and a choice for how to treat quote characters.

CSV output

Your CSV appears here as you type.

Nothing to paste yet? Use Try an example to see it work.

Options
Delimiter in the output

Runs on your device. Your files and text are not uploaded.

About TSV to CSV

Tab-separated text shows up everywhere: copying cells from a spreadsheet, running a database client in batch mode, downloading a bioinformatics dataset. Many importers and web forms still insist on CSV, and swapping tabs for commas by hand breaks as soon as a value contains a comma.

This tool puts quotes around the cells that need them and doubles any quotes inside, following RFC 4180. Paste the text, and you have a file that an importer will accept.

A table shows the rows as read, and the download keeps your original file name with a .csv extension.

How it works

Only tabs split cells here, and there is no delimiter guessing, so commas and semicolons in your text can never be mistaken for columns. By default a cell that starts with a double quote is treated as quoted, the way Excel writes TSV. Line breaks inside such a cell stay in the value.

Plain TSV from a database or a Unix tool has no quoting, and a stray quote at the start of a cell would then run on through later rows. Parsing stops with an error at that spot, and turning on Treat double quotes as ordinary text reads every line as exactly one row, with quotes kept as characters.

Writing the CSV, a cell gets quotes only if it contains the delimiter, a quote or a line break.

How to use TSV to CSV

  1. Copy cells from a spreadsheet and paste them in, or open a .tsv file.
  2. If an error mentions a quoted cell, turn on Treat double quotes as ordinary text under Options.
  3. Choose a comma or semicolon for Delimiter in the output.
  4. Save it using Copy or Download .csv.

A comma in a cell gets quoted

Input
name	title	city
Ada Lovelace	Mathematician, writer	London
Grace Hopper	Computer scientist	Arlington
Output
name,title,city
Ada Lovelace,"Mathematician, writer",London
Grace Hopper,Computer scientist,Arlington

Only Mathematician, writer needed quotes, because it is the only cell containing the output delimiter.

When it helps

  • Saving cells copied from Excel or Google Sheets as a CSV file, with no need to save the whole sheet.
  • Turning mysql --batch or psql tab-separated output into something an importer accepts.
  • Converting a .tsv dataset for a tool that only loads CSV.
  • Preparing a contact or product list for a web form that demands a .csv upload.

Tips for a better result

  • Add the byte order mark from Options if the CSV will be opened by double-clicking in an older Excel. It tells Excel the file is UTF-8.
  • For Excel in locales with a decimal comma, a semicolon output delimiter usually opens into columns correctly.
  • Check the header row in the table. A line without tabs at the top, such as a report title, becomes the header and pushes the columns off.

Good to know

  • Cells are never trimmed, so stray spaces around values remain. Headers are the exception, as spaces around them are removed.
  • Rows of uneven length are padded with empty cells, and a notice reports the first line where this happened.
  • Numbers and dates are copied as text, with no reformatting.
  • Excel may still reformat long numbers when opening the CSV, which is a display choice made by Excel.

Questions people ask

Why am I getting an error about a quoted cell?

A cell begins with a double quote that is never closed, usually because your source does not use quoting at all. Turn on Treat double quotes as ordinary text and each line will be read as one row.

Can I paste directly from a spreadsheet?

Yes. Spreadsheets copy cells as tab-separated text, and they quote any cell with a line break inside, which this tool reads correctly with the default settings.

What is the difference between TSV and CSV?

Only the separator and how they cope with it. TSV uses tabs, which rarely appear in data, so it often needs no quoting. CSV uses commas, which are common, so RFC 4180 defines how to quote them.

Is a last empty column kept?

Yes. A trailing tab means an empty last cell, and it stays in the output. That column gets a name such as column_3 if the header has nothing there.

What to use next

Last reviewed . Read our editorial policy.