JSON to CSV Converter
Convert a JSON array of objects into clean CSV ready for Excel or Google Sheets — column headers detected automatically.
How the columns are picked
The converter reads every object in your array and collects their keys in the order it first meets them. Those keys become the header row. An object that lacks a key gets an empty cell in that column, so rows with different fields still line up:
Alan's row has no name, so the cell is blank, and Ada's row has no email. Nothing is dropped and no column is invented. If you paste a single object instead of an array, you get a header row and one data row.
Nested objects and arrays are not flattened
Each cell holds one value, and the converter does not split nested data into extra columns. This is the part most likely to surprise you:
- A nested object such as
addresscomes out as the literal text[object Object]. Its contents are lost. - An array of plain values such as
tagsis joined with commas into one quoted cell:"math,code". truestays as the word true, andnullbecomes an empty cell.
If your records contain objects, flatten them before converting. Rename address.city to a top-level key like address_city, or move each nested field up one level. Then every value lands in its own column.
Commas, quotes and line breaks inside values
A value that contains a comma, a double quote or a line break is wrapped in double quotes, and any quote inside it is doubled. Everything else is written as is, without quotes:
The line break inside lines is kept inside the quoted cell, so the record spans two physical lines. Spreadsheets read this correctly; a script that splits the file on newlines will not.
Numbers and codes that change on the way
Your JSON is parsed before it is written out, so numbers come out in their shortest form: 1.50 becomes 1.5. Integers longer than about 16 digits can't be held exactly, and 12345678901234567890 comes out as 12345678901234567000. Store long IDs as strings in the JSON if you need them intact.
Text values keep their leading zeros, so a ZIP code stored as "02134" is written as 02134. A spreadsheet may still read that column as a number when you open the file and drop the zero. Import the column as text to keep it.
Frequently asked questions
Why is my output a single column called users?+
Your JSON is an object that wraps the array, such as a users key holding the records. The converter treats the wrapper as one row with one column. Paste only the inner array, starting at the square bracket, and each record becomes its own row.
Can I convert an array of plain numbers or strings?+
Not usefully. The columns come from object keys, so an array like 1, 2, 3 has no headers and produces empty lines. Turn each value into an object first, for example with a key called value.
Is the column order the same as in my JSON?+
Yes. Columns follow the order in which keys first appear, reading the records from top to bottom. Keys that only show up in later records are added at the end.
Which separator and line ending does it use?+
Always a comma between fields and a plain line feed between rows. There is no option for semicolons or tabs, so if your spreadsheet expects a semicolon, change the separator in its import dialog.
Embed this tool on your website
Free to use on blogs, school sites and intranets. Paste this code into your page's HTML; please keep the credit line.
<iframe src="https://utilityapp.lat/embed/convert/json-to-csv" title="JSON to CSV Converter" width="100%" height="600" style="border:0;max-width:760px" loading="lazy"></iframe> <p style="font-size:13px"><a href="https://utilityapp.lat/convert/json-to-csv">JSON to CSV Converter</a> by UtilityApp</p>