User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
CSV Input
Drop .csv file here or click to browse Max 50 MB
TSV Output
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

CSV (Comma-Separated Values) and TSV (Tab-Separated Values) are the two dominant flat-file interchange formats. The critical difference is the delimiter: d = , for CSV versus d = \t for TSV. A naive find-and-replace conversion will corrupt any dataset where commas appear inside quoted fields - a violation of RFC 4180, Section 2, Rule 6. This tool implements a finite-state-machine parser that correctly distinguishes structural delimiters from literal characters within double-quoted fields. It handles embedded newlines, escaped double quotes ("" โ†’ "), and empty fields without data loss.

Incorrect delimiter conversion is a common cause of silent data corruption in ETL pipelines and database imports. Spreadsheet applications sometimes auto-detect delimiters incorrectly, compounding the error. This converter processes files entirely in your browser - no server upload, no data exposure. Files exceeding 1MB are processed in a Web Worker to prevent UI blocking. The parser assumes UTF-8 encoding. Note: if source fields contain literal tab characters, they are escaped to preserve TSV structural integrity.

csv to tsv csv converter tsv converter delimiter converter csv parser tab separated values file converter

Formulas

The conversion operates on a parsed two-dimensional array M of m rows and n columns. Each cell Mi,j is extracted by the CSV state machine, then rejoined with a tab delimiter.

output = mโˆ‘i=1 join(Mi, \t) + \n

The CSV parser uses three states: S0 = FIELD_START, S1 = UNQUOTED, S2 = QUOTED. Transitions occur on encountering ", ,, or \n. Inside S2, a comma is treated as a literal character. A double-quote "" within S2 produces a single literal quote and remains in S2.

Where M = parsed matrix, m = total rows, n = columns per row, Mi = the i-th row array, join = concatenation with tab delimiter.

Reference Data

FeatureCSV (RFC 4180)TSV
DelimiterComma (,)Tab (\t, U+0009)
MIME Typetext/csvtext/tab-separated-values
File Extension.csv.tsv or .tab
QuotingDouble quotes for fields containing delimiters, newlines, or quotesRarely used; tabs within fields must be escaped or stripped
Quote Escaping"" (doubled)Not standardized
Newlines in FieldsAllowed inside quoted fieldsGenerally not supported; may break parsers
Header RowOptional (RFC 4180 ยง2.3)Optional
EncodingUTF-8 recommended; variesUTF-8 typical
Excel ImportAuto-detected on most localesRequires manual delimiter selection
Database ImportWidely supported (MySQL LOAD DATA, PostgreSQL COPY)Supported (PostgreSQL COPY with DELIMITER)
Max Columns (practical)No standard limit; Excel caps at 16,384Same practical limits
Common PitfallLocale-dependent: some regions use semicolons (;)Embedded tabs corrupt structure
RFC StandardRFC 4180 (October 2005)IANA registered; no formal RFC
Used ByExcel, Google Sheets, most databasesBioinformatics (BLAST, BED), Unix tools
AdvantagesUniversal support; well-defined quoting rulesSimpler parsing when fields lack tabs; no quoting ambiguity

Frequently Asked Questions

The parser implements a finite state machine per RFC 4180. When it encounters an opening double quote at the start of a field, it enters QUOTED state. In this state, commas are treated as literal characters and appended to the current field value - they are not interpreted as delimiters. The field only terminates when a closing double quote is followed by a comma, newline, or end of file.
Literal tab characters within field values would break TSV structure since tabs are the structural delimiter in TSV. This converter replaces any literal tab characters found inside field values with a single space to preserve data integrity. This behavior is noted in the output statistics.
Yes. Many European locales (German, French, Dutch) use semicolons as CSV delimiters because the comma serves as a decimal separator. The tool provides a delimiter selector where you can choose comma, semicolon, or pipe as the input delimiter. The parser applies the same RFC 4180 quoting rules regardless of which delimiter is selected.
The converter accepts files up to 50 MB. Files exceeding 1 MB are automatically processed in a Web Worker thread to prevent the browser UI from freezing. A progress indicator displays during conversion. Processing speed depends on your device but typically handles 10 MB in under 2 seconds on modern hardware.
Embedded newlines within quoted fields are a valid RFC 4180 construct. However, most TSV parsers do not support embedded newlines and will interpret them as row separators. This converter replaces embedded newlines within fields with a space character by default to ensure TSV compatibility. The original row count and any replaced newlines are reported in the conversion summary.
If the input CSV begins with a UTF-8 BOM (U+FEFF, bytes EF BB BF), the converter automatically strips it before parsing. The BOM would otherwise appear as an invisible character in the first field of the first row, causing issues with header matching in database imports and programmatic access.