CSV to TSV Converter

A CSV to TSV converter swaps commas for tabs, which sounds like a one-liner and has exactly one hard case: a tab or a newline inside a cell, which the TSV registration forbids and provides no way to escape. This one makes that a choice you can see rather than a silent corruption, and tells you how many cells it affected. Nothing is uploaded.

Need to clean the cells before converting? Open the app

TSV is not CSV with a different separator

The IANA registration for text/tab-separated-values describes a much simpler format than CSV, and the simplification is the point. Fields are separated by a single tab. Records are separated by a newline. A field may not contain a tab or a newline, and there is no quoting mechanism defined at all.

That is why so much bioinformatics, log processing and Unix tooling uses TSV: a parser can be split('\t') and nothing more. No quote state machine, no escaped-quote handling, no ambiguity about what a doubled quote means. cut, awk and a hundred small scripts work on it correctly without anybody thinking about it.

It also means there is genuinely no correct way to write a cell containing a tab. Not a hard problem with a clever answer: an actual gap in the format.

Real tools disagree about what to do. Excel and most spreadsheet importers accept RFC 4180 style quoting in a .tsv, because they reuse their CSV parser. A strict split-on-tab reader does not, and the quote characters end up inside your values.

So this converter asks. Replace the tab with a space, which produces a file every TSV reader on earth handles and loses one character of formatting. Or quote the cell, which keeps the exact bytes and produces a file some readers will misparse. Whichever you pick, the count of affected cells is reported, so a file with no tabs in it never raises the question at all.

A worked example

A CSV with a comma inside a quoted value, which is the ordinary case:

sku,name,price
00412,"Bracket, aluminium 40mm",4.25
01730,Bronze bushing 17mm,2.15

becomes, with real tabs between the fields:

sku	name	price
00412	Bracket, aluminium 40mm	4.25
01730	Bronze bushing 17mm	2.15

The quotes are gone, because they were only ever there to protect the comma and a comma is no longer a delimiter. That is the everyday benefit of TSV and the reason people reach for it: product names, addresses and free-text notes are full of commas and almost never contain tabs, so the quoting disappears and the file becomes readable in a terminal.

The SKU keeps its leading zeros, because nothing here converts a value to a number and back. Whether it survives your spreadsheet is a separate matter: Excel will still convert 00412 to 412 on import unless you mark that column as text in the import wizard. That is a property of Excel rather than of the file, and it happens to a CSV just the same.

Why TSV rather than CSV

Two practical reasons come up again and again.

Locale. A comma is the decimal separator in most of Europe, so spreadsheets in those locales use a semicolon as the field delimiter and open a comma-separated file as a single column. A tab has no such conflict, so a .tsv opens correctly regardless of where the recipient is. If you have ever sent a CSV to a colleague in Germany and been told it arrived in one column, this is why.

Readability. Data full of commas produces a CSV full of quotes, which is hard to read in a terminal and awkward to process with line-oriented tools. The same data as TSV usually has no quoting at all.

The input side is flexible: the source delimiter is detected from the text, so a semicolon-separated European export or a pipe-delimited feed converts just as well as a comma one, and you can pin it when the detection is wrong.

Windows line endings are available and off by default. Almost everything reads Unix endings now, but a legacy consumer that expects carriage return plus line feed will mis-parse a bare newline. The setting affects the row separator only and never the contents of a cell.

If you want a delimiter that is neither a comma nor a tab, a pipe, a semicolon or something of your own, the delimited converter takes any separator and quotes against it correctly.

Questions

What happens to a tab inside a cell?

It is replaced with a space by default, and the count is reported. The IANA registration for text/tab-separated-values says a field may not contain a tab or a newline at all and defines no quoting mechanism, so there is no strictly correct way to keep one. The alternative on offer is RFC 4180 style quoting, which Excel and most spreadsheet importers read correctly and a strict TSV reader may not.

Why not just quote everything like a CSV?

Because TSV has no quoting in its specification. The registration describes a much simpler format than CSV precisely so that a parser can be split-on-tab and nothing more, which is why so much bioinformatics and log tooling uses it. Adding quotes produces a file that Excel opens correctly and a split-on-tab reader misreads, with the quote characters becoming part of the value.

Will Excel open the result?

Yes. Excel associates .tsv and .txt with its import path and handles tab separation directly, without the locale trouble that makes a comma-separated file open in one column in some regions. That is one of the better reasons to send somebody a TSV rather than a CSV.

Does the input delimiter need to be a comma?

No. The source delimiter is detected from the text, so a semicolon-separated European export or a pipe-delimited file converts just as well. You can pin it explicitly when the detection gets it wrong, which happens on files where a comma appears more often inside quoted values than between them.

What about Windows line endings?

Off by default, since Unix endings are what almost everything reads now. Turn them on when the file is going to a legacy Windows consumer that expects carriage return plus line feed and mis-parses a bare newline. The setting affects the row separator only, never the contents of a cell.

Are leading zeros preserved?

Yes. Nothing here converts a value to a number and back, so a product code of 00412 stays 00412 in the file. Whether it survives your spreadsheet is a different question: Excel will still convert it on import unless you set that column to text in the import wizard, which is a property of Excel rather than of the file.

Is anything uploaded?

No. The conversion runs in your browser tab with nothing sent to a server, nothing kept between visits and no row cap. Reopen the page offline and it still works.

Convert your CSV to TSV

No sign-up, no upload, no row cap. The one hard case made a visible choice, with a count of what changed.

Back to the converter