Home / Converters

JSON to CSV Converter

Runs locally in your browser. Your input is not uploaded.

A JSON to CSV converter turns object records into rows and properties into columns. Paste an array of objects, choose a delimiter, and review the generated CSV before copying or downloading it. Nested objects can be flattened into dotted column names, while missing values, arrays, spreadsheet types, and formula-like strings require deliberate handling.

How to Use the JSON to CSV Converter

Choose settings based on the spreadsheet or import system that will read the result.

  1. Paste valid data into JSON input.
  2. Choose Comma, Semicolon, or Tab from Delimiter.
  3. Leave Flatten nested objects enabled to turn a value such as {"address":{"city":"Rabat"}} into the column address.city, or disable it when nested values should remain structured cell content.
  4. Leave Include header row enabled when the first CSV record should contain column names.
  5. Select Convert to refresh CSV output. Conversion also runs live as you type.
  6. Review the read-only CSV output for columns, quoted values, and empty cells.
  7. Select Copy to place the result on the clipboard or Download .csv to save it.

Mapping JSON Objects to CSV Rows and Columns

The expected input is an array of objects, with one object per output row. A single object becomes one row. If the root is an array of primitive values, the converter creates one column named value.

[
  {"id": "0012", "name": "Amal", "active": true},
  {"id": "0013", "name": "Noah", "city": "Rabat"}
]

Columns are the union of keys found across all rows in first-seen order. The example produces id, name, active, and then city. A property absent from a particular object becomes an empty cell, so the first row has no city and the second has no active value.

This union is convenient for irregular records, but it is not schema validation. A misspelled key such as acitve becomes a new column rather than an error. Review headers and validate input against a known schema when column consistency matters.

null also becomes an empty cell. CSV cannot distinguish that output from a missing property or an intentionally empty string without an external convention. Preserve the original JSON when those states have different meanings.

Flattening Nested Objects and Storing Arrays

With Flatten nested objects enabled, nested property paths become dotted headers. This converts address.city into a directly usable spreadsheet column without creating a separate table. Deeper objects continue the path, such as customer.address.postalCode.

[
  {
    "name": "Amal",
    "address": {"city": "Rabat"},
    "tags": ["trial", "newsletter"]
  }
]

The array remains JSON text inside one cell, such as ["trial","newsletter"]. It is not expanded into an arbitrary number of columns because rows may have arrays of different lengths and meanings. A list of order items often belongs in a separate related CSV rather than one cell.

Dotted paths can conflict when source keys already contain periods or when one record uses address as text and another uses it as an object. Inspect the resulting headers before building an automated import around them. Flattening is a representation choice, not a normalized relational model.

CSV Quoting and RFC 4180 Rules

The converter quotes fields itself, in the browser. A value containing the delimiter, a double quote, or a line break is enclosed in double quotes. A literal quote inside a quoted field is doubled, following the common rules documented by RFC 4180.

id,note
1,"Use commas, line breaks,
and ""quoted"" words"

Do not parse CSV by splitting every line at commas. Quoted cells can contain both delimiters and line breaks, so a logical row may span multiple text lines. Use a CSV parser configured for the same delimiter.

CSV conventions differ across applications despite RFC 4180. Test a representative export in the actual destination, particularly when it contains multiline fields or non-ASCII text.

Delimiters, Locales, and UTF-8 Imports

Comma is common, but spreadsheet installations in locales that use a comma as the decimal separator may expect semicolon-delimited data. Tab-delimited output can reduce conflicts in text-heavy fields, though tabs inside values still require quoting. Match the receiving import setting rather than choosing based on the .csv extension alone.

The download uses UTF-8 text, which supports Arabic, accented names, and other Unicode content. Some spreadsheet applications do not infer encoding or delimiter reliably from a file alone. Use the application’s import dialog to select UTF-8 and the chosen delimiter when characters or columns appear wrong.

Opening a CSV directly can trigger automatic type inference. An identifier such as 00123 may display as 123, a long numeric code may lose precision, and a date-like string may be reformatted. The converter preserves the JSON value as text in CSV syntax, but it cannot control how a spreadsheet interprets the cell. Import sensitive columns explicitly as text.

CSV Formula Injection, Local Processing, and Safe Sharing

Spreadsheet software may interpret cells beginning with =, +, -, or @ as formulas. If JSON contains untrusted names, comments, or imported values, a recipient opening the CSV could execute formula behavior supported by that spreadsheet. Quoting a CSV field correctly does not necessarily stop formula interpretation.

This tool does not alter values to escape formulas. That preserves source data but places responsibility on the export workflow. Before sharing a CSV derived from untrusted input, define a mitigation appropriate to the target spreadsheet, such as prefixing risky values in a controlled export layer and documenting the transformation.

JSON parsing, flattening, and CSV generation occur locally in the browser. Input is never uploaded, and the page works offline after it loads. That is useful for private data, but secrets should still be redacted before the resulting file is copied into another application or shared.

Browser memory limits still apply. The JSON text, parsed object graph, generated CSV string, and rendered output can coexist. Very large datasets may pause the interface or exhaust memory. A streaming command-line or data-processing workflow is better when input contains millions of records.

Frequently Asked Questions

Does JSON input have to be an array?

No. An array of objects creates multiple rows, a single object creates one row, and an array of primitive values creates one column named value.

How are missing keys and null values represented?

Both produce empty CSV cells. CSV alone cannot preserve the semantic difference among a missing property, null, and an empty string without an added convention.

What happens to arrays inside an object?

They are written as JSON text inside the cell, such as ["a","b"]. They are not expanded into repeated columns or separate rows.

Why did Excel remove leading zeros?

Spreadsheet type inference can treat identifiers as numbers. Import the CSV through the spreadsheet’s data-import flow and mark those columns as text.

Does the converter prevent CSV formula injection?

No. Values beginning with =, +, -, or @ are not modified. Sanitize untrusted values according to the destination spreadsheet before sharing the file.