Convert a TSV file to CSV when your export writes tabs and the next tool wants commas. FindUtils TSV to CSV reads tab-separated text in your browser and writes CSV that quotes each cell only when the cell needs it. The same page converts CSV back to TSV. The tool does not upload or store the file.

This guide explains where tab-separated files come from, why a find-and-replace of tabs breaks a file, which cells the tool quotes, what the uneven-rows warning means, and how the reverse direction writes tabs.

Why Convert TSV to CSV?

A database client and a spreadsheet both write tabs. Most upload forms and importers ask for commas. A tab is also invisible in a text editor, so a comma file is easier to check by eye.

  • Upload forms: a portal accepts a .csv file only.
  • Importers: a CRM, a billing system or an ad platform reads CSV.
  • Round trip: the reverse direction rebuilds a tab file for a paste into a grid.

Where TSV Comes From

SourceWhat it writes
psqlTab-separated text. \copy (select ...) to 'report.tsv' uses the text format, and that format separates fields with a tab.
mysql --batch (mysql -B)Tab-separated rows. It writes a tab or a line break inside a value as the two characters \t or \n.
ExcelThe Text (Tab delimited) (*.txt) entry in the Save As list.
Google SheetsThe Tab-separated values (.tsv) entry in the Download menu.
A spreadsheet gridA copied block of cells arrives on the clipboard as tab-separated text.

How to Convert TSV to CSV Online

Step 1: Load the Text

Open FindUtils TSV to CSV. Paste the text, upload the file, or drop the file on the page. The conversion runs as soon as the text arrives.

Step 2: Check the Direction

The page guesses the direction until you pick one. A dropped file with a .tsv name selects TSV to CSV. Without a file name, the page reads the first line: a line that splits into more fields on tabs than on commas is TSV. Set the toggle yourself when the guess is wrong. The address /convert/csv-to-tsv/ opens the same page.

Step 3: Choose the Output Delimiter

The comma is the default. Choose the semicolon for Excel in a locale that uses a comma as the decimal separator.

Step 4: Read the Status Line, Then Download

The tool reports the number of data rows, the number of columns in the header, and the number of rows whose column count differs from the header. Turn on Excel BOM before you download when the file opens in Excel on Windows: the toggle adds a UTF-8 byte order mark to the downloaded file, and the text on screen does not change. The download keeps the name of the loaded file with the new extension, such as orders.csv, or uses converted.csv when you pasted the text.

Why a Find-and-Replace Breaks the File

A search for a tab and a replace with a comma adds no quotes, so it corrupts three kinds of value. The converter reads the fields first and writes them again; it never edits the text in place.

  1. A value with a comma. Cable, 2 m becomes two fields, and every column after it shifts by one.
  2. A value with a double quote. The quote is not doubled, so two readers disagree about where the field ends.
  3. A value with a line break. The row splits into two rows, and the second row has too few columns.

The Quoting Rule

The tool follows RFC 4180 in both directions. A cell is quoted only when it holds the output delimiter, a double quote, or a line break. Every other cell is written bare. A double quote inside a quoted cell is written twice, and a line break inside a value is written as one line feed.

Reading follows the same rule with one clarification. A quote opens a quoted field only at the start of a field, so a bare value such as 5" pipe keeps the quote as a literal character and the next field stays separate. A field that Excel wrapped in quotes because it holds a tab, a quote or a line break is read as one field. A leading byte order mark is dropped, CRLF line endings are accepted, and blank lines are skipped.

Values stay text. 00123 keeps its leading zeros, 03/04/2026 stays as written, and no value becomes a number or a date. A spreadsheet can still reformat a column when it opens the file, so use the import dialog and set the column type to Text when the values must not change.

A Worked Example

Each below is one tab character in the real file.

1
2
3
4
5
id→product→note
00123→Cable, 2 m→bulk pack
00124→5" pipe→measured on site
00125→Bracket→"two lines
here"

The header and three rows produce this CSV:

1
2
3
4
5
id,product,note
00123,"Cable, 2 m",bulk pack
00124,"5"" pipe",measured on site
00125,Bracket,"two lines
here"

Cable, 2 m holds the comma, so it is quoted. 5" pipe holds a double quote, so it is quoted and the inner quote is doubled. The last note holds a line break, so it is quoted and stays one cell. 00123 is untouched text. The status line reports 3 rows, 3 columns and 0 uneven rows.

The CSV to TSV Direction

Set the toggle to CSV to TSV. The input delimiter is Auto by default, and the page detects it from the first line that is not blank; set the comma or the semicolon yourself when the detection is wrong. Quoted fields are read per RFC 4180, so a quoted comma, a doubled quote and an embedded line break stay inside one value. The output rule is different, because a tab file needs fewer quotes: a cell is quoted the way Excel's tab-delimited export quotes it, only when the cell holds a tab, a double quote or a line break.

sku,label,note
A-1,"Cable, 2 m","5"" pipe"

The same row as TSV, with for a tab:

sku→label→note
A-1→Cable, 2 m→"5"" pipe"

Cable, 2 m lost its quotes, because a comma is an ordinary character in a tab file. The quote value keeps its quotes, and a value with a line break keeps them too. The download name is the loaded name with a .tsv extension, or converted.tsv.

The Uneven-Rows Warning

The status line counts the rows whose column count differs from the header. The conversion still runs, and the count is a signal to check the source. Two causes explain most of them: a value holds a tab that the export did not quote, so that row gains a column; or a value holds a line break that the export did not quote, so one row becomes two short rows. Open the result in CSV Viewer and look for a row with text in an unexpected column.

Practical Examples

Example 1: A psql Report into an Upload Form

Write the report with \copy (select id, customer, note from orders) to 'orders.tsv'. Drop orders.tsv on the page, keep the comma delimiter, and download orders.csv. The portal accepts the comma file, and a customer name with a comma stays one field.

Example 2: An Excel Tab-Delimited Export into Google Sheets

Save the sheet as Text (Tab delimited) (*.txt). The name ends in .txt, so the page reads the first line to pick the direction; check that the toggle says TSV to CSV. Download the CSV and import it into Sheets. A note field with a line break arrives as one cell.

Example 3: A Sheets .tsv into a CSV-Only Importer

Download the sheet as Tab-separated values (.tsv). Drop it on the page; the .tsv name selects the direction. Choose the semicolon when the importer expects it, then load the file.

Common Mistakes

  • Replacing tabs with commas by hand. The replace adds no quotes, so a value with a comma, a quote or a line break breaks the row. Convert the file instead.
  • Ignoring the uneven-rows warning. The count names a real problem in the source. Read it before you import the file, because an importer often accepts the bad row and stores the wrong column.
  • Opening a UTF-8 file in Excel without the BOM. Excel on Windows can show é for é. Turn on Excel BOM before you download.
  • Forcing the comma on a semicolon file. A semicolon file has one field per line under the comma rule, so the TSV output has one column. Set the input delimiter to the semicolon, or leave the detection on Auto.
  • Expecting typed numbers. The tool writes text, so 00123 stays 00123. Use CSV to SQL or the importer's own column types when you need typed columns.

Tools Used in This Guide

  • TSV to CSV — Tabs to commas, and commas back to tabs, on one page.
  • CSV Viewer — Open and sort the result without a spreadsheet application.
  • CSV to Excel — Turn the CSV into an .xlsx workbook.
  • CSV to SQL — Build INSERT statements from the converted rows.

FAQ

Q1: Is FindUtils TSV to CSV free to use? A: Yes. The tool is free and needs no account. It converts one file at a time in the browser.

Q2: Does the same page convert CSV to TSV? A: Yes. A direction toggle picks the way, and /convert/csv-to-tsv/ opens the same page.

Q3: Why does a value with a comma lose its quotes in the TSV output? A: A tab file quotes a cell only for a tab, a double quote or a line break. A comma needs no quotes there.

Q4: My mysql export shows \t inside a value. Does the tool restore the tab? A: No. mysql --batch writes those two characters, and the tool copies them as text. Unescape them in the query or after the conversion.

Q5: How large a file can I convert? A: The TSV input takes up to 5,000,000 characters, and the CSV input takes up to 10,000,000 characters.

Q6: Is my file uploaded? A: No. The text is converted in the browser and no request carries it. The same converters are on the FindUtils API as tsv_to_csv and csv_to_tsv for scripted use.

Next Steps

Convert one export and compare its first and last row against the source before you build an import on it.

Sources