JSON ↔ CSV Converter
Convert between JSON and CSV formats instantly. Perfect for data migration, spreadsheet exports, and API integrations.
JSON Input
0 charactersCSV Output
CSV output will appear here...
JSON Requirements
- • Must be an array of objects
- • Each object becomes a row
- • Object keys become column headers
- • Nested objects are stringified
CSV Output Features
- • First row contains headers
- • Values with delimiters are quoted
- • Compatible with Excel, Google Sheets
- • Custom delimiter support
Converting a Tree Into a Table
JSON describes a tree and CSV describes a grid, and there's no lossless mapping between the two. Understanding where information gets flattened tells you whether the output you're about to hand to a spreadsheet is actually going to say what you meant.
Nested objects and the array problem
A nested object flattens cleanly enough by joining the key path into a single column name, so an address containing a city becomes an address.city column. Arrays are genuinely harder, because a row can hold only one value per column. The three available answers are to join the items into one cell with a separator, to spread them across numbered columns, or to repeat the parent row once per item. Each loses something: the first makes the values hard to filter, the second breaks when array lengths vary between records, and the third duplicates the parent data.
Quoting is a real specification
CSV looks trivial and isn't. Under RFC 4180, any field containing a comma, a double quote, or a line break must be wrapped in double quotes. A literal double quote inside a quoted field is escaped by doubling it. This is why a text field with an embedded quotation mark is the most common cause of a file that opens with columns mysteriously shifted from a certain row onward.
What Excel will do to your data
Spreadsheets apply type guessing on open, and it isn't reversible once saved. Identifiers with leading zeros lose them, so a product code of 00421 becomes 421. Long numeric strings past fifteen digits get converted to scientific notation and the trailing digits are replaced with zeros, which quietly destroys order numbers and barcodes. Values that resemble dates get reformatted, which is the well-known reason certain gene names were renamed by researchers who got tired of fighting it. If a column is an identifier rather than a quantity, it wants to be treated as text.
Character encoding is the other recurring trap. Excel on Windows will misread UTF-8 accented characters unless the file carries a byte order mark. Exported names sometimes arrive with mojibake even though the JSON was perfectly correct.
A security note worth knowing
If a cell value begins with an equals sign, a plus, a minus, or an at sign, a spreadsheet may interpret it as a formula rather than text. When the JSON came from user input, this becomes a genuine injection risk for whoever opens the file. Anyone exporting untrusted data to CSV should prefix such values with an apostrophe or otherwise neutralize them before distribution.
Related Tools
Explore more free tools to boost your productivity
JSON to XML Converter
Convert JSON objects to XML format for data interchange
YAML to JSON Converter
Convert YAML configuration files to JSON format
Text to HTML Converter
Convert plain text to HTML with proper tags and encoding
Case Converter
Convert text between 10 case styles: UPPER, lower, Title, camelCase
Binary Translator
Convert text to binary code and binary back to text instantly
JSON Formatter
Format and pretty-print JSON with syntax highlighting