ToolNimba

πŸ—‚οΈ JSON to CSV Converter

Shihab Mia By Shihab Mia Β· Updated 2026-08-03

Paste a JSON array of objects above, then press Convert to CSV.

This JSON to CSV converter turns a JSON array of objects into a clean comma-separated table you can open in Excel, Google Sheets, or any spreadsheet app. Paste your JSON, press Convert, and copy or download the result. The header row is built from every key found across your objects, and any value with a comma, quote, or line break is quoted correctly so the columns never break.

What is the JSON to CSV?

JSON (JavaScript Object Notation) and CSV (comma-separated values) are two of the most common ways to move structured data between programs. JSON is hierarchical and self-describing, which makes it ideal for APIs and config files. CSV is flat and tabular, which is exactly what spreadsheets and many databases expect. Converting from JSON to CSV means flattening a list of records into rows, with one column per field, so a developer, an analyst, or a non-technical colleague can all work with the same data in a spreadsheet.

The input this tool expects is a JSON array of objects, for example [ {"name":"Ada","city":"London"}, {"name":"Linus","city":"Helsinki"} ]. Each object becomes one row. The converter scans every object to collect the full set of keys, so even if some records have extra fields, no data is lost. Columns appear in the order each key is first seen, and any object missing a given key simply gets an empty cell in that column. This union-of-keys approach is what most JSON to CSV tools use, because JSON records do not have to share an identical shape the way rows in a database table do.

The quoting follows the common CSV convention (RFC 4180). A field is wrapped in double quotes whenever it contains the delimiter, a double quote, or a line break, and any double quote inside the field is doubled. That means a value like Smith, John or a line of text with a comma in it stays in a single cell instead of spilling into the next column. Nested objects and arrays are written as compact JSON inside one cell, so the structure is preserved even though CSV itself is flat.

Nested data is the part most converters get wrong, so it is worth being explicit about how this tool handles it. Some libraries, such as Python pandas with json_normalize, flatten nested objects into dot-notation columns like address.city and address.zip, and either explode arrays into extra rows or join them into a single delimited string. This tool keeps things predictable instead: any object or array value is written as compact JSON text in its own cell, for example {"city":"London"} or ["red","blue"]. That guarantees no data is silently dropped or restructured. If you specifically need every nested field broken into its own column, flatten the JSON first with a script or a dedicated flattening tool, then paste the flattened array here.

Compatibility with real spreadsheet apps matters as much as the conversion itself. Comma-delimited files open cleanly in Excel and Google Sheets almost everywhere, but several European locales configure Excel to use the comma as a decimal separator, which can make a comma-delimited CSV import as one giant column. Switching the delimiter to semicolon fixes that without changing anything else about the data. If a downloaded CSV shows garbled accented characters after opening in Excel, that is usually a UTF-8 encoding issue rather than a conversion problem, and importing through Data > From Text/CSV with UTF-8 selected resolves it.

Everything runs in your browser using plain JavaScript, so your data is never uploaded to a server. That makes this tool safe for API keys, customer records, or any other sensitive JSON you would not want leaving your machine. For very large files, tens of megabytes or more, an in-browser converter can slow down because parsing and conversion happen entirely in memory. In that situation a command-line tool such as jq, or a short Python script using pandas, will generally handle the volume more reliably than any browser-based tool.

When to use it

  • Turning an API response (a JSON array of records) into a spreadsheet for a colleague who does not code.
  • Importing exported JSON data into Excel, Google Sheets, or a database that only accepts CSV.
  • Quickly eyeballing a JSON dataset as a table to spot missing fields or odd values.
  • Preparing JSON output for tools like mail-merge or analytics imports that expect CSV.
  • Converting JSON logs or webhook payloads into CSV so they can be pivoted or charted in a BI tool.
  • Exporting a JSON array from a NoSQL database like MongoDB into a flat CSV for a report or an audit.

How to use the JSON to CSV

  1. Paste a JSON array of objects into the input box.
  2. Pick a delimiter (comma is standard; use semicolon or tab if your locale or target app needs it).
  3. Leave the header row on if you want column names in the first line, or turn it off for data-only output.
  4. Press Convert to CSV, then use Copy or Download .csv to save the result.
  5. If a value is a nested object or array, expect it to appear as compact JSON in one cell rather than as separate columns.

Formula & method

columns = union of all keys across every object, in first-seen order.   Each object becomes one row, with an empty cell where a key is missing.   A field is quoted when it contains the delimiter, a double quote, or a newline, and inner quotes are doubled.
JSON array (input)[ {"name":"Ada"},{"name":"Kenji"} ]array of objectsconvertCSV table (output)namecityAdaLondonKenjiTokyo

Worked examples

Two objects where the second has a key the first does not.

  1. Input: [ {"name":"Ada","city":"London"}, {"name":"Linus","country":"Finland"} ]
  2. Union of keys, first-seen order: name, city, country
  3. Row 1 (Ada): name=Ada, city=London, country is missing so the cell is empty
  4. Row 2 (Linus): name=Linus, city is missing so the cell is empty, country=Finland

Result: name,city,country\nAda,London,\nLinus,,Finland

A value that contains a comma, so it must be quoted.

  1. Input: [ {"product":"Pen","note":"red, fine tip"} ]
  2. Header: product,note
  3. The note value contains a comma, so it is wrapped in double quotes
  4. Result row: Pen,"red, fine tip"

Result: product,note\nPen,"red, fine tip"

A value that itself contains a double quote.

  1. Input: [ {"quote":"She said \"hi\""} ]
  2. Header: quote
  3. The field contains double quotes, so the whole field is quoted and each inner quote is doubled
  4. Result row: "She said ""hi"""

Result: quote\n"She said ""hi"""

An object whose value is a nested array, showing how it lands in one cell.

  1. Input: [ {"id":1,"tags":["red","blue"]} ]
  2. Header: id,tags
  3. The array value is converted to compact JSON text: ["red","blue"]
  4. That text contains double quotes, so the whole field is quoted and each inner quote is doubled

Result: id,tags\n1,"[""red"",""blue""]"

When a CSV field needs to be quoted (RFC 4180)

Field containsQuoted?Example output
Plain text, no special charactersNoLondon
The delimiter (e.g. a comma)Yes"red, fine tip"
A double quote characterYes, inner quotes doubled"She said ""hi"""
A newline or carriage returnYes"line one\nline two"
Leading or trailing spaces onlyNo (preserved as-is)" spaced "

How JSON value types are written into a CSV cell

JSON valueCSV cell
"text"text
42 or 3.1442 or 3.14
true / falsetrue / false
null(empty cell)
Nested object or arrayCompact JSON, e.g. {"a":1} or [1,2]

Choosing a delimiter for your target app or locale

Target app or localeRecommended delimiterWhy
Excel (US, UK, most English locales)CommaThis is the default CSV format and imports directly
Excel (many European locales)SemicolonComma is often the decimal separator there, so comma-delimited files can import as one column
Google SheetsCommaComma works the same way regardless of your Sheets language or region setting
Tools that expect TSVTabUseful when many field values already contain commas
Database bulk import (MySQL, Postgres)Comma, but confirmMost load commands accept comma by default, but check the exact import syntax first

Common mistakes to avoid

  • Pasting a single object instead of an array. The tool expects a JSON array, so wrap one or more objects in square brackets: [ {…} ]. A bare object {…} is rejected with a clear message.
  • Expecting nested objects to expand into separate columns. A value that is itself an object or array is written as compact JSON inside one cell. If you need each nested field as its own column, flatten the JSON first.
  • Using the wrong delimiter for your locale. Some European versions of Excel treat the comma as a decimal separator and expect semicolon-delimited files. If your columns do not split, switch the delimiter to semicolon.
  • Forgetting that missing keys become empty cells. When objects have different sets of keys, rows are aligned to the full union of columns and any missing value is left blank. That is intentional, not data loss.
  • Pasting JSON Lines (NDJSON) instead of a JSON array. JSON Lines files have one standalone object per line with no surrounding brackets or commas between them. Wrap the lines in square brackets and add commas between them to form a single JSON array before pasting.
  • Assuming the CSV keeps original data types. CSV is plain text, so numbers, booleans, and null all become text once converted. A spreadsheet may reformat a long numeric ID into scientific notation unless you set that column to text before opening the file.

Glossary

JSON
JavaScript Object Notation, a text format for structured data using objects (key/value pairs) and arrays.
CSV
Comma-separated values, a plain-text table format where each line is a row and fields are separated by a delimiter.
Array of objects
A JSON array whose elements are all objects, like a list of records. This is the input this tool expects.
Delimiter
The character that separates fields in a CSV line, most commonly a comma but sometimes a semicolon, tab, or pipe.
RFC 4180
The common specification for CSV files, including the rules for when and how a field is quoted.
Flattening
Turning nested JSON objects and arrays into flat columns, often using dot notation such as address.city, so every value gets its own column.
JSON Lines (NDJSON)
A format where each line of a file is one standalone JSON object, common in logs. It must be wrapped into a single array before this tool can convert it.
BOM (Byte Order Mark)
A few invisible bytes some programs add at the start of a UTF-8 file so Excel reads accented and special characters correctly.

Frequently asked questions

How do I convert JSON to CSV?

Paste a JSON array of objects into the box, choose your delimiter, and press Convert to CSV. The tool builds a header from all keys, writes one row per object, and lets you copy or download the result instantly.

What JSON format does this tool accept?

It accepts a JSON array of objects, such as [ {"a":1}, {"a":2} ]. Each object becomes a row and each key becomes a column. A single bare object or non-object array elements are rejected with a clear error.

What happens if my objects have different keys?

The converter collects the union of all keys across every object, in the order they first appear. Each row fills in the values it has, and any column a row lacks is left as an empty cell, so nothing is lost.

How are commas, quotes, and line breaks handled?

Any field containing the delimiter, a double quote, or a line break is wrapped in double quotes, and inner double quotes are doubled. This follows RFC 4180 so the CSV opens correctly in Excel and Google Sheets.

Is my data uploaded anywhere?

No. The conversion runs entirely in your browser with plain JavaScript, and the file is created locally for download. Your JSON never leaves your device, which makes it safe for sensitive data.

How do nested objects and arrays appear in the CSV?

A value that is itself an object or array is written as compact JSON inside a single cell, for example {"city":"London"} or [1,2,3]. CSV is flat, so if you need those fields as separate columns you should flatten the JSON first.

Can this tool flatten nested JSON into separate columns?

Not automatically. Nested objects and arrays stay as compact JSON in one cell so no data is dropped or guessed at. To get each nested field as its own column, flatten the JSON first with a script, for example Python pandas.json_normalize, then paste the flattened array here.

Why does my CSV look garbled with strange characters in Excel?

This is usually a UTF-8 encoding issue rather than a conversion problem. It happens when a CSV with accented or special characters opens without a UTF-8 BOM. Open it through Excel Data > From Text/CSV and choose UTF-8 encoding, or open the downloaded file directly rather than double-clicking an older cached copy.

Can I convert JSON Lines (NDJSON) files with this tool?

Not directly, since JSON Lines has one object per line with no surrounding brackets or commas. Wrap the lines in square brackets and separate them with commas to turn the file into a single JSON array, then paste that array here.

Is there a size limit on the JSON I can convert?

There is no hard limit, but very large files, tens of megabytes or more, can slow the browser tab because parsing and conversion happen entirely in memory. For huge datasets a command-line tool such as jq, or a short Python script using pandas, is more reliable.