Data & Format / JSON Tools
JSON to CSV
JSON to CSV converts a JSON array of objects into a table and converts it back, applying an explicit flattening rule to nested values so the output is predictable, and reporting what a round trip changes so you are never surprised by lost structure.
This space is reserved for a sponsor. Every tool on this site stays free and runs locally in your browser.
This space is reserved for a sponsor. Every tool on this site stays free and runs locally in your browser.
How to use
- 1
Paste your JSON
An array of objects works best, whether the objects are flat or nested several levels deep. Paste it into the left box; nothing is uploaded because the conversion runs locally in your browser.
- 2
Choose the direction
Switch between JSON to CSV and CSV to JSON with the direction control. The same tool handles both ways, so you do not need a separate converter for each direction.
- 3
Understand how nesting is flattened
Nested objects become column names joined by a dot, so an address object with a city member becomes a column named address.city. Arrays of values are joined with a separator, and arrays of objects are repeated or expanded depending on the chosen mode. The exact rule is shown next to the output so the result is never a mystery. If a particular column combination is awkward in your downstream spreadsheet, you can rename it, but the dot convention is what most CSV consumers understand, so keeping it makes the file portable across tools.
- 4
Read the table
The CSV appears on the right with one header row and one row per record. Values that cannot be flattened into a single cell, such as a deep object inside an array, are written back as JSON text in that cell so no data is silently dropped. This reversible encoding means those cells can be round-tripped back into JSON later without losing the nested structure they carried.
- 5
Check the round trip
Convert the CSV back to JSON and compare it with what you started from. Some structure is lost on the way through a flat table, and the check surfaces precisely what changed so you can decide whether the table form is safe for your use.
- 6
Copy or download
Copy the result to your clipboard to paste into a spreadsheet, or save it as a csv file. The conversion touches only the text you pasted; nothing leaves your machine.
Key facts
- CSV grammarRFC 4180 describes the common CSV grammar: comma as the separator, an optional header row, and fields quoted with double quotes when they contain the separator.Source:RFC 4180
- Flattening ruleNested objects are flattened with dot-separated keys; this is a widely used convention rather than a standard, so different converters disagree about the exact output.Source:This tool
- Type lossCSV stores every value as text, so numeric and boolean types are not preserved across a JSON to CSV to JSON round trip.Source:RFC 4180
- Number precisionJSON numbers larger than 2^53 - 1 are not exactly representable, and converting to text and back does not restore the lost precision.Source:RFC 8259 §6
- Round tripA JSON to CSV to JSON conversion is lossy for nested structure; this tool reports what changed when you reverse it so the loss is visible.Source:This tool
- PrivacyConversion runs entirely in the browser; no document is uploaded or stored.Source:This tool
Frequently asked questions
Does this tool upload my JSON?
No. The conversion runs entirely in your browser using the JavaScript engine it already loaded, and no request leaves your machine. The payloads people convert are frequently extracts of production data, API responses containing tokens, or customer exports, so any service that round-trips your text through a server has written it into that server logs. You can verify this yourself: open the developer tools, watch the network panel, paste a document and convert it. No request appears. The only browser interface the page uses is the clipboard, and only when you press Copy.
How are nested JSON objects flattened into CSV?
Nested objects are flattened with dot-separated column names: a member at user.address.city becomes the column user.address.city, and the same rule recurses for deeper nesting. Arrays of primitive values are joined into a single cell with a separator such as a semicolon, because a CSV cell holds one string. Arrays of objects are the interesting case: in expand mode each array element becomes its own set of columns suffixed with an index like items.0.name and items.1.name, and in repeat mode each element becomes its own output row. The precise behavior is printed next to the output, because flattening is a convention, not a standard, and different tools disagree about it. When the same object nests at two levels the names simply stack, so a.b.c is a legitimate column and the rule stays predictable no matter how deep the data goes, which is why the tool prints the rule it applied instead of hiding it.
Why doesn't converting back give me the original JSON?
Because CSV is a flat table and JSON is a tree. When JSON becomes CSV, nested objects are flattened to dotted column names, type information is lost because everything is text, and arrays of differing lengths are coerced into the same columns. Converting that CSV back produces a table-shaped JSON, not your original tree, and numbers may come back as strings. This is inherent to the formats, not a bug: the tool round-trip check exists precisely to show you what changed so you can decide whether the table form is acceptable for what you intend to do with it.
How are arrays handled during conversion?
Arrays of primitive values such as a list of tags are joined into one cell with a separator, so they survive as readable text. Arrays of objects are either expanded into indexed columns, items.0.x and items.1.x, when you want to keep them in one row, or repeated into multiple rows when each element should be its own record. When an array is shorter or longer than its siblings, the missing cells are left empty rather than fabricated, so the data you see is the data you had.
Will my numbers stay numbers after the round trip?
Not reliably. CSV stores every value as text, and JSON has a distinct number type, so when CSV is converted back the tool has to guess whether 123 is a number or a string that happens to look like one. Most parsers will turn a column of pure digits back into numbers, but a value like 007 or a phone number will come back as the string 007 or may be reinterpreted, and a leading zero or a large integer can shift. If numeric fidelity matters, keep the data in JSON or annotate the columns on the way back rather than trusting the guess.
Can it handle very large JSON?
The conversion runs in your browser, so the limit is the memory of the tab rather than any server quota. A few thousand rows convert instantly; hundreds of thousands may take a moment and a very large document can exhaust memory. If you regularly convert huge arrays, split the input into chunks or convert only the fields you need, which also keeps the resulting CSV readable and small enough to open in a open in a spreadsheet.
How are special characters, commas and quotes handled in the CSV?
CSV escaping follows RFC 4180: when a field contains the comma separator, a double quote, or a line break, the whole field is wrapped in double quotes and any double quote inside it is doubled. This tool applies that rule on the way out, so a value like New York, NY becomes "New York, NY" and a sentence with a quote becomes "He said ""hi"""". On the way back the same rule is parsed, so quoted fields are restored exactly, including their internal commas and quotes. The trap is the separator itself: if your data uses commas inside values and you also intend the comma as a field separator, the only safe signal is the quoting, which is why the output always quotes such fields rather than relying on position. Tabs and semicolons are not separators here, so a tab inside a value is preserved verbatim and does not split the cell. If your downstream consumer expects a different delimiter, convert with the comma form and re-save in that application, because changing the delimiter mid-conversion is where rows silently gain or lose columns. Encoding is the other quiet failure: CSV has no declared character set, so a file saved as anything other than UTF-8 may render as mojibake in a reader that assumes UTF-8, and this tool reads and writes UTF-8 consistently so accented text and non-Latin scripts survive the round trip. The other common surprise is leading zeros: a postal code 01234 written as a bare JSON number may be read back as 1234 by a spreadsheet, losing the zero, whereas quoting it as text on the JSON side preserves it. For maximum portability keep values free of embedded newlines, or accept that only RFC 4180-compliant readers will parse them.
Related tools
JSON Formatter
Paste JSON to pretty-print it with consistent indentation, minify it to one line, or find the exact line and column of a syntax error. Runs locally.
JSON to YAML
Convert JSON to YAML and YAML to JSON in your browser, with a clear note on what the round trip loses: comments, anchors, multiple documents and key order.
JSON to XML
Convert JSON to XML and XML to JSON with the array mapping rules spelled out, so the output matches what your downstream consumer expects.
This space is reserved for a sponsor. Every tool on this site stays free and runs locally in your browser.