RevealTheme logo

JSON to CSV Converter

Convert a JSON array of flat objects into comma-separated CSV, entirely in your browser. Column headers are taken from the keys of the first object in the array.

How to use this tool

  1. 1

    Paste or type a JSON array of objects into the text box. The array must be non-empty (for example: [{"name":"A","value":1}]).

  2. 2

    Click the Convert button to generate the CSV.

  3. 3

    Read the CSV in the output panel below the button, with the header row first followed by one row per object.

  4. 4

    Select the output text and copy it into a spreadsheet, a .csv file, or wherever you need it.

How does this JSON to CSV converter work?

CSV (comma-separated values) is the lingua franca of spreadsheets and bulk imports, while JSON is what most APIs return. This converter bridges the two for the common case: a JSON array of flat objects. It parses your input with JSON.parse, then takes the column headers from the keys of the first object only. Each subsequent object is emitted as a row, reading values in that same key order. That design has a deliberate trade-off you should know about: if later objects have keys the first object lacks, those extra columns are silently dropped, and if a later object is missing a key, its cell is left blank. Values are coerced with String(); null and undefined become empty cells, and nested objects or arrays are written as inlined JSON (via JSON.stringify) rather than being flattened into separate columns. For quoting, any value containing a comma, double quote, or newline is wrapped in double quotes with internal quotes doubled, following the RFC 4180 quoting convention. One caveat: rows are joined with a plain newline (LF), not the CRLF that RFC 4180 specifies, so most tools accept it but strict parsers may want CRLF.

Common use cases

  • Turning a small JSON response from an API into a CSV you can paste straight into Excel or Google Sheets.

  • Quickly eyeballing tabular API data as rows and columns instead of nested braces.

  • Preparing a CSV for a bulk-import feature that expects flat columns, when your source data is already a uniform JSON array.

  • Converting a JSON fixture or seed file into CSV for a quick import into a database GUI.

  • Generating a CSV snippet for documentation or a bug report without installing jq or writing a script.

  • Sanity-checking that a JSON array has consistent keys across records by spotting blank or missing cells in the output.

Frequently asked questions

Is my data uploaded anywhere?
No. The conversion runs entirely in your browser with JavaScript. The JSON you paste never leaves your device and is not sent to any server.
What input format does it expect?
A non-empty JSON array of objects, like [{"name":"A","value":1},{"name":"B","value":2}]. A bare object, a scalar, or an empty array is rejected with an error message.
Where do the column headers come from?
Only from the keys of the first object in the array. If your records have varying keys, make sure the first object contains every column you want, because keys that appear only in later objects are dropped.
What happens to nested objects or arrays?
They are written into a single cell as inlined JSON via JSON.stringify, not flattened into separate columns. If you need real flattening, preprocess the data first with a tool such as jq.
Does it handle commas, quotes, and newlines in values?
Yes. Any value containing a comma, double quote, or newline is wrapped in double quotes and internal quotes are doubled, matching the RFC 4180 quoting rules.
Is the output fully RFC 4180 compliant?
The quoting and escaping follow RFC 4180, but rows are joined with a plain newline (LF) rather than the CRLF line ending the spec calls for. Most spreadsheets and parsers accept LF, but a strict RFC 4180 parser may expect CRLF.
How are null and missing values represented?
null and undefined become empty cells. A key present in the header but missing from a given object also yields an empty cell for that row.

Related tools