Skip to content
jsonforge.app

JSON to CSV

Convert JSON arrays to CSV and back, with type inference and quoting.

Entrada JSON

Loading editor…

Saída CSV

Digite JSON à esquerda para convertê-lo.

O que é JSON to CSV?

A CSV to JSON (and JSON to CSV) converter translates between a flat, spreadsheet-friendly table format and JSON's nested object format. CSV is what spreadsheets, databases, and countless legacy systems export and import, while JSON is what modern APIs and JavaScript codebases speak — so this conversion comes up constantly: importing a spreadsheet export into an app that expects JSON, or turning an API's JSON array of records into a CSV a non-technical teammate can open in Excel or Google Sheets. Going from JSON to CSV means picking a column for every key that appears anywhere in the array (rows missing a given key just get an empty cell), and going from CSV to JSON means treating the first row as column headers and inferring a type — number, boolean, or string — for every other cell.

Como usar JSON to CSV

  1. Pick a direction using the JSON ⇄ CSV toggle at the top (or click the swap button to reverse it, carrying today's output into the other side as new input).
  2. For JSON → CSV, paste a JSON array of objects into the left panel — a bare object or a mix of objects and non-objects will be rejected with an explanation.
  3. For CSV → JSON, paste CSV text with a header row into the left panel — quoted fields (with embedded commas, quotes, or newlines) are handled per the standard CSV quoting rules.
  4. The converted result appears instantly on the right; copy it once you're happy with it.

Exemplos

JSON array → CSV

Entrada

[{"id": 1, "name": "Ada"}, {"id": 2, "name": "Grace"}]

Saída

id,name 1,Ada 2,Grace

CSV → JSON (with type inference)

Entrada

id,active 1,true 2,false

Saída

[ { "id": 1, "active": true }, { "id": 2, "active": false } ]

Erros comuns

  • Pasting a bare JSON object (not wrapped in an array) for JSON → CSV — the converter needs an array of objects, one per row, to know what a "row" even is.
  • Expecting nested objects/arrays to expand into multiple CSV columns automatically — they're serialized as a single JSON-text cell instead, since CSV has no native nesting.
  • Assuming every CSV cell keeps its original type after a round trip — a value like "01" or "true" as a deliberate string will come back as a number or boolean after CSV → JSON's type inference.

Por que usar esta ferramenta

  • Runs entirely client-side — no data you convert is ever sent to a server.
  • Handles ragged JSON (objects with differing keys) and quoted CSV fields correctly, not just the simplest flat case.
  • Reversible in one tool — swap direction and immediately feed today's output back in as the next input.

Perguntas frequentes