Skip to content
JSON2026-05-07Begin5 min read

Online JSON/CSV Converter: Convert Between JSON and Table Formats

What is JSON → CSV

APIs, logs, and configs are often JSON; spreadsheets and BI tools want tables. Turning an array of objects into a 2D CSV is the common bridge. ToolVault's JSON/CSV Converter is the JSON-first write path, fully local in the browser.

If you already have CSV and need a strict RFC-subset parse back to objects, use the bidirectional CSV/JSON Converter. The two pages have different jobs — do not mix expectations.

Example

JSON:

[
  { "name": "Alice", "age": 28, "city": "Shanghai" },
  { "name": "Bob", "age": 32, "city": "Beijing" }
]

CSV (default comma + header):

name,age,city
Alice,28,Shanghai
Bob,32,Beijing

When to prefer which shape

ScenarioJSONCSV
Web APIsUsual choiceRare except bulk export
Excel / sheetsNot a native tableNative (watch encoding)
Nested dataNativeFlatten or stringify into cells
Exact typesClearAll text; conventions only
Human editingAwkwardMore practical

How to use this tool (real options)

Open JSON → CSV:

  1. Paste JSON: an array of objects is ideal; a single object becomes one row; an array of primitives becomes index,value columns.
  2. Options:
    • Delimiter (default ,; use ; or tab for Excel locale dialects).
    • Include header row.
    • Flatten nested objects (on by default) → dotted keys like address.city.
    • Guard spreadsheet formulas (on by default) → cells starting with =, +, -, or @ get a leading tab so Excel/WPS treat them as text, not formulas.
  3. Copy or download data.csv (text/csv;charset=utf-8).

There is no "auto-detect CSV and convert back" button — use CSV/JSON for the return trip.

Implementer's notes

Nested objects

  • With flatten on, plain objects recurse; keys join with ..
  • With flatten off, nested objects become a single JSON.stringify'd cell (properly escaped).

Array fields

  • Arrays (including nested arrays) become a JSON string cell, e.g. ["a","b"], not a semicolon join.
  • Row-wise unnest (one element per row) is out of scope — reshape upstream.

Headers and missing columns

  • Header = union of all row keys; missing keys → empty cells.
  • null / undefined → empty cell (not the literal null).
  • Large integers go through lossless parsing when possible to reduce precision loss.

Quoting

  • Fields containing the delimiter, ", or newlines are double-quoted; " → "".
  • Formula injection: with Guard spreadsheet formulas on (default), values that start with =, +, -, @, tab, or CR are prefixed with a tab character before quoting. That matches the bidirectional CSV/JSON write path. Turn the guard off only when you intentionally want formula cells for a trusted spreadsheet workflow.

Empty rows, sparse objects, and column order

  • Header order follows first-seen key order across rows (union), not alphabetical sort — keep a canary fixture if downstream scripts assume a fixed column index.
  • A row missing a key produces an empty cell; it does not drop the column for other rows.
  • An empty array input yields an empty string (no header-only file). Feed at least one object when you need a header template.

Large-file boundary

  • The whole JSON document is parsed, then all rows are materialized.
  • Fine for interactive exports; million-row jobs need server-side streaming.

RFC 4180 and Excel dialects (write side)

Writing CSV is more controllable than reading it, but you still pick a dialect:

  • Delimiter: North-American comma vs European semicolon — match the receiver with the delimiter option.
  • BOM: some Windows Excel builds need a UTF-8 BOM for CJK text; this download does not force one. Add EF BB BF or use Excel's text-import wizard with UTF-8 if you see mojibake.
  • Newlines: output uses \n; Excel usually accepts it.
  • Formula injection: spreadsheet apps may treat =cmd|... as a formula — see above.

Round-trip and type boundaries

JSON → CSV → JSON is not identity:

  1. Nesting is flattened or stringified — structure is provably lost.
  2. Numbers become text in CSV; reading back via the bidirectional tool keeps strings (no silent 00123 → 123).
  3. null and empty string are indistinguishable in CSV.
  4. Array cells come back as strings, not arrays.
  5. Formula-guarded cells reappear with a leading tab when parsed back unless you strip it — document that in ETL notes.

Canary practice: keep one fixture with nesting, arrays, empties, leading zeros, commas-in-fields, and an =SUM(1) cell; snapshot both directions under fixed options in CI.

When to stop at the browser

Interactive export of a few thousand rows is the sweet spot. Once you need streaming, schema-enforced columns, or nightly dumps into a warehouse, move to a scripted pipeline (jq + csvkit, Spark, or your API's native export). The online page remains useful as a shape debugger: paste a sample payload, confirm flatten/delimiter choices, then copy those decisions into the batch job.

GoalGo to
Strict CSV → objectsCSV/JSON
Normalize separatorsCSV/TSV
INSERT scaffoldingCSV → SQL
SQL layoutSQL formatter
Config YAMLJSON ↔ YAML
PostsCSV/JSON guide, CSV→SQL, YAML/JSON

FAQ

Nested objects?

Turn flatten on for address.city columns, or off to keep a JSON blob in one cell. Both are valid depending on whether humans or programs consume the sheet.

Why [...] instead of a;b?

JSON strings avoid secondary ambiguity when elements themselves contain ;. If you need joins, join upstream first.

Why no CSV → JSON here?

This page is the export lane. Parse rules (quotes, column checks, formula guard) live on CSV/JSON.

Must APIs use JSON?

Almost always for interchange; export CSV when humans download batches. Complementary, not either/or.


From ToolVault. Related: JSON→CSV, CSV/JSON, CSV→SQL, YAML↔JSON. More on the homepage.