JSON to CSV Converter (and CSV to JSON)
Convert between JSON and CSV with comma, tab, semicolon or pipe delimiters. Nested objects are kept as JSON text in one cell.
Runs in your browser. No data leaves your device.
About this tool
Converts a JSON array of objects to CSV, or CSV text to a JSON array, in the browser. For moving data between APIs and spreadsheets. Conversion is live as you type, with a manual toggle for direction and a delimiter selector.
Features
- Two modes, chosen with a toggle: JSON to CSV and CSV to JSON; switching mode moves the converted output into the input, so you can convert back
- Delimiters: comma, tab, semicolon, or pipe (applies to both directions)
- JSON to CSV builds the header from the union of all keys across all objects, in first-seen order; missing keys become empty cells
- Fields containing the delimiter, a double quote, or a newline are wrapped in quotes, with inner quotes doubled
- Nested objects and arrays are written into a single cell as JSON text (not flattened)
- CSV to JSON follows RFC 4180: quoted fields may contain the delimiter, escaped "" quotes, and line breaks; CRLF, LF, and CR line endings all work
- Values are converted only when nothing is lost: "true"/"false" become booleans, "null" or empty cells become null, and numbers become numbers only if they read back identically ("30" -> 30, but "007", "1.50", "1e3", and long digit strings stay text)
- Load Sample fills an example for the current mode (the CSV sample uses the selected delimiter)
- Live conversion as you type; Copy, Pipeline, and Download (converted.csv or converted.json) for the output; errors appear under the output box
How to use it
- Choose JSON to CSV or CSV to JSON
- Pick the delimiter that matches your data
- Paste your data (or click Load Sample); the output updates immediately
- Copy the output or click Download
Inputs
- JSON to CSV: a non-empty JSON array of objects
- CSV to JSON: text with a header row and at least one data row, separated by the chosen delimiter
Outputs
- CSV text with a header row, rows joined by \n (LF)
- JSON array of objects, pretty-printed with 2-space indentation
- Download as converted.csv (text/csv) or converted.json (application/json); copy to clipboard; send via Pipeline
Limits and notes
- Input JSON must be an array of objects; a single top-level object, an empty array, or an item that is not an object (null, a number, a nested array) gives an error naming the item
- CSV values are not trimmed (" 30" stays the text " 30"); blank lines are skipped
- Header names are trimmed; extra values beyond the header count are dropped and missing ones become null
- No file upload; paste text only
- Nothing is saved to localStorage; runs entirely in the browser with no upload
Frequently Asked Questions
How does the JSON to CSV Converter work?
For JSON to CSV, the tool takes an array of objects, collects every unique key across all objects as the header row, and writes each object as a row. Nested objects and arrays go into one cell as JSON text, and fields containing the delimiter, a quote, or a line break are wrapped in quotes. For CSV to JSON, it parses the text per RFC 4180 (quoted fields may hold delimiters, "" quotes, and line breaks; CRLF line endings and a leading BOM are handled), uses the header row as keys, and maps each following row to an object. Values become JSON types only when nothing is lost: true/false become booleans, empty or null cells become null, and numbers convert only if they read back identically, so "007" and "1.50" stay text.
Can I convert CSV to JSON too?
Yes. Use the toggle at the top to choose JSON to CSV or CSV to JSON, then paste your data. The direction is not auto-detected, so pick the mode that matches your input.
How does it handle nested JSON objects?
Nested objects and arrays are not flattened. Each nested value is written into a single CSV cell as JSON text, so { "user": { "name": "John" } } produces a "user" column containing {"name":"John"}.
What delimiters are supported for CSV?
Comma (default), tab, semicolon, and pipe characters. Choose the delimiter that matches your data source or target application.