JSON to Table

View as a table and export CSV

Loading tool…

About JSON to Table Converter

JSON to Table Converter takes an array of JSON objects — or a single object, treated as a one-row array — works out the column set from the keys it finds, renders the records as a table you can scan, and exports the same rows as CSV. It is the fastest way to answer "which of these records is missing a field?" without writing a script.

JSON and CSV disagree about shape. JSON is a tree: a value can be an object, an array or null, and two records in the same array need not carry the same keys. CSV is a rectangle: every row has the same columns, every cell is a string, and there is no representation for nesting at all. Converting therefore means making decisions — which key becomes a column, what a missing key looks like, and what happens to a value that was never flat. Knowing those decisions is the difference between a table you can trust and a spreadsheet full of quiet damage.

How to use this developer tool

  1. Paste an array of objects into the JSON pane. A single object works and produces one row; an array containing numbers, strings or nested arrays is rejected, because those have no columns.
  2. Press Generate table. The column set is the union of every key across every row, in the order each key is first seen, so a field that only appears in a late record becomes the last column.
  3. Read the table for shape before content: empty cells mark records where the key is absent, and nested values appear as inline JSON.
  4. Press Download CSV for a spreadsheet copy. The file is written as table.csv with a UTF-8 byte-order mark so Excel picks the right encoding.
  5. Check any column that showed nested JSON against the exported file before relying on the export — the two renderings are not identical, as the reference below shows.

Worked example: where the table and the CSV disagree

Two records with a ragged key set, a quoted string, a nested object and an array. The table and the export are shown together because they do not say the same thing.

Input
[
  { "id": 1, "name": "Ada, \"the Countess\"", "tags": ["admin", "beta"], "profile": { "region": "eu" } },
  { "id": 2, "name": "Grace", "tags": [], "active": false }
]
Table, then exported CSV
id | name                | tags              | profile          | active
1  | Ada, "the Countess" | ["admin","beta"]  | {"region":"eu"}  |
2  | Grace               | []                |                  | false

"id","name","tags","profile","active"
"1","Ada, ""the Countess""","admin,beta","[object Object]",""
"2","Grace","","","false"

Three differences are worth internalising. The table renders nested values as JSON while the CSV stringifies them, so an object becomes the literal text [object Object] and an array loses its brackets. An empty array renders as [] on screen and as nothing in the file. And the quoted string is handled correctly in CSV by doubling the inner quotes, which is the RFC 4180 rule, not by backslash-escaping them.

How each JSON value reaches the table and the file

Every CSV field, including the header row, is wrapped in double quotes, and any double quote inside a value is doubled. That is RFC 4180, and it is why a comma or a newline inside a value is safe. What is not safe is nesting.

JSON valueTable cellCSV field
"Grace"Grace"Grace"
54325432"5432"
falsefalse"false"
nullnull"" (empty)
key absent from this row(empty)"" (empty)
{"region":"eu"}{"region":"eu"}"[object Object]"
["admin","beta"]["admin","beta"]"admin,beta"
[][]"" (empty)
"a, b"a, b"a, b" — the quotes keep the comma inside one field
"say \"hi\""say "hi""say ""hi"""
"line1\nline2"two lines in the cella real newline inside the quoted field, so one record spans two lines

Troubleshooting

Valid JSON is rejected with a parse error.

Why it happens The tool needs records. A top-level object is fine and an array of objects is fine, but an array containing a number, a string, another array or null has nothing that can become a column.

Fix Reshape the document first. If the records are nested inside a wrapper such as {"data":{"items":[...]}}, pull the array out with the JSONPath Tester and paste only that.

A column reads [object Object] in the exported file.

Why it happens The CSV writer converts each value with a plain string conversion, which gives [object Object] for an object and a comma-joined list for an array. Only the on-screen table serialises nested values as JSON.

Fix Flatten before you paste. Promote profile.region to a top-level key named profile_region, and join arrays into a delimited string yourself so you control the separator.

Opening the CSV in a spreadsheet runs something.

Why it happens A cell whose text begins with =, +, - or @ is treated as a formula by Excel and LibreOffice. Wrapping the field in quotes is not a dependable defence, so a value such as =cmd|'/c calc'!A1 that arrived from user input becomes an attack the moment someone double-clicks the file.

Fix Never open an export of untrusted data by double-clicking. Import it through the spreadsheet's text-import wizard with the affected columns typed as Text, or prefix suspect values with a single apostrophe before exporting.

A column you expected is missing, or an empty cell is ambiguous.

Why it happens Columns come from the union of keys actually present, so a key no record carries never appears. An empty cell can mean the key was absent, the value was null, or the value was an empty string or empty array — the export collapses all four.

Fix Normalise the records before exporting so every object carries every key, and use a sentinel rather than null for values that must stay distinguishable in a spreadsheet.

When this tool is the right choice

  • Scanning an API response as records to see which objects are missing a field or carry an unexpected type.
  • Handing a colleague who works in a spreadsheet the contents of a JSON fixture without writing a script.
  • Comparing two runs of the same endpoint by exporting both and diffing the CSVs.
  • Turning a small JSON log excerpt into something you can sort and filter while investigating.

When to use something else

  • Checking whether a document is valid or finding a syntax error. The JSON Formatter & Validator reports the exact offset.
  • Pulling a record array out of a deeply nested response. Use the JSONPath Tester to select it, then paste the result here.
  • Exporting nested data faithfully. CSV has no representation for a tree; flatten deliberately, or keep the data as JSON or NDJSON.

Privacy and data handling

The document is parsed, the table built and the CSV generated entirely in this browser tab; the download comes from an in-memory blob and never touches a server. Record exports are exactly the kind of data that carries names, email addresses and account identifiers, so cut the array down to a few representative rows before pasting, and delete the downloaded file afterwards.

Related developer tools

Frequently asked questions

How are the columns ordered?

By first appearance. The tool walks the records in order and collects keys, so the first record's keys come first and any key introduced later is appended. Reordering the input reorders the columns, which matters if a downstream import is positional.

Why does my CSV open with strange characters in Excel?

It should not: the download starts with a UTF-8 byte-order mark so Excel detects the encoding. If you see mojibake anyway, the file was probably re-saved by another program that stripped the mark, or imported with an explicit non-UTF-8 encoding.

Can I export nested objects properly?

Not as they are. Flatten first — promote nested fields to top-level keys with a prefix such as profile_region, or serialise the subtree into a single JSON string column that the consumer parses back. Both are deliberate choices; the default stringification is not.

Does the tool change my values?

It never edits the JSON, but the table and the CSV are renderings, and rendering is lossy. A large integer already lost precision when the document was parsed, and nested values are converted to text on the way out. Keep the JSON as the source of truth.

How large a document can I paste?

The whole structure and the rendered table live in browser memory at once, so a few thousand records is comfortable and tens of thousands will make the page sluggish. For more, use a streaming converter on the command line.

Is a quoted CSV field safe for arbitrary text?

For commas, quotes and newlines, yes — RFC 4180 quoting handles all three and the exporter quotes every field. For formula injection, no. Quoting does not stop a spreadsheet from evaluating a cell that starts with =, which is a property of the spreadsheet rather than the file format.