TSV converter
Convert TSV files while handling tabs, encodings, headers, Excel imports, and row-shape problems in tab-delimited data.
.tsv
Format
About TSV
TSV is a plain-text table format where tab characters separate fields and line breaks separate records. It has no single universal standard, but most tools treat the first row as optional headers, use UTF-8 or a local legacy encoding, and expect every row to have the same field count. TSV is common in bioinformatics, analytics exports, search logs, spreadsheets, and Unix data pipelines because commas can appear inside values without quoting. The tradeoff is that tab characters inside data become dangerous unless the producer escapes or removes them before export. Our tabular conversions read TSV as one rectangular dataset, then write targets such as CSV, XLSX, JSON, JSONL, XML, YAML, SQL, ODS, HTML, Markdown, plain text, and Parquet when the enabled pair exists.
Versions are mostly conventions rather than file-format revisions. Some TSV files use CRLF line endings from Windows, LF from Unix, or a mix after manual edits. Some include a UTF-8 byte order mark because Excel on Windows historically used it as an encoding hint. Others are really tab-delimited reports with title lines, comments, subtotals, or notes below the table. A strict converter needs to find the actual header row and reject ragged records instead of silently shifting columns. TSV also has no native types, so dates, booleans, identifiers, and currency values start as strings even when the destination format can store richer values.
Readers and writers include Excel, Google Sheets exports, R, Python, PostgreSQL COPY, command-line tools, lab instruments, ad platforms, and warehouse unload jobs. Those systems disagree about quoting, null markers, date formats, and whether empty trailing columns should be retained. A TSV from a database may use N for nulls. A spreadsheet export may turn a long account identifier into scientific notation before the TSV is created. A hand-edited file may contain literal tabs inside notes pasted from another system. Conversion is safest when the producer publishes a schema or when you can compare field counts, row counts, and a few known edge records before trusting the output.
The main gotchas appear after TSV leaves plain text. TSV to XLSX makes review easier, but spreadsheet software may infer dates and numbers unless cells are written as text. TSV to JSON depends on clean headers because duplicate or blank names produce poor object keys. TSV to SQL needs a table name, column names, and a null policy; TSV itself does not contain those. TSV to Parquet gives typed column storage only after inference or a supplied schema. Before batch conversion, inspect encoding, choose whether the first row is a header, normalize line endings, and decide how empty fields should map to nulls in the target.
Common TSV problems
A tab inside a note splits one record into extra cells.
Replace embedded tabs before conversion, or move the file through /convert/tsv-to-xlsx and review rows with too many populated columns.
Excel opens the file but changes ZIP codes or IDs.
Use /convert/tsv-to-xlsx so identifiers can be carried into cells intentionally, then audit long numeric-looking columns.
The receiver asked for CSV, not tab-delimited text.
Use /convert/tsv-to-csv and check fields that contain commas because CSV quoting becomes part of the output contract.
Downstream code wants one object per row.
Use /convert/tsv-to-jsonl for streaming pipelines or /convert/tsv-to-json when one array document is easier to inspect.
The TSV has no schema for database loading.
Use /convert/tsv-to-sql as a starter script, then review column names, inferred types, and null markers before loading it.