JSON to CSV & CSV to JSON

Paste JSON or CSV on the left. Use To CSV or To JSON under the input; output and status appear on the right.

Tabular JSON and CSV

JSON and CSV both carry row-oriented data, but they model it differently. JSON keeps structure in the parse tree—objects, arrays, typed scalars, nesting. CSV is a text table: one header row of field names, then delimiter-separated cells per record. A JSON array of objects maps naturally to CSV; arbitrary JSON (deep trees, mixed types in one column) does not have a universal spreadsheet shape.

Conversion here is lossy in the spreadsheet sense: extra columns appear when objects disagree on keys; nested objects become opaque cell text unless you flatten first. For binary Excel workbooks (.xlsx), export or upload via Excel to CSV and paste the text, or stay in the spreadsheet toolchain.

JSON ↔ CSV — background

Object arrays as tables

Each plain object becomes one row. Property names become column headers; the union of keys across rows defines columns (first-seen order). A single object is a one-row table. Arrays of primitives become rows with a value column; arrays of arrays become c1, c2, … by position. This is the same logical model SQL COPY, pandas read_json, and many API “export CSV” endpoints use.

Quoting and delimiters (RFC 4180 style)

Fields that contain comma, quote, or newline must be double-quoted; internal quotes are doubled. Exports from this tool use comma separators and UTF-8; downloads include a BOM so Excel recognizes UTF-8. On import, the first line counts commas, semicolons, and tabs outside quotes to guess delimiter—common for Excel locale exports (semicolon in EU, tab from copy-paste).

Nested JSON inside a cell

When a field value is an object or array, JSON→CSV stores JSON.stringify(text) in that cell, quoted. CSV→JSON parses quoted cells that look like {…} or […] back into structured values. That round trip is intentional for light nesting (metadata blob, tags array). Deep hierarchies are usually flattened (JSON flatten) or kept in JSON end-to-end.

Types when reading CSV back

Unquoted cells are interpreted: null, true, false as literals; numeric strings as numbers; everything else stays string. Quoted cells remain strings even if they look numeric—important for leading zeros (SKU "007") and IDs. Excel often forces text by prefixing apostrophe; pasted CSV may still need quotes to preserve type on import to JSON.

Where conversion fits

API payloads into spreadsheets

Log or REST responses as JSON arrays are easy to inspect as CSV in Sheets or Excel for ad-hoc analysis, pivot tables, or handoff to non-developers—provided columns are flat enough.

Spreadsheet edits back into code

After manual column edits, CSV→JSON yields a JSON array you can diff, schema-check (JSON Schema validator), or POST again. Pretty-print with JSON formatter when readability matters.

Frequently asked questions

What JSON shape converts cleanly to CSV?
Most often a top-level array of objects with similar keys—orders, users, inventory lines. One object alone becomes one row. Primitive arrays become a single-column table; matrix-style arrays use generated column names c1, c2, …. Arbitrary nested documents should be flattened or exported field-by-field, not assumed to fit one sheet.
What do I get when I convert CSV to JSON?
A JSON array of objects: first row = property names, each following row = one object. Duplicate header names are renamed (name_2, name_3) so keys stay unique. Empty trailing lines are ignored; a UTF-8 BOM at the start is stripped.
JSON to CSV vs CSV to JSON—are they inverses?
For flat object arrays with stable columns, yes in practice. Column order may differ; numbers and booleans round-trip when unquoted on export. Nested objects round-trip via JSON-in-cell. You lose JSON null vs empty string distinctions if Excel edited cells, and wide sparse objects gain empty columns—always spot-check critical fields.
How are nested objects and arrays stored in CSV?
They are serialized as JSON text inside one quoted cell, e.g. {"tags":["a","b"]}. Converting back parses that cell into an object or array. Tabular tools treat the cell as opaque text unless they implement the same rule.
Why does my Excel CSV use semicolons or tabs?
Regional Excel settings and “Save as CSV” use locale delimiters. This parser detects comma, semicolon, or tab from the header line. Output CSV from here always uses commas; re-open in Excel with “From Text/CSV” if delimiter differs.
Can I upload an .xlsx file on this page?
No—only pasted JSON or CSV text. Use Excel to CSV to extract a sheet, then paste here or download and re-import.
Invalid JSON or broken CSV quotes—what then?
Conversion stops with an error under the input. JSON syntax issues (trailing commas, comments) need JSON repair & validate first. CSV requires balanced double quotes per row.
How is this different from JSON generator or CSV generator?
JSON generator and CSV generator create mock datasets from rules. This page transforms data you already have in either direction.