TSV ⇄ JSON Converter
Convert tab-separated data to a JSON array of objects and back. Paste straight from a spreadsheet, with no quoting rules to get wrong.
Turn tab-separated data into a JSON array of objects keyed by the header row, or turn JSON back into TSV. This is the format you get when you copy cells out of a spreadsheet, so it is usually the shortest path from a sheet to structured data.
Paste some TSV...
// TSV ⇄ JSON Converter: Features
Copy from a spreadsheet, paste here
Selecting a range in Excel, Google Sheets, Numbers or almost any other spreadsheet and copying it puts tab-separated text on the clipboard. That means you can select cells, paste directly into this tool and get JSON without exporting a file at all. The first row is treated as the header and supplies the keys for every object in the resulting array.
Why tabs are easier than commas
CSV needs quoting rules because a comma is common inside ordinary text: addresses, product names and free-form comments all contain them, so fields must be quoted and quotes inside fields must be doubled. Tabs are rare inside a cell, so a tab-separated file usually needs no quoting at all. Fewer rules means fewer ways to be wrong, which is why TSV is often the better choice for data that will be machine-read.
Round-tripping and a sample to start from
The SWAP button moves the output into the input and reverses the direction, so you can confirm a data set survives a conversion unchanged. The SAMPLE button fills the input with a small worked example in the current direction, which is a quicker way to see the expected shape than reading a description of it. CLEAR empties the input when you want to start again.
What the converter expects
Converting to JSON needs at least two lines: a header and one data row. Header cells must not be empty, because an empty key would produce an unusable object. Converting in the other direction needs a non-empty JSON array whose elements are all objects; an array of numbers or strings has no columns to write. Each of these conditions is reported explicitly rather than producing surprising output.
Exported records never leave the page
Conversion runs as JavaScript in your browser, so the rows you paste are never transmitted, stored or logged. Exports containing customer records, internal metrics and unreleased figures can all be converted here. If your source uses commas or semicolons rather than tabs, the CSV converter handles those, including the quoting rules they require.
// TSV ⇄ JSON Converter: FAQ
What is TSV?
- Tab-separated values: the same idea as CSV but with a tab character between fields instead of a comma. It is what spreadsheets put on the clipboard when you copy a range, and what many data pipelines prefer because it needs far less quoting than CSV.
Can I paste straight from Excel or Google Sheets?
- Yes, and that is the intended workflow. Select the cells including the header row, copy, and paste into the input box. The clipboard contents are already tab-separated, so no export step is needed.
What shape of JSON do the rows become?
- An array of objects, one per data row, with keys from the header row. Converting the other way, the tool expects that same shape and takes the column order from the keys of the first object.
Why do I get an error about needing two lines?
- Because a header row alone describes columns without providing any data. Include at least one row beneath the header. The same check catches the case where a copy captured only the header.
What happens if a header cell is empty?
- The conversion is refused, because an empty key would produce objects with an unusable property. Spreadsheets often leave a blank column between groups of data, so this is a common cause; delete the blank column or give it a name.
Are values converted to numbers?
- No. Every field is kept as text, which preserves leading zeros in codes and identifiers that would otherwise be lost. Convert the specific columns you want as numbers after import, where you can decide which ones should change.
What if a value contains a tab?
- It will split the field, because a tab is the delimiter. This is rare in practice, which is the main advantage of TSV, but it does happen with text pasted from another source. If your data genuinely contains tabs inside values, CSV with proper quoting is the safer format.
Can it handle nested JSON?
- No, and no tabular format can. A row is a flat list of values, so an object or array inside a field has nowhere to go. Flatten the data before converting if the nested values matter.
How do I get the columns in a particular order?
- Reorder the keys in the first object of your JSON array. The tool takes the column order from that object, so the output follows whatever order you put there.
Are the rows I paste sent to a server?
- No. The conversion runs entirely in your browser, and the data you paste is never transmitted, stored or logged.
// How to Use TSV ⇄ JSON Converter
-
TSV to JSON, or JSON to TSV
Select TSV to JSON or JSON to TSV. Press SAMPLE if you want to see the expected input shape for the current direction before pasting your own data.
-
Paste the copied spreadsheet range
Copy a range from your spreadsheet and paste it in, header row included, or paste a JSON array of objects. Conversion happens as you type, and any problem with the input is reported explicitly.
-
Set the indentation and copy the rows
Choose the indentation for JSON output, then copy the result with one click. SWAP moves the output back into the input and reverses the direction, which confirms the data round-trips unchanged.
Category Data Formats