ConvertCSV

Converter tool

JSON to CSV Converter

Convert JSON arrays or objects to CSV instantly

Preview

Output Preview

No output yet. Upload or paste input and convert.

JSON to CSV Converter

JSON (JavaScript Object Notation) is the default shape of modern API responses, configuration files, and database exports. Spreadsheets and many reporting tools still expect flat tables. This free JSON to CSV converter flattens arrays and objects into spreadsheet columns so you can inspect, filter, share, and import the data without writing a script.

Paste JSON from a network tab, upload a .json file, or drop in an export from MongoDB, Firebase, or a REST client. The tool runs entirely in your browser: it parses the text, builds a stable column set across every object, flattens nested keys with dot notation, and produces RFC 4180–compatible CSV you can open in Excel, Google Sheets, Numbers, or a database import wizard.

Below you will find how the conversion works, when CSV is the right target format, how nested structures and arrays are handled, common Excel pitfalls after download, and a full troubleshooting and FAQ section for real-world JSON payloads.

Key features

  • Scans every object in the array first to build the complete column set, so inconsistent objects do not misalign later rows.
  • Flattens nested objects into dot-notation columns (for example address.city) instead of dropping nested data.
  • Joins arrays of primitive values into a single semicolon-separated cell rather than discarding them.
  • Escapes commas, quotes, and line breaks in values per RFC 4180 so the output opens cleanly in spreadsheet apps.
  • Accepts a single JSON object as well as an array — a single object becomes a one-row CSV.
  • Runs client-side in your browser so file contents are not uploaded to a server as part of the conversion.
  • Supports paste or file upload so you can move quickly from an API client, log, or export dump to a downloadable CSV.

About the JSON to CSV format

CSV is a plain-text table: one header row of column names, then one row per record, with fields separated by commas (or another delimiter in regional variants). Unlike JSON, CSV has no nested objects, no arrays as first-class values, and no typed numbers or booleans — everything is text until a spreadsheet or importer reinterprets it.

The converter is built for the most common API shape: a JSON array of objects. Each object becomes one CSV row. Keys become headers. Nested objects are flattened so address.city and address.zip appear as separate columns. Arrays of primitive values (strings, numbers, booleans) are joined into a single cell with semicolons so the row stays flat. A lone JSON object is treated as a one-item array and yields a header plus a single data row.

Because CSV cannot express hierarchy the way JSON can, conversion is a deliberate flattening step. That is useful when a teammate needs Excel, when a BI tool only accepts tabular uploads, or when you want to diff two exports side by side. Keep the original JSON if you still need nested structure, typed values, or nested arrays of objects for application code.

How it works

The converter parses your text with the browser JSON parser. If the root value is a single object, it wraps that object in a one-item array so the rest of the pipeline can treat every input as a list of records.

It then walks every object to collect the full set of column keys before writing any row. Nested objects are flattened with dot notation (parent.child), and arrays of primitive values are joined with semicolons into one cell. Keys missing on a particular object stay blank rather than shifting the remaining columns.

Finally each object is mapped into a row in that fixed column order. Every value is escaped for CSV: fields that contain a comma, double quote, or newline are wrapped in quotes, and internal quotes are doubled. The result is a UTF-8 CSV string you can copy or download as a .csv file.

Common use cases

  • Flattening a REST or GraphQL API response so a non-technical teammate can open it in Excel or Google Sheets.
  • Converting a MongoDB, CouchDB, or Firebase JSON dump into rows for a BI dashboard or warehouse staging import.
  • Turning package.json dependency lists, license audit exports, or config inventories into a spreadsheet for review.
  • Preparing test fixture data from a staging API as CSV seed files for QA or spreadsheet-driven checks.
  • Sharing product, order, or user exports from a SaaS admin panel that only offers JSON download.
  • Normalizing webhook payloads or log samples into columns before filtering and charting in a spreadsheet.

How to use this tool

  1. Paste JSON — an array of objects or a single object — into the input box, or upload a .json file.
  2. Confirm the preview shows the row count and column headers you expect, including any flattened nested fields.
  3. Check a few cells that came from nested objects or arrays to verify flattening and semicolon joins look right for your workflow.
  4. Copy the CSV or download the .csv file, then open it in Excel, Google Sheets, Numbers, or your database import tool.
  5. If a downstream tool is picky about delimiters or encoding, re-check regional CSV settings or import as UTF-8 text before splitting columns.

Example

Input JSON

[
  { "name": "Alice", "address": { "city": "New York", "zip": "10001" }, "tags": ["admin", "beta"] },
  { "name": "Bob", "address": { "city": "Boston", "zip": "02108" }, "tags": ["user"] }
]

Output CSV

name,address.city,address.zip,tags
Alice,New York,10001,admin;beta
Bob,Boston,02108,user

Tips for best results

  • Prefer an array of objects with consistent keys — that produces the cleanest, narrowest CSV.
  • If objects differ in shape, review empty cells carefully; missing keys become blanks, not shifted columns.
  • Deeply nested objects create wide tables with long dotted headers; flatten or project fields in the source when you only need a few columns.
  • Paste raw JSON from a browser network tab or API client when you do not want to save a file first.
  • Keep IDs and ZIP codes as JSON strings if Excel must preserve leading zeros after open.
  • Validate hand-edited JSON before converting — a single trailing comma blocks the entire parse.
  • After download, open a sample in your target app and check column count, row count, and a few nested fields before sharing widely.

Common errors and how to fix them

Some rows are missing values that appear in other rows' columns.
This happens when JSON objects have inconsistent shapes — one object has a field the others do not. The converter scans every object first to build the full column set, so a missing field becomes an empty cell rather than shifting other columns. If the misalignment looks wrong, check for a typo in a key name across objects.
A nested array shows up in the CSV as literal text like "[object Object]".
Arrays containing objects (not plain values) are not flattened further automatically. Restructure the source JSON so each row is a flat record, or pre-process the nested array into separate rows or a joined string before converting.
Excel shows a numeric ID column with extra or missing digits after opening the CSV.
This is Excel's auto-formatting on open, not a conversion issue — long numeric IDs can switch to scientific notation or lose precision. In the source JSON, keep IDs as quoted strings (for example "00123"), then format that column as Text when opening the CSV in Excel.
The tool reports the input is not valid JSON.
Trailing commas, single quotes instead of double quotes, unescaped control characters, or comments (which JSON does not allow) are the most common causes. Run the text through a JSON validator first, then paste the cleaned document.
Column headers are extremely long or the sheet is unusably wide.
Deep nesting produces long dotted paths for every leaf key. Project or flatten only the fields you need in the source JSON, or convert a smaller sample first to decide which paths matter before processing the full export.
NDJSON / JSON Lines paste fails to parse.
JSON Lines is one object per line without a surrounding array. Wrap the lines in square brackets and separate objects with commas to form a valid JSON array, then convert — or transform NDJSON to an array in your editor first.

Best practices

  • Keep JSON as a flat array of objects with consistent keys across every object when possible — it produces the cleanest CSV.
  • Decide on a flattening convention (dot notation vs underscores) before converting if the output must match an existing spreadsheet template; rename columns after download if needed.
  • Confirm the semicolon-joined format for array values works for your downstream tool, or pre-process arrays into your preferred separator first.
  • Validate hand-edited JSON with a linter before converting — a single trailing comma blocks the entire conversion.
  • Preserve a copy of the original JSON whenever nested structure or typed values still matter after the spreadsheet hand-off.
  • Spot-check row counts: the number of objects in the array should match the number of data rows in the CSV (plus one header row).
  • For recurring jobs, document which fields you expect so the next export is compared against the same column checklist.

What JSON to CSV conversion actually does

JSON and CSV solve different problems. JSON is hierarchical and typed enough for applications: objects nest, arrays hold lists, and values can be strings, numbers, booleans, or null. CSV is a lowest-common-denominator table format that almost every spreadsheet, analytics tool, and legacy importer understands. Converting JSON to CSV means choosing a flat representation of that hierarchy so each record occupies one row and each field occupies one column.

In practice, conversion is a projection. You keep the leaf values that matter for analysis or sharing, and you encode structure into column names (address.city) or into joined cell text (tag1;tag2). Anything that cannot be expressed as a simple cell — especially nested arrays of objects — needs a design choice before or after the tool runs: explode into multiple rows, pick a summary string, or leave those fields out of the spreadsheet view.

This page is aimed at that everyday conversion: take a JSON array (or one object), produce a downloadable CSV, and move on. It is not a full ETL pipeline. For nightly warehouse loads you would use a script or job with explicit schemas. For a one-off API paste, an audit export, or a support ticket attachment, a browser converter is usually the fastest path.

When to convert JSON to CSV (and when to keep JSON)

Convert to CSV when the consumer is a human in a spreadsheet, a tool that only accepts tabular uploads, or a workflow that needs simple filters, sorts, and pivots. Product managers, finance teams, and operations analysts often cannot consume nested JSON comfortably, even when developers can. CSV also makes side-by-side comparison of two exports easier because rows and columns line up visually.

Keep JSON when you still need nesting for application logic, when nested arrays of objects are first-class (order line items, permission sets, geo coordinates with properties), or when type fidelity matters for a program that will re-parse the file. Round-tripping through CSV can lose type information: numbers and booleans become text, null handling varies by importer, and nested lists must be reconstructed from joined strings.

A practical middle path is to convert a filtered projection for sharing while archiving the full JSON. Many teams paste a reduced array — only the fields the spreadsheet needs — into this tool, and keep the complete API payload in version control or object storage for engineering use.

  • Good fit: API sample → Excel review, Mongo dump → BI upload, config inventory → audit sheet.
  • Poor fit: deeply nested documents with repeating child collections that must stay relational.
  • Better as a script: recurring conversions with a fixed schema, validation rules, and automated delivery.

Supported JSON shapes and how they map to rows

The happiest path is a JSON array of objects with similar keys. Each object becomes one row. The header row is the union of keys discovered across the array, which means optional fields still get a column even if only some objects include them. Empty cells mean “this object lacked that key,” not “the parser skipped a column.”

A single object is supported as a convenience: the converter treats it like a one-element array. That is useful when you copied one record from an API detail endpoint. A JSON array of primitives (for example [1, 2, 3]) does not map cleanly to a multi-column table; object records are the intended input.

Root values that are not objects or arrays of objects — a bare string, number, boolean, or null — cannot produce a meaningful multi-column CSV. Wrap scalars in objects if you truly need a one-column file, or use a different export path. If your payload is wrapped (for example { "data": [ ... ], "meta": { ... } }), extract the array you care about before pasting so metadata keys do not become a single awkward row.

Nested objects, arrays, and flattening rules

Nested objects are flattened with dot notation. { "user": { "id": 1, "name": "Ada" } } becomes columns user.id and user.name. Depth is not limited to one level, but deeper trees create longer headers and wider sheets. If readability suffers, flatten or select fields upstream so only the leaves you need appear.

Arrays of primitives are joined into one cell with semicolons. { "tags": ["a", "b"] } becomes a cell value a;b under the tags column. Choose that convention deliberately: some importers prefer pipes or commas, and some workflows need one tag per row instead of a joined list. You can split the column later in a spreadsheet or pre-process the JSON if you need a different shape.

Arrays of objects are the hard case. A field like "items": [{ "sku": "A" }, { "sku": "B" }] is not automatically exploded into two CSV rows. Spreadsheet rows usually represent one entity (an order, a user, a place). Child collections belong in a separate table in a relational model. Before converting, either explode children into their own JSON array of rows, serialize a summary string, or omit the nested collection from the spreadsheet export.

Inconsistent nesting — some records store address as a string while others store an object — produces inconsistent columns and confusing empty cells. Normalize the JSON shape first when you control the exporter. When you do not, expect to clean headers and blank cells after download.

Encoding, delimiters, and opening the file in Excel

The CSV produced here follows common RFC 4180 expectations: comma separators, quoted fields when needed, and doubled quotes inside quoted fields. Most English-locale spreadsheet apps open that cleanly. In locales where Excel expects semicolons as the list separator, a comma-separated file may land in one column until you use Text Import / Get Data and set the delimiter explicitly.

UTF-8 is the modern default for web JSON and for this kind of browser export. Excel on Windows historically needed a UTF-8 BOM or an explicit import to show non-ASCII characters correctly. If you see mojibake (garbled accents or symbols), re-import the file as UTF-8 rather than double-clicking it open. Google Sheets generally handles UTF-8 CSV uploads more gracefully.

Leading zeros, long IDs, and values that look like dates are classic Excel traps. A ZIP code 02108 may become 2108; a 16-digit ID may lose precision in floating point. Store those fields as JSON strings and format the spreadsheet column as Text after open. Alternatively, import through a wizard that lets you set column types before Excel guesses.

Typical workflows that use this converter

API debugging and hand-off: copy a response body from the browser network panel or from Postman/Insomnia, paste it here, and send the CSV to someone who will filter in Excel. This avoids writing a one-off Node or Python script for a single investigation.

Database and SaaS exports: many admin panels and mongoexport-style dumps emit JSON arrays. Converting to CSV is often the step before a finance or ops spreadsheet, a Google Sheets collaboration doc, or a lightweight import into another system that accepts CSV only.

QA and fixtures: engineers sometimes keep golden JSON fixtures for tests but need a tabular view to eyeball edge cases with product. Converting a fixture file gives a readable sheet without changing the fixture used by automated tests.

Light analytics: for a few thousand rows, spreadsheet pivot tables are enough. Convert, add a couple of helper columns, and chart. Past a few tens of thousands of rows, browser memory and spreadsheet limits start to matter — then move to a proper ETL path.

Browser limits, privacy, and large files

Conversion runs in your browser with JavaScript. That means the contents of the JSON you paste or upload are not sent to a Convert CSV server as part of the transform. You still load the page itself over the network, and the site may use analytics or advertising scripts as described in the privacy policy — but the conversion step is local to the device.

Client-side processing also means very large files depend on available memory and CPU. Multi‑megabyte JSON arrays can slow the tab or fail on low-memory devices. If the page becomes unresponsive, split the array into chunks, convert in batches, or use a command-line tool (jq, Python, Node) for bulk jobs.

For sensitive data — personal information, credentials, health or financial records — local conversion is still preferable to uploading to an unknown third-party API. Clear the paste buffer and close the tab when finished if you are on a shared machine, and avoid leaving confidential exports in Downloads longer than needed.

JSON to CSV versus writing a script

A small script gives you full control: custom column order, renaming, filtering, exploding nested arrays into related CSVs, and repeating the job on a schedule. Libraries in Python (csv + json), Node, and Go make that straightforward. Use a script when the mapping rules are part of your product or data platform.

A browser converter wins on speed to first result. No environment setup, no dependency install, no debate about which library flattens nested keys. For irregular one-off payloads, the cost of a correct script often exceeds the cost of paste-convert-download — especially when the consumer only needed a sheet for a meeting.

Teams often use both: this tool for exploratory conversion and a checked-in script once the column contract stabilizes. If you find yourself repeating the same paste weekly, that is the signal to automate.

Quality checklist before you share the CSV

Before you email or upload the file, run a short checklist. Matching object count to data-row count catches truncated pastes. Scanning headers for unexpected nested paths catches payloads that were richer than you thought. Spot-checking empty cells on required fields catches inconsistent records early.

Open the file in the same application your recipient will use. Excel, Sheets, and Numbers do not always agree on delimiter detection or date parsing. If the recipient is in another country, confirm whether they need comma or semicolon separation and whether their Excel build needs an explicit UTF-8 import.

Document assumptions in a short note when the sheet will live on: which JSON path became which column, how arrays were joined, and which nested collections were omitted. Future you (or a teammate) will not remember the payload shape from a week ago.

  • Row count matches the number of objects in the source array.
  • Headers are readable and match the fields stakeholders asked for.
  • ID-like columns still look correct after opening in the target spreadsheet.
  • No unintended "[object Object]" or stringified blobs in important cells.
  • Original JSON retained if nested data may be needed again.

Related tools and next steps

If you need the reverse direction — spreadsheet rows back into a JSON array of objects — use the CSV to JSON converter on this site. For cleaning columns, removing blank rows, or fixing delimiters before another transform, open the Online CSV Editor or Edit CSV tools after download.

When the source is Excel rather than JSON, use Excel to CSV or related spreadsheet converters first, then continue into JSON only if an API expects that shape. For XML or YAML API-style payloads, use those dedicated converters instead of forcing the data through JSON as an intermediate unless you already have JSON in hand.

Format guides on the site cover CSV delimiters, encoding, and Excel quirks in more depth. Use those when the conversion itself succeeded but the spreadsheet open step still looks wrong — that split between “parser issue” and “Excel import issue” saves a lot of false troubleshooting.

Frequently asked questions

Can this convert deeply nested JSON, not just one level?

Yes. Nested objects are flattened with dot notation at any depth, but very deep structures produce long, wide column names. For readability, flatten or select only the levels you need before converting when possible.

What happens if I paste a single JSON object instead of an array?

A single object is treated as a one-item array and produces a CSV with a header row and exactly one data row.

Are number and boolean types preserved in the CSV?

No. CSV has no native data types, so numbers, booleans, and null become plain text. Re-parse or format columns as needed in the spreadsheet or importer that consumes the file.

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

Not directly. NDJSON is one JSON object per line without a surrounding array. Wrap the lines in square brackets and separate them with commas to form a valid JSON array first, then paste that in.

Does the tool upload my JSON data anywhere?

No. Parsing and conversion run in your browser's JavaScript engine. File contents are not sent to a server as part of the conversion. See the Privacy Policy for how the website itself uses analytics and advertising.

How do I convert the CSV back to JSON later?

Use the CSV to JSON converter, which reads CSV headers and rows back into a JSON array of objects. Nested objects that were flattened to dotted headers will not automatically rebuild deep nesting unless you post-process the JSON.

Why are some cells empty even though other rows have values?

The header row is the union of keys across all objects. If one object omits a key that others include, that cell is blank for that row. Check for inconsistent field names or optional properties in the source JSON.

How are nested arrays handled?

Arrays of primitives are joined into one cell with semicolons. Arrays of objects are not exploded into extra rows; restructure those collections before converting if you need one child record per CSV row.

What is the maximum file size?

There is no fixed server quota because processing is local, but very large JSON files can exhaust browser memory. If the tab slows or crashes, split the array into smaller batches or use a command-line converter for bulk jobs.

Why does Excel put everything in one column?

Your Excel locale may expect semicolons as separators, or the file may need an explicit Text Import with comma selected. Use the import wizard and set the delimiter to comma, and choose UTF-8 if characters look wrong.

Can I choose different column names or order?

The converter derives headers from JSON keys in discovery order. Rename or reorder columns in a spreadsheet after download, or reshape the JSON keys before converting if you need a specific contract up front.

Is the output compatible with Google Sheets?

Yes. Download the CSV and upload or import it into Google Sheets. Sheets generally detects comma separation and UTF-8 well; still verify a few nested and numeric fields after import.

For more background on data formats and conversion workflows, read our format guides or browse the converter blog for step-by-step walkthroughs linked to each tool.