JSON to CSV Converter
Paste JSON — an array of objects or a single object — and get clean CSV ready for Excel or Google Sheets, with proper quoting and flattened nested fields.
JSON to CSV Converter
Nested objects are flattened one level with dot keys (address.city). Fields containing commas, quotes, or line breaks are quoted per RFC 4180. Arrays inside a field are kept as JSON text.
RFC 4180 quoting rules:
A field containing a comma, a double quote, or a line break must be wrapped in double quotes, and each double quote inside it is doubled. Example: say "hi" becomes "say ""hi""".
Why Convert JSON to CSV?
JSON and CSV are the two most common formats for moving tabular data around, but they serve different audiences. JSON is the native language of web APIs and JavaScript: it is structured, nested, and precise, and every API on the internet speaks it. CSV is the native language of spreadsheets: it is flat, simple, and opens directly in Excel, Google Sheets, and every data tool ever made. When you need to hand API data to a person, or load it into a spreadsheet for analysis, converting JSON to CSV is the bridge between the two worlds.
The conversion is not always trivial, because JSON can express things CSV cannot. JSON supports nested objects, arrays, and mixed types; CSV is a flat grid of rows and columns where every cell is text. A good converter has to make sensible decisions about those mismatches: flatten nested objects into dotted column names, turn arrays into readable text, and quote values that contain commas or quotes so the spreadsheet does not misread them. This tool does all of that, in your browser, without uploading your data anywhere.
How to Use This Converter
Paste your JSON into the input box. It can be an array of objects, which is the usual shape of API data, or a single object, which becomes a one-row table. The CSV appears in the output box as you type, along with the row and column counts. Use the Copy CSV button to copy the result, then paste it into a spreadsheet or save it as a .csv file. If your JSON has a syntax error, the tool shows the error message instead of a partial result, so you can fix the JSON and try again.
The default example shows a typical case: two people with a name, an age, and a city. The city values contain commas, so they are wrapped in double quotes in the output: Ann,30,"New York, NY". Without those quotes, a spreadsheet would split "New York, NY" into two columns and misalign the whole row. That quoting is the single most important thing a JSON to CSV converter does, and it is what separates a correct conversion from a broken one.
How Nested Objects Are Handled
CSV has no nesting, so nested JSON objects are flattened one level with dot keys. An object such as {"name": "Ann", "address": {"city": "Austin", "zip": "78701"}} becomes a row with three columns: name, address.city, and address.zip. The dot keeps the original structure visible in the column name, so you can tell at a glance that city came from inside address. Values nested more than one level deep, and arrays, are kept as compact JSON text inside a single cell, so no data is silently dropped.
Columns are collected from every row in the order they first appear, and rows that are missing a column get an empty cell in that position. So converting [{"a": 1}, {"b": 2}] gives a two-column table with headers a,b, where the first row is 1 followed by an empty cell and the second row is an empty cell followed by 2. This union-of-keys approach means the output always has a consistent shape, even when your JSON rows are ragged, which is common with real API data.
The Quoting Rules: RFC 4180
CSV quoting follows RFC 4180, the standard published in 2005 that describes the common format of comma-separated values. The rules are short but strict. A field that contains a comma, a double quote, or a line break must be enclosed in double quotes. A double quote inside a quoted field is written as two double quotes. So the value say "hi" becomes "say ""hi""" in CSV: the outer quotes mark the field, and the doubled inner quotes represent the literal quote characters. A field with none of those special characters needs no quotes at all.
Following these rules matters because every spreadsheet program implements them, and most CSV parsers expect them. A converter that skips quoting, or quotes everything, produces files that look right in a text editor but break when opened: columns shift, quotes appear as literal characters, and rows split in the middle. This tool quotes exactly the fields that need it, which keeps the output clean and readable while staying correct. Newlines inside a value are preserved inside the quoted field, so multi-line addresses and notes survive the conversion intact.
Worked Example
Suppose an API returns a list of orders: [{"id": 101, "customer": "Ann Lee", "total": 49.99, "address": {"city": "Denver", "zip": "80202"}}, {"id": 102, "customer": "Bob Ray", "total": 19.5, "address": {"city": "Miami", "zip": "33101"}}]. The converter flattens the nested address objects, giving five columns: id, customer, total, address.city, and address.zip. The output is three lines: the header row, then one row per order. The numbers keep their values as text, 49.99 and 19.5, and the cities need no quotes because they contain no commas.
Now change one city to "Salt Lake City, UT". The value contains a comma, so the converter wraps it in quotes: the row becomes 102,Bob Ray,19.5,"Salt Lake City, UT",33101. Paste that into a spreadsheet and the city lands in a single cell, exactly as it should. If the customer name were Ann "Annie" Lee, the quotes inside the name would be doubled: "Ann ""Annie"" Lee". These details are invisible when they work and infuriating when they do not, which is why a converter you can trust is worth having.
Tips for Working With CSV Output
Open the file correctly in Excel. Double-clicking a CSV file usually opens it with the right columns, but if your data contains non-English characters and they appear garbled, use Excel's import wizard and choose UTF-8 encoding. Google Sheets handles UTF-8 automatically when you import a CSV file.
Watch out for leading zeros. Spreadsheets treat cells that look like numbers as numbers, so a ZIP code such as 02134 can lose its leading zero and become 2134. If your data has codes with leading zeros, import the CSV through the spreadsheet's import dialog and set those columns to Text.
Keep the header row. The first line of the output is the column names, and most tools expect it. If you strip it, the first data row can be mistaken for headers. If your target system wants no header, remove it deliberately after importing, not before.
Check the row count. The result summary tells you how many rows and columns were produced. If the row count does not match your JSON, look for rows that are not objects, such as a stray null or a nested array at the top level, which this tool reports as an error rather than converting silently.
Remember that CSV loses types. In JSON, 30 is a number, true is a boolean, and null is null. In CSV, everything is text: 30, true, and an empty cell. When you convert back, or load the CSV into a database, you may need to restore the types yourself. That is a limitation of the CSV format, not of this converter.
Frequently Asked Questions
Can I convert a single JSON object, not an array?
Yes. A single object becomes a one-row CSV table: its keys become the header row and its values become the single data row. An array of objects becomes one row per object.
How are nested objects handled in the CSV?
Nested objects are flattened one level with dot keys, so {"address": {"city": "Austin"}} becomes a column named address.city. Deeper nesting and arrays are kept as compact JSON text in a single cell so no data is lost.
Why are some values wrapped in double quotes?
That is RFC 4180 quoting: any field containing a comma, a double quote, or a line break must be wrapped in double quotes, and quotes inside it are doubled. It keeps values like "New York, NY" in a single spreadsheet cell.
What happens if my rows have different keys?
The output uses the union of all keys, in the order they first appear, and rows missing a key get an empty cell in that column. So [{"a": 1}, {"b": 2}] produces headers a,b with rows 1, and ,2.
Is my JSON data uploaded anywhere?
No. The conversion runs entirely in your browser with JavaScript. Your data is never sent to a server, stored, or logged, so it is safe to convert sensitive API responses and business data.