Converters

JSON ↔ CSV Converter

Convert JSON to CSV and back — handles nested objects, runs in your browser.

  • Free forever
  • No sign-up
  • Runs in your browser
Share X LinkedIn
Delimiter

JSON input

CSV output

Your converted CSV will appear here.

Conversion happens locally in your browser. Your data is never uploaded.

JSON and CSV: two ways to hold the same data

JSON (JavaScript Object Notation) and CSV (comma-separated values) are both everywhere, but they solve different problems. JSON is hierarchical: objects nest inside objects, arrays hold lists, and a record can be as deep as you like. It is the native language of APIs and config files. CSV is flat: a header row of column names followed by rows of values, nothing more. It is the native language of spreadsheets, databases and bulk imports.

Most real-world work involves moving between the two. You pull a JSON response from an API and need it in Excel. You export a CSV from a database and need it as JSON for a script. This JSON ↔ CSV converter does both directions in one place, flattening nested structures automatically, and it runs entirely in your browser — no upload, no account, no server round-trip.

How to use it

  1. Pick a direction at the top: JSON → CSV or CSV → JSON. Click Sample to load an example and watch how nesting is handled.
  2. Paste your data into the input box. For JSON → CSV, paste an array of objects (a single object also works and becomes one row). For CSV → JSON, paste CSV that starts with a header row.
  3. The output updates live underneath. If something is malformed, a clear error message appears instead — clean up messy JSON first in the JSON Formatter if you need to.
  4. Choose a delimiter (comma, semicolon or tab) if your CSV does not use commas — semicolons are common in European locales, tabs in data exports.
  5. Use Copy or Download to save the result as a .csv or .json file, Swap direction to round-trip it back, or Clear to start fresh.

How nested data is flattened

A CSV is a grid: rows and columns, no nesting. JSON has no such limit, so the converter has to project a tree onto a flat table. It does this by flattening nested objects into dotted column names:

{ "name": "Ada", "address": { "city": "London", "zip": "EC1" } }

becomes two columns, name and address.city and address.zip:

name,address.city,address.zip
Ada,London,EC1

This keeps every value addressable by a single, predictable column name. Arrays inside a record are a different story — a list has no fixed number of columns, so the converter serialises each array back into a compact JSON string and stores it in one cell. That keeps the data lossless and the grid rectangular, and you can parse those cells later if you need the individual items.

When you convert CSV back to JSON, the header row becomes the object keys and each data row becomes one object. Values are type-inferred, so 42 comes back as the number 42, true as a boolean, and empty cells as nulls — not as quoted strings.

Common pitfalls (and how this tool handles them)

CSV looks trivial until real data hits it. The classic traps:

  • Commas inside values. A field like Smith, Jane would split into two columns if written naively. The converter wraps any value containing the delimiter in double quotes, which is the correct CSV escape.
  • Quotes inside values. A quotation mark inside a quoted field is doubled ("") per the CSV spec, so the value survives the round trip intact.
  • Line breaks inside a cell. Multi-line values are quoted so the newline stays inside the field instead of starting a new row.
  • The wrong delimiter. A semicolon-separated file parsed as comma-separated lands everything in one column. Match the delimiter selector to your file and the columns line up.
  • Encodings. Stick to UTF-8. A file saved in a legacy encoding can turn accented characters into garbled bytes; if accents look wrong, re-save the source as UTF-8 before converting.
  • Missing keys across records. When some objects have a field others lack, the CSV still gets a column for it — rows that do not have the value simply leave that cell empty.

Spreadsheet import tips

  • Excel and the delimiter. Excel honours the list separator from your system locale. If a comma-separated file opens with everything jammed in column A, either re-export with a semicolon (use the delimiter selector here) or use Excel's Data → From Text/CSV import and pick the delimiter manually.
  • Leading zeros and long numbers. Spreadsheets like to "helpfully" strip leading zeros from things like ZIP codes and truncate long IDs. If you need them preserved, import the column as text rather than letting the spreadsheet auto-detect the type.
  • Google Sheets. File → Import lets you choose the separator and whether to convert text to numbers, which avoids most of the surprises above.
  • Round-tripping. Converting JSON → CSV, editing in a spreadsheet, then exporting and converting CSV → JSON is a fast way to bulk-edit structured data without writing a script.

In-browser vs server-side converters

Many online converters send your file to their server to do the work. For a list of public sample data that is harmless, but plenty of the JSON and CSV people convert is anything but — exports of customer records, order histories, internal identifiers, access logs. Uploading those to a third-party endpoint quietly turns "convert this file" into "share this file". In November 2025, a popular server-side formatter leaked pasted content through a saved-session feature, exactly the kind of exposure that local tools avoid by design.

This converter runs the parsing and serialising locally in your browser. Your data is never transmitted, never stored, and is gone the moment you close the tab. You get the convenience of a web tool without handing your data to anyone — convert it, copy or download the result, and move on. If you need YAML rather than CSV, the JSON ↔ YAML Converter handles that pairing the same way.

Frequently asked questions

Comet's got your back

Stuck on something? Every tool has a short guide and FAQ — and Comet can point you to the right spot.

Visit help centre