tsvkit.org
TSV Toolkit
Sample data Say hi →

JSON to TSV

array of objects or JSONL · union of all keys · runs in your browser

Flatten a JSON array of objects into a table. Every key seen anywhere in the array becomes a column, in first-seen order, and objects missing a key get an empty cell — so a heterogeneous array produces a wide sparse table rather than an error. JSON Lines input is detected automatically, and a single bare object is treated as a one-row table.

json → tsv
Drop a .json file here, or
ready

How to use

  1. Paste the JSON — an array of objects, one object, or newline-delimited JSON.
  2. Check the object count in the status line against what you expected.
  3. Copy or download the TSV.

What happens to nested values

A nested object or array becomes its JSON text inside a single cell — {"tags":["a","b"]} gives a tags column containing ["a","b"]. That's lossless but not very usable. For real flattening into parent.child columns, use JSONL → TSV, which has a dot-notation option; convert your array to one object per line first, or paste it as JSONL directly.

Types are lost in either case, because TSV has no type system: numbers, booleans, and null all become text, and null is indistinguishable from an empty string afterwards.

Common input problems

A trailing comma, single quotes instead of double, or unquoted keys make the input invalid JSON, and the error message names the position. An array of arrays (rather than objects) has no keys to make a header from — those need a header added after conversion by another route. And a top-level object wrapping the array ({"results": [...]}) needs the wrapper removed, or paste just the array portion.

FAQ

Does it accept JSON Lines?

Yes — if the input doesn't start with [ or { and has multiple lines, each line is parsed as its own object. JSONL → TSV is the dedicated page, with nested-object flattening and per-line error reporting.

Why are some cells empty?

Because the columns are the union of every object's keys. An object that omits an optional key gets an empty cell — that's the correct flattening. Stats shows the null count per column.

Can I choose which keys become columns?

Convert everything, then extract columns in the order you want. For large files jq -r '[.a,.b] | @tsv' is leaner.

Is key order preserved?

Column order follows the order keys are first encountered, so the first object sets the leading columns. Later-appearing keys are appended on the right.

Privacy

100% client-side. No upload. See the privacy policy.