JSON to CSV Converter

Convert JSON to CSV in your browser, with no upload and no sign-up.

Everything is processed in your browser. Nothing you paste is uploaded or stored.

In-depth guide

JSON to CSV: columns, nested values, quoting and formula safety

How the converter builds a table from an array of objects: column union and order, nested values as JSON text, quoting, LF line endings, what is rejected, and the spreadsheet formula risk it does not guard against.

Last verified: Sources: IETF — RFC 4180 Plain-text version of this guide

Key figures at a glance

Accepted input
An array of objects, or one object
Scalars, arrays of scalars, arrays of arrays and arrays containing null are rejected.
Columns
Union of all keys, in first-seen order
A record missing a key leaves that cell empty.
Nested values
Written as compact JSON text in one cell
Objects and arrays are not flattened into extra columns.
Line endings
LF, with no final newline
RFC 4180 specifies CRLF; most tools read LF fine.
Source: IETF — RFC 4180

What goes in, what comes out

Paste JSON and the right-hand box shows CSV, updating as you type. A Download link (converted.csv) appears when there is output. Nothing is uploaded.

The input must be an array of objects, or a single object (treated as a one-row table). The first line of output is the header. Example: [{"name":"Mei","city":"Singapore","age":30},{"name":"Ali","city":"Johor","age":25}] gives

name,city,age
Mei,Singapore,30
Ali,Johor,25

Anything else, such as 5, "text", null, [1,2], [[1,2]] or [{"a":1},null], stops with "Only an array of objects (or a single object) can become a table. Nested arrays have no rows and columns to map onto." An empty array [] gives empty output.

Columns and missing keys

The header is the union of all keys across all records, in the order each key is first seen. A record that lacks a key gets an empty cell:

Input Output
[{"a":1,"b":2},{"b":3,"c":4}] a,b,c / 1,2, / ,3,4
[{"b":1,"2":2,"1":3}] 1,2,b / 3,2,1 (integer-like keys come first)

Because JavaScript puts integer-like keys first, a record such as {"b":1,"2":2,"1":3} is read as 1, 2, b, regardless of its order in the text. {} or [{}] yields just a line break.

Cell values

JSON value Cell
string the text itself
number JavaScript's printing: 1.50 becomes 1.5; 12345678901234567890 becomes 12345678901234567000; 1e21 becomes 1e+21; -0 becomes 0
true / false true / false
null empty cell (indistinguishable from "")
object or array compact JSON text, quoted: [1,2] becomes "[1,2]", {"k":"v,w"} becomes "{""k"":""v,w""}"

Strings that look like numbers ("007") are written without any marker, so a spreadsheet may turn them into the number 7 on open. That is the spreadsheet's behaviour, not something the file can prevent.

Quoting

A field is wrapped in double quotes only if it contains a comma, a double quote, a line feed or a carriage return, and embedded quotes are doubled, as RFC 4180 requires. Header names follow the same rule: the key a,b becomes "a,b". Leading and trailing spaces are not quoted, so " pad " is written bare; RFC 4180 treats spaces as part of the field. Non-ASCII text (é中🙂) is written as it is, and the downloaded file is UTF-8 with no byte-order mark.

Spreadsheet formula injection

Values are written exactly as they are. A cell that begins with =, +, - or @ (for example =SUM(A1)) is a formula as far as a spreadsheet is concerned, and OWASP documents this as CSV injection. This tool does not prefix or neutralise such cells. If the data comes from untrusted users and the CSV will be opened in a spreadsheet, sanitise those values yourself first (for example by prefixing a single quote), and note that this changes the data.

Tip: To get nested data into columns, flatten it before converting, so that {"address":{"city":"SG"}} becomes {"address_city":"SG"}. The JSON to text tool shows you the paths you would turn into column names.

Common mistakes

  • Passing an object whose values are the records ({"a":{…},"b":{…}}): it becomes a single row with JSON text cells, not one row per entry.
  • Expecting null and "" to be told apart.
  • Opening a CSV with nested JSON cells in a spreadsheet and expecting separate columns.
  • Treating the output as RFC 4180-exact: it uses LF, not CRLF.

Convert back with CSV to JSON, produce tab-separated output with JSON to TSV, check the input with the JSON validator, or inspect structure in the JSON viewer.

Frequently asked questions

Is my data uploaded anywhere?

No. The conversion runs entirely in your browser using JavaScript. Nothing you paste leaves your device, is logged, or is stored on a server.

How large a document can it handle?

The limit is your browser's memory rather than any server quota. Documents of a few megabytes convert without trouble; very large files may make the page briefly unresponsive while it works.

What happens to nested data?

Formats that have no concept of nesting store nested values as a JSON string inside the cell, so nothing is silently discarded and the structure can be recovered.

Does it handle quotes and commas inside fields?

Yes. Parsing follows RFC 4180, so quoted fields containing commas, escaped double quotes, and line breaks inside a field are all read and written correctly.

Sources

  1. IETF — RFC 4180, Common Format and MIME Type for CSV Files — Informational: fields, quoting, line breaks, header.
  2. IETF — RFC 8259, The JSON Data Interchange Format
  3. OWASP — CSV Injection — Cells starting with =, +, -, @, tab, CR or LF can be treated as formulas.

This guide explains published rules in plain language. It is not financial, legal or official advice — rules change, so confirm with the agency linked above before you commit.

Related tools