Skip to content
DevTinyTools

JSON to CSV Converter

Turn a JSON array into a spreadsheet-ready CSV. Nested objects flatten into dotted columns, values are escaped per RFC 4180, and the result downloads as a file your spreadsheet opens directly.

Runs entirely in your browser — your JSON is never uploaded.

0 chars
0 chars

Free conversion covers up to 1,000,000 characters per document — what Pro adds. The file you open is read locally by your browser; nothing is uploaded.

A worked example

Nested objects become dotted column names and the comma inside a quoted value stays inside its cell. That is the part a text replacement gets wrong.

Input

[{"id":1,"user":{"name":"A, B"}},{"id":2,"user":{"name":"C"}}]

Output

id,user.name
1,"A, B"
2,C

The header is derived from the first record. A later record with an extra key adds a column and leaves the earlier row empty there.

How to convert JSON to CSV

  1. Paste a JSON array into the input panel, open a .json file, or press “Load example” for an orders payload with nested objects.
  2. Choose your options The delimiter (comma, semicolon or tab), whether nested objects flatten into dotted columns, and whether a header row is written.
  3. Press Convert to CSV The document is parsed first, so invalid JSON fails with the same line-and-column report as the validator instead of producing a broken file.
  4. Check the preview, then download The first rows render as plain text above the status line. Download writes a UTF-8 CSV with CRLF line endings, ready to open in Excel, Numbers or Google Sheets.

What counts as a row and a column

CSV is a rectangular format: every row must have the same columns. JSON is not, so a converter has to decide what the grid is. This tool uses the simplest rule that keeps data lossless:

  • Each array element is one row. A single object is wrapped in a one-element array, so both shapes convert.
  • Columns are the union of all keys across rows, in first-appearance order. A key that only some rows have leaves an empty cell in the others — no row is padded or dropped.
  • Nested objects become dotted columns when flattening is on: customer.email. Turn it off to keep each row as one JSON string in a single json column.
  • Arrays inside rows stay JSON in one cell, because expanding items.0.sku… items.n.sku into columns cannot have a stable shape across heterogeneous rows.

Escaping: what Excel actually parses

The output follows RFC 4180, the closest thing CSV has to a specification. In practice three rules do all the work:

  • Lines end with CRLF — what Excel expects; a bare LF is tolerated but can confuse older parsers.
  • Fields containing the delimiter, a double quote, or a line break are wrapped in quotes, and any quote inside is doubled: say "hi" becomes "say ""hi""".
  • null is written as an empty cell, so a mostly-numeric column stays numeric after the round-trip into a spreadsheet.

A note on locales: Excel in much of Europe expects semicolon-separated files because the comma is the decimal separator there. If your spreadsheet shows everything in one column, convert again with the semicolon delimiter — that is a locale setting, not a broken file.

The failure modes that do not announce themselves — 19-digit IDs Excel rounds, ZIP codes that lose their leading zero, nested objects flattened past recognition — are covered in Converting JSON to CSV: what breaks on the way. Going the other direction, CSV to JSON reads the same quoting rules back in.

DevTinyTools Pro

The free converter handles the payloads most people paste by hand. Pro is for the workflows that outgrow it — exporting a folder of API dumps, or a document too large for a comfortable tab session:

  • Batch conversion — drop up to 25 JSON files and download them all
  • 10,000,000-character documents, roughly 10 MB
  • Excel workbook (.xlsx) export with one sheet per file
  • Advanced flattening: array index columns, custom path separators
  • Priority fixes — conversion bugs move to the front of the queue

Pro is $29 one-time — a lifetime licence, sold through Lemon Squeezy as merchant of record, so VAT and sales tax are handled for you. Pro is a licence key — there is still no account. Buy DevTinyTools Pro, then activate it below and the higher limits unlock in this browser.

Frequently asked questions

Which JSON shapes convert cleanly?
An array of objects is the natural fit: every object becomes a row, and the columns are the union of all keys across rows in first-appearance order. A single object is accepted and wrapped in a one-row table. An array of primitives becomes a one-column table named value.
What happens to nested objects?
With flattening enabled (the default), each nesting level becomes a dotted column: customer.email, customer.address.city. Every row shares the same column set, so a missing path is simply an empty cell. With flattening disabled, each row serialises to a single json column containing compact JSON.
Why are arrays inside rows written as JSON instead of more columns?
An array of unknown length cannot map to a fixed set of columns without inventing a convention — items.0.sku, items.1.sku, and so on — and the union across rows explodes quickly. This tool writes array values as compact JSON in one cell, which stays lossless and readable in Excel. Copy a value into the JSON formatter when you need to inspect one.
Is the output valid for Excel?
Yes. Lines end with CRLF per RFC 4180, fields containing the delimiter, quotes or line breaks are quoted with doubled inner quotes, and null becomes an empty cell rather than the string null. If you open the file in a locale where Excel expects semicolons (much of Europe), switch the delimiter to semicolon before converting.
What does null become?
An empty cell. Writing the four characters null into a spreadsheet column that is otherwise numeric turns the whole column into text, which breaks sorting and formulas. An empty cell keeps the column clean.
How are numbers handled?
They are written as JSON prints them: 129.5 stays 129.5. The precision caveat from the JSON number guide applies — an integer above 2^53 parsed as a JavaScript number has already lost precision before conversion, so the CSV cannot restore it.
Is there a size limit?
Free conversion covers up to 10,000,000 characters per document, processed locally in the tab. Larger documents are limited by your browser's memory rather than a server quota, because there is no server involved. A Pro tier with batch conversion is planned.
Is my JSON uploaded during conversion?
No. The document is parsed and serialised locally with browser APIs, the file picker reads the file with FileReader, and no request is made. Nothing is written to storage or analytics.
JSON RepairFix broken JSON from an assistant or a config file: fences, comments, single quotes, trailing commas, Python literals and truncated tails — with every change reported.JSON Formatter & ValidatorPretty-print JSON with 2 or 4 space indentation, check the syntax and copy or download the result.JSON ValidatorCheck whether a JSON document is valid and see exactly where the parser stopped.JSON MinifierStrip whitespace from JSON and see how many bytes the minified output saves.JSON Diff CheckerCompare two documents and list every added, removed and changed value with its path.JSON Escape & UnescapeTurn raw text into a JSON string value, or decode backslashes and \u escapes back into readable text.JSON to TypeScript GeneratorGenerate TypeScript interfaces from a JSON sample, with optional properties and unions inferred from every array element.JSON to Go Struct GeneratorGenerate Go structs from a JSON sample, with json tags, int64 or float64 widths, pointers for null fields and omitempty for optional keys.CSV to JSON ConverterConvert CSV to JSON with RFC 4180 parsing, delimiter detection, dotted headers unflattened into nested objects and numbers converted only when they round-trip exactly.JSON to Java POJO GeneratorGenerate Java classes from JSON: primitives for required values, boxed types for optional and nullable ones, @JsonProperty for renamed keys and nested static classes.JSON to YAML Converter (and back)Convert JSON to YAML or YAML to JSON in both directions, with multi-document support, error line numbers and YAML 1.2 typing rules.JSON to Python Class GeneratorGenerate Pydantic v2 models or dataclasses from JSON, with snake_case fields, Optional where a key is missing or null, and keyword keys renamed safely.JSON to C# Class GeneratorGenerate C# classes from JSON with nullable annotations taken from every record, initialisers that avoid CS8618 and [JsonPropertyName] for each wire key.JSON to JSON Schema GeneratorTurn a JSON sample into a draft 2020-12 schema: required keys, nullable unions and nested $defs.