Xerobit

JSON to CSV Converter

Paste a JSON array of objects to convert it into comma-separated values instantly. This json to csv converter flattens nested objects, handles commas inside strings and lets you pick a delimiter. It runs entirely in your browser so no data is uploaded anywhere.

A valid JSON array of objects.

CSV Output

name,age
Alice,30
Bob,25

How to use the json to csv converter

  1. Paste your JSON array of objects into the JSON input field.
  2. Choose a delimiter such as comma, semicolon, tab or pipe.
  3. Toggle Include header row on or off depending on your needs.
  4. Copy the generated CSV output from the result box.

How the json to csv conversion works

The converter reads each object in the JSON array and collects every key to build a unified column list. If an object lacks a key found in another object, that cell is left empty. Nested objects are flattened using dot notation: {"user":{"name":"Alice"}} becomes a column called user.name. This makes the json to csv transformation predictable even when your source data has depth.

Values are formatted according to standard CSV rules. Strings containing the chosen delimiter, double quotes or newlines are wrapped in double quotes. Any double quote inside a string is escaped by doubling it. Numbers, booleans and nulls are written without quotes. The result is a plain text table you can save as a .csv file or paste directly into a spreadsheet application.

Example conversion

Consider this input:

[{"id":1,"name":"O'Brien, Pat","active":true},{"id":2,"name":"Lee"}]

With a comma delimiter and headers enabled, the output is:

idnameactive
1"O'Brien, Pat"true
2Lee

Notice how the comma inside the name forces the value to be quoted, and the missing active field for the second row produces an empty cell. When you convert json to csv, these quoting rules ensure that spreadsheet programs parse each field correctly without splitting a single value across multiple columns.

Choosing the right delimiter

Comma is the default for CSV files, but it causes problems when your data naturally contains commas, such as addresses or names. Semicolons are common in European locales where commas serve as decimal separators. Tab-separated values work well for pasting into spreadsheets because tabs rarely appear in normal text. Pipe characters are useful for log files or data pipelines where neither commas nor tabs are safe.

Select the delimiter that matches your target application. The converter applies the same quoting rules regardless of which character you choose. A json to csv tool that supports multiple delimiters saves you from having to run find-and-replace operations after the export.

Common mistakes to avoid

A frequent error is passing a single JSON object instead of an array. The tool expects [{...}], not {...}. Wrap your object in square brackets if needed. Another issue arises with deeply nested structures. While one level of nesting flattens cleanly, arrays inside objects are converted to their JSON string representation so they fit into a single cell. If you need fully normalized tables, flatten the data before converting.

Finally, ensure your JSON is valid. Trailing commas, unquoted keys or single quotes will cause parsing to fail. You can use a json validator to check syntax first, or a formatter to clean up messy input. Invalid JSON is the most common reason a json to csv conversion fails silently or throws an error.

Worked examples

Each result below was produced by the same code the tool runs, so you can check your own numbers against them.

ExampleInputResult
Simple arrayJSON input: [{"name":"Alice","age":30},{"name":"Bob","age":25}]; Delimiter: ,; Include header row: yesname,age / Alice,30 / Bob,25
Nested objectsJSON input: [{"id":1,"user":{"first":"Jane","last":"Doe"}},{"id":2,"user":{"first":"John"}}]; Delimiter: ,; Include header row: yesid,user.first,user.last / 1,Jane,Doe / 2,John,
Semicolon delimitedJSON input: [{"city":"Paris","pop":2161000},{"city":"Lyon","pop":515695}]; Delimiter: ;; Include header row: yescity;pop / Paris;2161000 / Lyon;515695

FAQ

Does this tool upload my data to a server?

No. The json to csv conversion happens entirely in your browser using JavaScript. Nothing is sent over the network.

Can I convert a single JSON object?

The converter expects an array of objects. Wrap a single object in square brackets like [{"key":"value"}] to make it work.

How are nested objects handled?

Nested objects are flattened using dot notation. For example, {"a":{"b":1}} produces a column named a.b with the value 1.

What happens if some objects have different keys?

The converter collects all unique keys across every object to form the columns. Missing values are left as empty cells in the CSV output.

Why would I use a semicolon instead of a comma?

Semicolons prevent conflicts when your data contains commas, which is common in European number formats or free-text fields.

Are arrays inside objects supported?

Arrays are serialized as JSON strings within a single cell. For fully flat tables, restructure the data before converting.