JSON ⇄ CSV Converter
Convert a JSON array of objects to RFC 4180 CSV, and convert CSV back to JSON.
Paste a JSON array of objects on the left.
What is JSON ⇄ CSV Converter?
CSV (Comma-Separated Values) is a plain-text tabular format defined by RFC 4180 in which each row is a record and each field is separated by a comma, with fields that contain commas, double quotes, or line breaks wrapped in double quotes. JSON, by contrast, describes data as nested objects and arrays. Converting between the two is a routine chore when moving data into and out of spreadsheets, databases, and analytics tools: a JSON array of flat objects becomes a CSV table whose header row is the union of the object keys, and a CSV table becomes a JSON array whose objects are keyed by the header. This tool performs both directions, quoting and escaping fields per RFC 4180 on the way out, and parsing quoted fields, embedded newlines, and doubled quotes on the way back. It also optionally coerces CSV cell text into native JSON types (numbers, booleans, and null) so that a round-trip through CSV does not turn every number into a string and lose the original typing.
How to Use JSON ⇄ CSV Converter
- Choose JSON → CSV or CSV → JSON using the tabs at the top.
- Paste your JSON array of objects, or your CSV text, into the input box on the left.
- Adjust the delimiter (comma, semicolon, tab, or pipe) if your data uses a non-standard separator; for CSV → JSON you can toggle type coercion on or off.
- Read the converted result on the right and copy it, or click Use output as input to round-trip the data.
Examples
JSON array to CSV
Input: [{"name":"Ada","born":1815},{"name":"Alan","born":1912}]
Output: name,born Ada,1815 Alan,1912
Quoting a comma
Input: [{"city":"New York, NY","pop":8000000}]
Output: city,pop "New York, NY",8000000
CSV to JSON with coercion
Input: name,active Ada,true Alan,false
Output: [ { "name": "Ada", "active": true }, { "name": "Alan", "active": false } ]
Common Mistakes
- Splitting CSV on commas with a naive String.split — this breaks the moment a quoted field contains a comma. Always use a real RFC 4180 parser like the one here.
- Forgetting to double the quotes inside a quoted field, which shifts every following field on that row when the CSV is read back.
- Leaving type coercion on for data like phone numbers or ZIP codes that start with 0 — they become numbers and lose the leading zero. Turn coercion off for identifier columns.
- Expecting a single JSON object (rather than an array) to convert — only a top-level array of objects maps cleanly to rows, so a bare object is rejected with an error.
Why Use This Tool
- Strict RFC 4180 quoting and unquoting, including fields that contain commas, quotes, or embedded newlines.
- Both directions in one tool, with a one-click round-trip via Use output as input.
- Optional type coercion so numbers, booleans, and null survive the trip through CSV instead of becoming strings.
- Choice of delimiter (comma, semicolon, tab, pipe) for locales and spreadsheets that do not use the comma as a separator.