This tool converts a JSON array of objects into CSV โ and CSV back into JSON โ right in your browser. Pick a direction, paste your data on the left, and get the result on the right. JSON to CSV derives the full column set, flattens nested objects into dot-notation columns, and quotes fields exactly as RFC 4180 requires. CSV to JSON parses quoted fields, embedded commas, and multi-line cells into clean objects. Nothing you paste is transmitted anywhere.
What are JSON and CSV?
JSON (JavaScript Object Notation) is a nested, typed data format used by nearly every web API and config file. CSV (Comma-Separated Values) is a flat, tabular text format understood by spreadsheets, databases, and data-analysis tools. Moving between them is one of the most common chores in day-to-day data work: an API hands you JSON, but a colleague wants a spreadsheet; or a spreadsheet export needs to become the JSON payload for an import.
How JSON becomes CSV
The converter expects a JSON array where every element is an object, for example:
[
{"id": 1, "name": "Ada", "contact": {"city": "London"}},
{"id": 2, "name": "Grace", "contact": {"city": "New York"}}
]
Each object becomes one row. To build the header, the tool scans every object and collects the union of all keys in first-seen order, so even if some rows have extra fields, no column is lost. Rows missing a key simply get an empty cell.
Nested objects are flattened with dot notation: {"contact":{"city":"London"}} becomes a column called contact.city. Nested arrays flatten by index, so a tags array turns into tags.0, tags.1, and so on. This guarantees a genuinely flat, rectangular table that any spreadsheet can open.
Correct escaping (RFC 4180)
Naive CSV generation breaks the moment a value contains a comma, a quote, or a line break. This tool follows the RFC 4180 rules precisely:
| Field contains | How it is written |
|---|---|
| a comma | the whole field is wrapped in double quotes |
| a double quote | each quote is doubled, and the field is wrapped in quotes |
| a newline | the field is wrapped in quotes and the newline is preserved |
| none of the above | written as-is, unquoted |
For example, the value Alan, "The" Turing is written as "Alan, ""The"" Turing". The CSV-to-JSON parser reverses each of these rules exactly, so a value with an embedded comma or newline survives a full round trip unchanged.
How CSV becomes JSON
The first row is treated as the header, and each following row becomes an object keyed by those headers. The parser is a real state machine, not a naive split on commas, so it correctly handles quoted fields that contain commas, doubled quotes, and even line breaks inside a single cell. Both Windows (CRLF) and Unix (LF) line endings are accepted, which covers exports from Excel, Google Sheets, and most databases.
Because CSV has no concept of types, the Typed values option decides what to do with cells that look like numbers or booleans. With it on, 42, true, false, and null become their real JSON types; with it off, everything stays a string. Numeric strings with leading zeros such as 007 are always kept as text so identifiers are never silently mangled.
Common use cases
- Turning an API response into a spreadsheet a non-developer can open.
- Preparing CSV for a bulk import that expects JSON.
- Flattening nested API data into columns for quick analysis or a pivot table.
- Sanity-checking that a CSV export parses cleanly before loading it into a database.
Runs entirely in your browser
The whole conversion happens on your device with plain JavaScript โ there is no server round-trip, no logging, and no third-party analytics on this page. That makes it safe for internal exports and data you would rather not upload. For the most sensitive files you can load the page once and then work offline. Use the Sample button to see a representative input for whichever direction you have selected, and Download to save the result as a .csv or .json file.