How to convert JSON to CSV
1. Add the source
Paste JSON or JSON Lines, upload a supported file, or import a public HTTP or HTTPS URL.
2. Review the table
Inspect the scrollable preview and keep only the columns required by the destination.
3. Export
Download CSV, copy smaller results, or create an XLSX workbook when the result is within the browser-safe Excel limits.
The four conversion rules
One object, one row
Every source object remains one record in the output. Nested arrays do not split the object into extra vertical rows.
Horizontal arrays
Array positions become padded columns such as roles__001, roles__002, and wallets__001.currency.
Full schema discovery
The converter scans the complete collection so fields that appear only in later records still receive correctly aligned columns.
Clean blank cells
Missing fields, null, empty arrays, and empty objects become blank cells instead of literal JSON text.
How nested JSON becomes a flat table
JSON can describe objects, arrays, strings, numbers, booleans, and null values. CSV needs a rectangular structure: one header row followed by records whose values remain under the same columns.
Nested object keys use dot notation. For example, {"address":{"city":"Paris"}} creates the column address.city. Arrays use padded, one-based indexes so column names sort naturally and remain stable as the array grows.
This layout is especially useful for API responses, database exports, ecommerce orders, analytics events, application logs, and other records where the source object must remain intact.
JSON to CSV examples
Primitive arrays expand into numbered columns
Shorter arrays leave the remaining columns blank without creating extra rows.
JSON
[{"userId":1,"roles":["Admin","Developer","Editor"],"lucky_numbers":[7,14,21]},{"userId":2,"roles":["Guest"],"lucky_numbers":[3,9]}]CSV
userId,roles__001,roles__002,roles__003,lucky_numbers__001,lucky_numbers__002,lucky_numbers__003
1,Admin,Developer,Editor,7,14,21
2,Guest,,,3,9,Arrays of objects preserve child fields
The array index is inserted before the nested object key.
JSON
[{"orderId":"A-100","wallets":[{"currency":"USD","type":"fiat"},{"currency":"BTC","type":"crypto"}]}]CSV
orderId,wallets__001.currency,wallets__001.type,wallets__002.currency,wallets__002.type
A-100,USD,fiat,BTC,cryptoFields discovered later remain aligned
The header row is built from the complete dataset, not only the first object.
JSON
[{"id":1,"name":"Alice"},{"id":2,"email":"bob@example.com"}]CSV
id,name,email
1,Alice,
2,,bob@example.comNull and empty containers become blank cells
JSON
[{"id":1,"note":null,"tags":[],"profile":{}},{"id":2}]CSV
id,note,tags,profile
1,,,
2,,,Commas and quotation marks are escaped
The field is quoted because it contains a comma, and each internal quote is doubled.
JSON
[{"message":"He said \"Hello\", then left."}]CSV
message
"He said ""Hello"", then left."JSON Lines becomes one row per line
JSON
{"id":1,"status":"open"}
{"id":2,"status":"closed","owner":"Sam"}CSV
id,status,owner
1,open,
2,closed,SamCSV quoting and escaping
CSV fields must be escaped whenever their contents could be confused with the file structure. The converter applies the active delimiter consistently to headers and values.
| Cell contains | CSV treatment |
|---|---|
| Active delimiter | Wrap the complete field in double quotes |
| Double quote | Double the quote and wrap the field |
| Carriage return or line feed | Wrap the complete field in double quotes |
| None of the above | Write the value without additional quoting |
JSON Lines and large files
JSON Lines, also called JSONL or NDJSON, stores one complete JSON value per line. It is common in logs, data exports, command-line pipelines, and record-oriented datasets.
File bytes are decoded in a Web Worker so parsing and table generation do not run directly in the React interface thread. Top-level arrays and JSON Lines can be consumed incrementally.
The preview shows up to 100 rows and no more than 50,000 visible cells. CSV and XLSX exports still use the complete converted dataset.
Excel safety and data precision
Formula protection is enabled by default. Formula-like text is neutralized before CSV export, while genuine numeric values remain numeric.
Integers beyond JavaScript's safe range are preserved from their original JSON tokens so long IDs and account numbers do not silently lose digits.
CSV is the preferred format for large results. XLSX export uses conservative browser limits because workbook generation requires more memory than streaming plain text.
Privacy and browser limitations
Pasted JSON and local files are processed inside the current browser tab. They are not sent to Olivez. URL imports are direct browser requests to the source website.
The 100 MB limit is a hard validation ceiling, not a guarantee that every document will fit every device. Deep nesting, long arrays, thousands of columns, large cells, Blob downloads, and XLSX generation can require substantially more memory than the source.
Public URL import depends on CORS headers, redirects, authentication requirements, private-network protections, valid UTF-8, and the availability of the remote server.
Conversion stops above 5,000 discovered columns, warns above 500 columns, and rejects nesting beyond 50 levels.
Frequently asked questions
How do I convert JSON to CSV?
Paste JSON, upload a .json, .jsonl, .ndjson, or JSON-containing .txt file, or enter a public JSON URL. Select Convert to CSV, review the preview, choose the columns you need, and download CSV or XLSX.
Does one JSON object always stay on one CSV row?
Yes. Each source object produces exactly one output row. Arrays inside that object expand horizontally into numbered columns instead of creating extra vertical rows.
How are nested JSON objects converted?
Nested object keys use dot notation. For example, address.city becomes its own CSV column while the original record remains on one row.
How are arrays converted?
Arrays expand into one-based padded columns such as roles__001, roles__002, and roles__003. Arrays of objects retain their child fields, such as wallets__001.currency and wallets__001.type.
What happens when later objects contain extra fields?
The converter scans the complete record collection before finalizing the schema. A field that first appears later still receives its own column, and earlier records receive a blank cell in that position.
What happens to null, empty arrays, and empty objects?
They become blank CSV cells. The converter does not insert literal null, undefined, [], or {} text into the output.
Does it support JSON Lines and NDJSON?
Yes. Upload a .jsonl or .ndjson file, or paste one complete JSON value per line. Blank lines are ignored, while malformed lines are reported with a line number.
Is my JSON uploaded?
No. Pasted JSON and local files are processed in your browser. URL imports are fetched directly by your browser from the source website and are not proxied through Olivez.
Can I convert a 100 MB file?
The hard input limit is 100 MB, but successful conversion depends on structure, nesting, array lengths, output width, browser memory, device capability, and the export format.
Why can a public JSON URL fail?
The source website may block cross-origin browser requests, require authentication, redirect to a protected resource, reject private-network access, return invalid JSON, or exceed the size limit.
Why are large integers preserved as text?
JavaScript cannot represent every integer beyond 9,007,199,254,740,991 exactly. Preserving the original token as text prevents database IDs and similar values from silently losing digits.
Why are some CSV values prefixed with an apostrophe?
Formula protection neutralizes formula-like strings before export so spreadsheet applications are less likely to execute untrusted values as formulas.
Can I open the CSV in Excel?
Yes. CSV downloads use UTF-8 with a byte-order mark and CRLF line endings by default for broad spreadsheet compatibility. Both settings can be changed.
Why is Excel export unavailable for some results?
Creating an XLSX workbook requires more browser memory than streaming CSV. The tool applies conservative row, column, cell-count, and cell-length limits and recommends CSV for larger datasets.
Which delimiter should I choose?
Comma is the standard default. Tab, semicolon, and pipe are available when required by regional spreadsheet settings, database imports, or another destination system.
Does the converter preserve Unicode?
Yes. Valid UTF-8 text, including accents, non-Latin scripts, and emoji, is preserved. Malformed UTF-8 is rejected instead of being silently corrupted.
Technical references
These specifications and browser references explain the formats, escaping rules, spreadsheet risks, worksheet limits, and worker architecture used by the converter.