CalcCafe

JSON to TSV

Paste a JSON array of objects and instantly get tab-separated values with a header row built from the union of all keys.

Example

Given this JSON array (note the second object is missing age):

[
 {"name":"Ada","age":36},
 {"name":"Linus","city":"Helsinki"}
]

The header is the union of keys (name, age, city) and missing values become empty cells:

name	age	city
Ada	36	
Linus		Helsinki

How it works

Parse the JSON array, collect every key across all objects (in first-seen order) for the header, then emit one tab-separated row per object. Missing keys become empty cells and tabs/newlines inside values are escaped.

Good to know

JSON to TSV takes a JSON array of objects and turns it into tab-separated values, a flat table where columns are split by tab characters and rows by newlines. It's built for developers, data analysts, and anyone who needs to move structured JSON, such as an API response or an exported record set, into a spreadsheet, a database import, or a quick diff. The whole conversion happens in your browser, so the data you paste never leaves your device.

Reach for it when a tool you're feeding expects tabular text rather than nested JSON: pasting into Excel, Google Sheets, or Numbers (which split on tabs cleanly), loading into a SQL COPY or bulk-import command, or piping into command-line tools like cut and awk. TSV is often easier than CSV for these jobs because tabs rarely appear inside real-world text, so you avoid most of the quoting and comma-escaping headaches.

To read the output, look at the first line: it is the header, built from the union of every key found across all objects, in the order each key first appears. Every later line is one object, with cells in that same column order. Because the header is a union, an object that lacks a given key produces an empty cell, so each row keeps the same number of columns and stays aligned.

A practical caveat: nested objects and arrays are not flattened into separate columns; they are serialized back into a JSON string inside a single cell, and any tab, carriage return, or newline inside a value is escaped to \t, \r, or \n so it cannot break the row-and-column layout. If you need those escape sequences turned back into real characters after import, you will have to unescape them in your destination tool.

Frequently asked questions

How are missing keys handled?
The header is the union of every key across all objects. If an object lacks a key, that cell is left empty so every row has the same number of tab-separated columns.
What happens to tabs or newlines inside values?
Tabs, carriage returns, and newlines inside string values are escaped to \t, \r, and \n so they do not break the row/column structure. Nested objects and arrays are serialized back to JSON.
Is my data uploaded anywhere?
No — it runs entirely in your browser. Your input never leaves your device and it works offline once loaded.
Is it free?
Yes, completely free with no sign-up and no limits.

People also ask

What is the difference between TSV and CSV?
Both store tabular data as plain text, but TSV separates fields with tab characters while CSV uses commas. Tabs rarely appear inside ordinary text, so TSV usually needs less quoting and escaping than CSV, where commas inside values must be wrapped in quotes.
How do I open a TSV file in Excel or Google Sheets?
Tab-separated text pastes directly into a sheet and splits into columns automatically. To open a saved file, use the import or Data menu and choose tab as the delimiter; renaming it with a .tsv or .txt extension also helps the app detect it.
Can I convert nested JSON objects to TSV?
This tool keeps the table flat, so nested objects and arrays are written back as JSON text inside a single cell rather than expanded into their own columns. If you need deeply nested data fully flattened, you would flatten the JSON first before converting.
What does it mean that the header is the union of all keys?
It means the column list includes every key that appears in any object, not just the first one. This handles objects with different shapes, and any object missing a key simply gets an empty cell in that column.
Does the order of columns matter, and how is it decided?
Columns appear in the order each key is first seen while scanning the objects from top to bottom. The order is consistent for a given input, so the same data always produces the same column layout.
Will my JSON data be uploaded to a server?
No. The conversion runs entirely in your browser using local JavaScript, so the input stays on your device and the page works offline once loaded.
Why are some values in my output showing \t or \n?
Those are escaped versions of tab and newline characters that were inside your string values. They are escaped on purpose so a stray tab or line break inside a value does not split the row into the wrong number of columns.
What input format does the tool expect?
It expects a JSON array of objects, for example a top-level array where each element is an object with key-value pairs. A single object, a non-array value, or an array containing non-objects will produce an error message instead of output.

Related tools