Ennadia
Text & Data

JSON to CSV

Turn JSON into spreadsheet rows and back.

  • Local by default
  • No signup
  • AI is opt-in

Output

 

CSV is a text format: types, nesting and leading zeros do not survive a round trip. Fields are quoted per RFC 4180 and nothing is uploaded.

Convert an array of JSON objects into CSV and turn CSV rows back into JSON. Delimiters, quoting, nested fields and an Excel-friendly BOM are handled in your browser, so log exports and customer records never leave the tab.

Two data models that do not line up

JSON is a tree: values can be strings, numbers, booleans, nulls, arrays or nested objects. CSV is a rectangle of text cells. A conversion in either direction has to throw information away or invent a convention, and the tool is explicit about which one it used.

JSON to CSV expects a top-level array of objects. Keys are collected across every row in first-seen order, and a row missing a key gets an empty cell. CSV to JSON produces an array of flat objects, one per data row, with the header row supplying the keys.

  1. Numbers become text and lose their type unless you enable inference.
  2. Leading zeros, very large integers and dates with specific formatting are not preserved.
  3. Arrays and objects have no native CSV representation; they are either stringified or flattened.
  4. Null, an empty string and a missing value all become an empty cell, so they cannot be told apart on the way back.

Quoting follows RFC 4180

RFC 4180 defines the common CSV rules: fields are separated by commas, records by CRLF, and a field containing a comma, a quote or a line break must be wrapped in double quotes. A literal double quote inside a quoted field is written twice.

Ada,"London, UK",36
"Grace","She said ""hello""",45

The parser on this page implements the same rules in reverse, including doubled quotes and CRLF line endings. It is deliberately small and predictable; it is not a full CSV dialect engine, so unusual formats such as comments, escape characters or fixed-width fields are out of scope.

Excel is not RFC 4180

  1. BOM: Excel on Windows often assumes the system code page unless the file starts with a UTF-8 BOM. Enable the BOM option to avoid garbled non-ASCII text.
  2. Delimiter: Excel uses the list separator from the locale. In locales where the decimal separator is a comma, CSV files are commonly semicolon-delimited.
  3. Leading zeros: a ZIP code or product code such as 007 becomes 7 when Excel parses it as a number. CSV itself has no cell types, so this happens on import, not during conversion.
  4. Formulas: a cell starting with =, +, - or @ can be interpreted as a formula. Be careful when opening untrusted CSV in a spreadsheet.

If a spreadsheet is the final destination, decide which of these problems matter before exporting. The BOM and delimiter options solve the two most common complaints; the rest need a template or an import step, not a different converter.

Nested objects need a convention

There is no standard way to put { "profile": { "city": "London" } } into a cell. This page offers two honest choices. Without flattening, the cell contains the JSON text for the nested value, which round-trips but is unreadable in a spreadsheet. With flattening, keys become dotted paths such as profile.city, which is readable but changes the column names.

stringify: { "profile": "{\"city\":\"London\"}" }
flatten:   { "profile.city": "London" }

Arrays are always stringified, even when flattening is on. Joining array items with commas would collide with the CSV delimiter, and choosing a different separator silently invents a format that other tools will not understand.

Type inference is a guess

By default every CSV cell becomes a JSON string. That is the only option that loses nothing: "42" stays a string and the caller decides whether to parse it. Turning on inference converts values that look like numbers, booleans or null, but appearance is not type information.

The inference here deliberately refuses numbers with leading zeros, so 007 and 00123 stay strings. It also treats true, false and null case-insensitively. It does not guess dates, phone numbers or currency, because the same text can mean different things in different schemas.

If your pipeline cares about types, treat the CSV as text and validate each field with an explicit schema. Inference is a convenience for quick inspection, not a data contract.

Size limits and better tools

Both directions parse the whole document in memory and render the result as text. A few megabytes is comfortable; hundreds of megabytes will freeze a tab or exhaust memory. For large exports, use a streaming tool: jq can reshape JSON, and csvkit or a short Python script handles CSV at any size.

The converter is best for the files that show up in a browser download: an API response you want to inspect in a spreadsheet, or a small CSV you want to paste into a test fixture. It is not a replacement for an ETL pipeline.

Frequently asked questions

Why did a value like 007 turn into 7?

Either Excel or type inference treated it as a number. The converter keeps leading-zero values as strings, and you can turn inference off entirely. If Excel does it on import, prefix the value with an apostrophe or import the column as text.

How are commas, quotes and line breaks handled?

Fields containing a comma, a double quote or a line break are wrapped in double quotes, and embedded quotes are doubled per RFC 4180. Records are written with CRLF line endings.

Can nested objects or arrays become separate columns?

Objects can be flattened into dotted column names. Arrays cannot be split into columns reliably because their length varies per row, so they are written as JSON text. For a fixed schema, reshape the data before converting.

Why does Excel show garbled characters?

Excel guessed the wrong encoding. Enable the UTF-8 BOM option and open the downloaded file again. For semicolon locales, also switch the delimiter to semicolon.

Is my data uploaded anywhere?

No. Parsing, conversion and file generation happen in the browser. There is no network request, so the rows stay on your device.

How large a file can it handle?

It depends on the device, but a few megabytes is safe. The whole document is held in memory and rendered as text, so hundreds of megabytes are not suitable. Use jq, csvkit or a streaming script for files that large.