TSV and CSV: what really differs
Both formats are rows of text split into columns. The one visible difference is the character between columns: a tab in TSV and a comma in CSV. The practical difference is quoting.
- CSV needs quotes often. Commas are common in names, addresses and sentences, so a CSV value that holds a comma is wrapped in double quotes, and quote marks inside it are doubled.
- TSV rarely needs quotes. A tab hardly ever appears in text, so most TSV files have no quoting at all. The simplest TSV cannot hold a tab or a line break inside a value. Some programs allow it by quoting the cell the way CSV does, others use backslash codes.
- Spreadsheets speak TSV. Cells copied from Excel or Google Sheets reach the clipboard as tab separated text. That is why pasting a selection into a text box here just works.
Going from TSV to CSV, the converter reads the TSV, then writes each value again for CSV, adding quotes wherever a comma, a quote, a line break or a space at the edge would otherwise break the file.
What happens to quotes, tabs and backslashes
The converter reads quotes the CSV way. A cell wrapped in double quotes may contain tabs and line breaks, and two quote marks in a row stand for one. A quote mark in the middle of an unquoted cell, as in 5" pipe, is kept as it is.
Backslash codes are not decoded. Database exports such as PostgreSQL's COPY text format and MySQL's default output write a tab inside a value as \t, a line break as \n and an empty value as \N. Here those stay as the characters you see, so \N is not turned into an empty cell. Replace them first if your data uses them.
Rows that are shorter than the header are filled with empty cells. A row with extra values gets extra columns called column4, column5 and so on, and a repeated header such as name, name becomes name and name_2. A note under the result lists every repair.
Choosing the CSV delimiter and encoding
A comma is the standard CSV delimiter, and every tool understands it. Excel is the exception: it uses the list separator of your regional settings, which is a semicolon in many European countries, so a comma CSV can land in a single column there. Choose Semicolon under Delimiter in the output for those files. A pipe is a good choice when your text holds many commas and semicolons.
The CSV is written as UTF-8. Excel for Windows often reads a CSV as Windows-1252 unless the file starts with a byte order mark, so turn on Add a byte order mark under More options if accents look wrong in Excel. Some programs dislike the mark, so leave it off for those. Input files in UTF-8, UTF-16 or Windows-1252 are read correctly.