Code Beautify / Guides

CSV vs TSV: delimiters, quotes and spreadsheet surprises

CSV and TSV can hold similar tables, but changing separators requires parsing quoted fields. A blind search-and-replace can corrupt rows.

A separator is part of a format

CSV commonly separates fields with commas, while TSV uses tab characters. The difference sounds small until a field itself contains a comma, tab, quote or line break. RFC 4180 describes a common CSV form in which a field containing a comma can be enclosed in double quotes and a quote within a quoted field is doubled. TSV has no single universal behavior across every program, so the receiving system’s expectations still matter. MultiVerto’s converters parse a table into cells and write the requested delimiter rather than replacing each punctuation mark in the raw text. They require rows to have the same number of cells.

Follow one quoted field

Try the two-row CSV input item,note followed by pen,"red, blue". The comma inside the quoted note is data, not a third column. After CSV-to-TSV conversion, a tab separates item from note and pen from red, blue; the comma in the note remains ordinary text. The writer can omit the surrounding quotes because a comma does not separate TSV fields. If a field contained a tab or line break, the writer would need quotes in the TSV representation. Copy the result into a plain-text editor with visible tabs before judging it; tabs and spaces may look alike on a page.

Parsing keeps the comma inside a quoted field while changing the delimiter.
  1. CSV: pen,"red, blue"
  2. parse as two cells: pen | red, blue
  3. TSV: pen [tab] red, blue

Choose the receiving application first

Use CSV when a partner explicitly requests commas and a documented quoting convention. TSV can be convenient for data with many commas because fewer fields need quoting, but embedded tabs still need care. When the destination accepts structured values rather than a plain table, CSV-to-JSON may help inspect records as named fields. JSON can preserve types only if the workflow specifies how to parse them; tabular imports often read every cell as text. A spreadsheet may change leading zeros, large identifiers or date-like strings on import. A delimiter conversion cannot prevent that; review import settings and compare a sample with the original data.

Keep formulas and untrusted cells in mind

CSV or TSV is data, yet spreadsheet software may interpret a cell beginning with formula-like characters as a formula. That makes untrusted exports a separate security issue. This converter changes delimiters and quoting; it does not sanitize cells for a spreadsheet or make a downloaded file safe to open. If the file includes values submitted by other people, follow the destination spreadsheet’s import safeguards and the application’s export policy. Do not assume changing a comma to a tab removes a dangerous leading character. For sensitive datasets, verify what tool will receive the file and whether it preserves every field as literal text.

Check round trips and data types

Retain the original file. Convert a representative CSV sample to TSV, then use TSV-to-CSV and compare the parsed cells, not necessarily the exact bytes: harmless quote placement or line endings can differ. Confirm headers, row count, empty cells, embedded separators and line breaks. If a JSON step follows, check whether the first row became keys and whether number-like strings remained strings where needed. A leading zero in an account code is data, not a number to round. Use the embedded converter for a small example first, then test the receiving application with the same troublesome rows before applying the workflow to a full table.

Try the converter

Convert a CSV row with a quoted comma to TSV and inspect the cells.

Change a comma-separated table into tab-separated text.

Open full converter

More guides

Conversion guides

Explore guides