TSV to JSON Converter
Paste tab-separated data โ from a spreadsheet, a database export, or a log file โ and get a clean JSON array back instantly. Type inference included. Nothing leaves your browser.
How TSV-to-JSON conversion works
TSV (Tab-Separated Values) is a flat text format where columns are separated by a tab character (\t) and rows by newlines. It's structurally identical to CSV, just with a different delimiter. The tab character is the key advantage: it almost never appears in real text, which means you rarely need quoting or escaping.
The converter reads your first row as column headers and maps those to JSON object keys. Every subsequent row becomes one object in the output array, with each cell value assigned to the corresponding key. After mapping, it runs a type pass: cells that look like integers or floats become JSON numbers; cells containing true or false (case-insensitive) become JSON booleans; everything else stays a string.
The result is a JSON array you can use directly in JavaScript without parsing strings after the fact. No extra transformation step.
Input and output โ a concrete example
This is what the conversion looks like end to end. Notice that score becomes a number, is_active becomes a boolean, and location (which contains a comma) stays intact without any escaping.
user_id location is_active score 101 Houston, TX true 95.5 102 London, UK false 88 103 Sydney, AU true
[
{
"user_id": 101,
"location": "Houston, TX",
"is_active": true,
"score": 95.5
},
{
"user_id": 102,
"location": "London, UK",
"is_active": false,
"score": 88
},
{
"user_id": 103,
"location": "Sydney, AU",
"is_active": true,
"score": ""
}
]Row 3 has an empty score cell โ two consecutive tabs. The key is still present in the output with an empty string value. Your application code decides whether to treat that as null, zero, or something else.
TSV vs CSV โ when to use which
Both formats store tabular data as plain text. The difference is just the delimiter, but that choice has real consequences depending on what's in your data.
| TSV | CSV | |
|---|---|---|
| Delimiter | Tab (\t) | Comma (,) |
| Appears in real text? | Almost never | Frequently |
| Needs quoting/escaping? | Rarely | Often |
| Excel copy-paste format? | Yes โ native | No |
| Human-readable alignment? | Yes in terminals | No |
| Database export support? | PostgreSQL, MySQL default | Widely supported |
| Common in academic data? | Very common | Common |
The practical rule: if your data includes addresses, descriptions, product names, or any free-text field that might contain commas, use TSV. If your data is purely numeric or tightly controlled (stock prices, sensor readings), CSV is fine and more universally supported by spreadsheet tools.
Where this converter gets used
TSV shows up in more places than people expect. Here are the scenarios where converting it to JSON saves real time.
Excel and Sheets copy-paste
When you select a range of cells in Excel or Google Sheets and copy, the clipboard stores the data as TSV automatically. Paste it directly into this tool and you get a JSON array โ no file export, no CSV conversion step in between.
Database export processing
PostgreSQL's COPY command and MySQL's SELECT INTO OUTFILE both support tab-delimited exports by default. These are the fastest way to dump a table, and TSV sidesteps the quoting issues that trip up CSV when text fields contain commas.
Server log parsing
Apache and Nginx combined log formats are space-delimited, but many custom logging setups and tools like AWS CloudFront produce tab-separated output specifically because it's unambiguous. Converting these to JSON makes them ingestible by Elasticsearch, Splunk, or a simple Node.js script.
Public datasets and research data
Government and academic datasets โ census data, GeoIP databases, genomics exports โ are frequently distributed as TSV because the data often contains prose with commas. Converting chunks to JSON lets you load them into a frontend map, a visualization library, or a NoSQL seed script.
Test fixture generation
Writing a row of test data in a spreadsheet is faster than hand-crafting a JSON array. Fill in your mock users, products, or events in Sheets, copy the range, paste here, and use the output as your test fixture or factory seed data.
ETL pipeline prototyping
Before committing to a data pipeline, it's useful to inspect what the transformed data actually looks like. Paste a sample from your source TSV, check that types inferred correctly and keys mapped as expected, then write your production parser with confidence.
How to use the converter
Three ways to get your data in โ pick whichever matches where your TSV is coming from.
Copy-paste from Excel or Google Sheets
Select the cells you want (including the header row), copy, and paste directly into the input area. The clipboard automatically formats spreadsheet selections as TSV โ you don't need to export a file.
Paste raw TSV text
If you have TSV content in a terminal, a text file, or a database export, paste it directly. Make sure the first row is your headers. Rows with a different number of columns than the header will still parse โ missing cells become empty strings.
Upload a .tsv or .txt file
Use the file upload option if your data is in a file on disk. The file is read entirely in the browser โ it's never uploaded. This works for large files that would be awkward to paste manually.
How type inference works
By default, every value in a delimited file is a string. The converter runs a type pass so you get native JSON types instead of having to parse them yourself after the fact.
| Cell value in TSV | JSON output | Type |
|---|---|---|
42 | 42 | number |
3.14 | 3.14 | number |
true | true | boolean |
False | false | boolean |
Houston, TX | "Houston, TX" | string |
0012 | "0012" | string โ leading zero preserved |
(empty) | "" | string (empty) |
Strings with leading zeros (like zip codes 00123 or product codes 007) stay as strings โ converting them to numbers would drop the leading zero and corrupt the value.
Known limitations
The converter handles the common cases well, but there are edge cases worth knowing before you run large or unusual datasets through it.
Spaces instead of tabs
The most common issue. Some editors align columns visually using 4 or 8 spaces rather than a real tab character. They look identical on screen. If your output appears as one giant key with everything in the first column, this is the cause. Open the file in VS Code and enable 'Render Whitespace' (View โ Appearance) to see whether your column separators are tabs (โ) or spaces (ยท).
No header row
The first row is always treated as headers. If your export doesn't include one, the first data row becomes your JSON keys โ which usually produces nonsense. Add a descriptive header row at the top of the data before pasting. Column names like 'id', 'name', 'value' are fine; they just need to be there.
Tabs inside cell values
TSV has no standard quoting mechanism for values that contain a literal tab character. If a cell value genuinely contains a tab, the parser will treat it as a column break and your row will have more columns than your header, causing misalignment. This is rare in practice โ tab characters almost never appear in real user-entered data.
Very large files
The converter runs in the browser, which means it's constrained by available RAM. Files under 10MB parse quickly. Files in the tens of megabytes may be slow depending on your device. For very large TSV files, a command-line tool like jq with a TSV pre-processor, or a dedicated ETL tool, will be more appropriate.
Working with other formats?
If your data is in a different format, these tools handle the same kind of conversion:
Frequently asked questions
When should I use TSV instead of CSV?+
Use TSV when your data contains commas inside field values โ addresses, descriptions, product names with sizes. The tab character almost never appears in real text, so TSV avoids the quoting and escaping headaches that make CSV fragile with messy data.
Does the converter handle numbers and booleans?+
Yes. The parser performs type inference on each cell. Numeric strings like '42' or '3.14' become JSON numbers. The strings 'true' and 'false' (case-insensitive) become JSON booleans. Everything else stays as a string. This means you can use the output directly in JavaScript without a separate parsing step.
Is my data sent to a server?+
No. All parsing runs in your browser using JavaScript. Your TSV data never leaves your machine. This makes it safe to use with sensitive internal data, API exports, or anything you wouldn't want to upload to a third-party service.
Why are my columns misaligned in the output?+
Misaligned columns almost always mean the file uses spaces instead of real tab characters for alignment. Open the file in a text editor that shows invisible characters (VS Code, Sublime Text) and look for whether column breaks are spaces or tabs. Spaces look similar visually but are not delimiters.
What happens with empty cells?+
Two consecutive tabs with nothing between them produce an empty string in the JSON output. The key is still present in the object โ it just has a value of ''. This matches what most parsers do, and lets your application decide whether to treat empty strings as null, undefined, or a default value.
Does my TSV need a header row?+
Yes. The first row is used as the JSON key names for every subsequent row. If your data doesn't have headers, add a row of descriptive column names at the top before pasting. Without headers, the first data row becomes your key names, which is usually not what you want.
Your data never leaves your browser
All parsing is done in JavaScript running locally on your machine. No file is uploaded, no data is logged. This makes it safe to use with internal database exports, customer data samples, or anything else you'd rather not send to a third-party server.