</>CodeScrub

JSON ↔ CSV Converter

Paste JSON or CSV. Convert instantly. Handles nested data.

JSON Input
CSV Output
Output will appear here.
Ctrl + Enter convertCtrl + Shift + C copyCtrl + D download
Ad space · json-csv-mid

How to Convert JSON to CSV

  1. Pick JSON → CSV at the top and paste your JSON into the input panel (or click Sample to try it).
  2. The output panel updates automatically. Nested objects are flattened into dot-notation columns, mixed-shape rows are aligned, and you can choose comma, semicolon, tab, or pipe as the delimiter.
  3. Hit Copy or Download to grab the resulting .csv file.

How to Convert CSV to JSON

  1. Switch to CSV → JSON and paste your CSV. The delimiter is detected automatically — comma, semicolon, tab, and pipe all work without configuration.
  2. The right-hand panel shows pretty-printed, syntax-highlighted JSON. Toggle Infer types to coerce "42" into a number and "true" into a boolean, or leave everything as strings.
  3. Copy or download the result as a .json file.

Handling Nested JSON

Most online converters give up the moment your JSON has a nested object. CodeScrub flattens nested keys into dot notation so they survive the round trip. Given:

{ "user": { "name": "Ada", "address": { "city": "London" } } }

you get a CSV with the columns

user.name, user.address.city

Going the other way, toggle Unflatten dot keys in CSV → JSON mode and those columns rebuild into a proper nested object. Arrays inside objects are expanded into rows when the structure is unambiguous, so an API response with { meta, users: [...] } becomes one CSV row per user with the meta repeated.

Supported Formats

  • Comma-separated (CSV)
  • Semicolon-separated (common in European exports)
  • Tab-separated (TSV)
  • Pipe-separated

On CSV → JSON, the delimiter is auto-detected. Quoted fields, escaped commas, and inconsistent column counts are all handled correctly. Everything runs in your browser — your data is never uploaded anywhere.