TSV to CSV Converter
Convert TSV to CSV and CSV to TSV. Paste cells copied from a spreadsheet and get CSV, or the other way around. Commas, tabs, quotes, and line breaks inside cells are kept intact. Runs in your browser.
Input
Output
Readme
What are TSV and CSV?
TSV (Tab-Separated Values) and CSV (Comma-Separated Values) are plain-text formats for tables. Each line is a row, and the cells in a row are separated by a tab in TSV and by a comma in CSV. Both formats are read by Excel, Google Sheets, LibreOffice, databases, and almost every data tool, but many programs accept only one of them.
Cells that contain the separator, a quote, or a line break are wrapped in double quotes, and a quote inside such a cell is written twice (""). This is how spreadsheets write both formats, including when you copy cells to the clipboard.
Tool description
This tool converts tables between TSV and CSV in your browser. Paste cells copied from a spreadsheet to get CSV, or paste CSV to get TSV you can paste back into a spreadsheet. Commas, quotes, and multi-line cells are handled correctly in both directions, so no cell is split or merged by mistake.
Features
- Converts TSV to CSV and CSV to TSV, with a swap button to switch direction
- Keeps commas, tabs, quotes, and line breaks inside cells intact
- Shows tabs as arrows, so you can see the columns
- Points to the line of a quote that is never closed
How it works
The input is read cell by cell. A cell that starts with a double quote continues until the matching closing quote, so it can hold separators and line breaks, and two quotes in a row stand for one quote. The cells are then joined with the other separator, and a cell is quoted only when it contains that separator, a quote, or a line break. Blank lines are skipped, and a byte order mark at the start of the file is ignored.
Tips
- Select cells in Excel or Google Sheets and copy them: the clipboard holds TSV, ready to paste here.
- Paste the TSV result straight into a spreadsheet to fill the cells.
- If every row of your CSV ends up in a single column, the file probably uses semicolons instead of commas.