Toolivaro

Free JSON to CSV Converter

Convert a JSON array of objects into RFC 4180 CSV with correct quoting, column union, and copy or download.

The JSON-to-CSV converter flattens a JSON array of objects into a spreadsheet-ready CSV file. Paste an array of objects — an API response, a database export, or test data — and the converter derives the column set from the union of all object keys, serializes every row with RFC 4180 quoting (cells containing commas, quotes, or newlines are quoted and embedded quotes doubled), and emits a CRLF-terminated file. Missing keys become empty cells; nested values are serialized as JSON strings; null and undefined become empty cells. The tool validates the input before converting and explains exactly what is wrong when it is not a non-empty array of objects. Everything runs locally in your browser: pasted JSON never leaves your device, is never logged, and is never transmitted. Copy and download actions deliver the file where you need it. Use this converter to open API data in a spreadsheet, hand a report to a non-technical stakeholder, or prepare CSV imports for tools that reject JSON.

Processed locally in your browser

Processed locally in your browser — data is never uploaded, logged, or stored.

How to use this calculator

How the column set is built

JSON-to-CSV flattens an array of objects into a spreadsheet-ready table, and the first job is deciding the columns. The converter takes the union of every object’s keys in first-seen order: the first object contributes its keys in order, then new keys from later objects are appended. That is the behavior that keeps the output correct when rows disagree — an API response where one user has a city and another does not produces a name, age, city table with an empty cell where city is missing, and every row lines up with the header.

The input contract is strict because the output needs a stable shape: the converter requires a non-empty array of objects. A bare object, an array of strings, or an empty array is rejected with a message that says what was wrong, rather than guessed into a structure that would break downstream.

What happens to values that are not simple text

CSV cells are text, so values are serialized the way the format allows: missing keys become empty cells, null and undefined become empty cells, and nested values — an object or array inside a cell — are serialized as JSON strings, so {"x":1} stays the text {"x":1}. That is the only lossless flat representation: the nested data survives verbatim in the cell, and any spreadsheet software shows it as text.

Numbers and booleans are written as their plain forms (30, true), which is the natural convention for spreadsheet imports. True flattening of deep structures — turning every nested key into its own column — is outside the converter’s scope, and the page says so rather than pretending otherwise.

Quoting and line endings: the RFC 4180 contract

The output follows RFC 4180 exactly so every spreadsheet application opens it correctly: cells containing a comma, a quote, or a line break are wrapped in double quotes, embedded quotes are doubled (""), and rows are terminated with CRLF — the line ending the standard defines and the one spreadsheet tools expect. The worked example shows the pair in action: the cell "New York, NY" is quoted because of its comma, and the file ends every row with CRLF.

Getting these details right is the difference between a file that opens cleanly and one that splits columns or misaligns rows. The converter never produces the unquoted forms that break on the first address containing a comma.

The local promise

API responses, database exports, and test data often contain internal details that should not leave your machine, and converting JSON to CSV is a job no server needs to perform. Everything runs in your browser: the JSON is parsed and serialized locally, nothing is uploaded, logged, or stored, and copy and download actions deliver the CSV file where you need it — a spreadsheet, an import tool, or a stakeholder who asked for the data in a readable form.

How is the result calculated?

Exporting an API response to a spreadsheet

An API returns users with different fields — one has a city, another does not. The converter builds the column set from all keys (name, age, city), emits an empty cell where city is missing, and quotes the cell containing a comma. The result opens directly in spreadsheet software.

Example input and output
Input Value
json [{"name":"Alice","age":"30","city":"Paris"},{"name":"Bob","age":"25"}]
Result name,age,city Alice,30,Paris Bob,25,

What is the formula and its assumptions?

Column set

columns = union of all object keys, first-seen order

Formula terms
Symbol Meaning
union every key that appears in any object

Objects missing a key produce an empty cell in that column — the column order is stable across the file.

Cell quoting (RFC 4180)

quoted ⇔ cell contains comma, quote, or line break

Formula terms
Symbol Meaning
quote a double-quote inside a quoted cell is doubled ("")
line break CRLF is used between rows

What are the most common mistakes?

  • Converting a single object instead of an array — the converter requires a non-empty array of objects and explains why.
  • Expecting nested objects to be flattened — they are serialized as JSON strings, which is the only lossless flat representation.
  • Using an online converter that uploads the JSON — this tool keeps everything on your device.

What are the assumptions and limitations?

  • Input must be a non-empty array of objects; a bare object or array of primitives is rejected with a clear message.
  • Nested values remain JSON strings — true flattening of deep structures is outside the converter’s scope.
  • Very large arrays are processed in memory; the tool is designed for typical payloads, not database dumps.

Where do the numbers come from?

Last reviewed August 4, 2026 · Version 1.0.0 · Toolivaro does not guarantee external content.

Frequently asked questions

How are nested objects converted?

Nested values are serialized as JSON strings inside the cell — for example {"x":1} becomes the text {"x":1}. CSV is a flat format, so deeper structures need flattening or a separate export.

What is the column order?

Columns follow first-seen order across the array: the first object contributes its keys in order, then new keys from later objects are appended. Every row lines up with the header regardless of which object has which keys.

Why does my file end with CRLF?

CRLF is the line ending of RFC 4180 and the convention spreadsheet applications expect. The converter emits it by default so files open correctly everywhere.

Can I convert an object instead of an array?

No — the converter requires a non-empty array of objects, because that is the shape that maps to rows. A bare object is rejected with a clear message; wrap it in an array if that is what you have.

Why do my null values come out as empty cells?

Null and undefined mean "no value here" in JSON, and an empty cell is the honest CSV equivalent — the column position is preserved, and the spreadsheet shows the absence rather than a placeholder that could be mistaken for data.

Part of Developer text and JSON toolkit

Found a mistake or have a correction? Report it — we review every correction.

Was this helpful?

Reviewed by the Toolivaro editorial team per our methodology Methodology · Editorial policy