>_ MoriDev dev.moritools.com
RFC 4180 100% Client-Side · Zero Upload

JSON to CSV & CSV to JSON Converter

Flatten nested JSON objects to RFC 4180 CSV spreadsheets or parse quoted multiline CSV tables back into typed JSON arrays.

Ready (Offline)
Quick Summary

Transform API arrays of nested JSON objects into RFC 4180 CSV files with automatic dot-key flattening and one-click .csv download, or parse complex quoted CSV exports back into typed JSON.

Analytics teams, finance stakeholders, and CRM imports almost universally ask for spreadsheets, whereas APIs return heterogeneous arrays of deeply nested JSON objects. Ad-hoc string.split(",") scripts corrupt rows the moment a customer address contains a comma or embedded newline.

This bidirectional tool implements a state-machine RFC 4180 CSV parser and serializer, recursively flattens nested objects into dot-delimited columns (customer.tier), escapes embedded double quotes by doubling them, and supports comma, semicolon, or tab delimiters.

CSV Data Corruption Bugs to Avoid

01. Naive Comma Splitting Breaks Quoted Fields

A cell like "Austin, TX" or "Includes ""priority"" SLA" contains internal commas and quotes. Only a stateful RFC 4180 tokenizer preserves column boundaries across quoted fields and embedded line breaks.

02. Heterogeneous JSON Rows Missing Optional Columns

When row 1 omits a discountCode property that appears on row 47, scanning only the first object drops the column. This converter unions all keys across every record before emitting the header row.

03. European Semicolon Delimiters & UTF-8 BOM

Regional Excel installations expect semicolons when commas act as decimal separators, and CSV exports from Windows frequently start with a UTF-8 BOM (\uFEFF). Our parser strips BOMs automatically and lets you pick the delimiter.

RFC 4180 Escaping & Flattening Rules

Scenario Rule Applied CSV Output
Nested Object Recursive dot-path header generation when Flatten is on user.email,user.plan
Embedded Comma Entire cell wrapped in double quotes "Seattle, WA"
Embedded Quote Each literal quote doubled inside quoted cell "Say ""hello"""
Nested Array Serialized cleanly as JSON string cell "[""pro"",""beta""]"
Null / Undefined Emitted as empty cell without literal "null" noise id,,status

Worked Engineering Examples

Flattening Nested Billing Records

Input
[{"id":1,"buyer":{"name":"Ada","vip":true}},{"id":2,"buyer":{"name":"Linus"}}]
Output
id,buyer.name,buyer.vip
1,Ada,true
2,Linus,

Every object key across all rows is collected into a unified header, leaving missing optional fields empty.

Parsing Multiline Quoted CSV Back to JSON

Input
sku,notes
A-10,"Line 1
Line 2, ""fragile"""
Output
[{"sku":"A-10","notes":"Line 1\nLine 2, \"fragile\""}]

The stateful parser keeps the embedded newline and unescapes doubled quotes accurately.

Frequently Asked Questions

Can I convert a single JSON object instead of an array?

Yes. If the root JSON value is a plain object, the converter wraps it as a single data row under its extracted header columns.

Does CSV to JSON reconstruct nested objects from dot headers?

Toggle the Unflatten / Flatten option when switching to CSV → JSON to rebuild columns like customer.name into nested {"customer":{"name":"..."}} structures.

How does type inference handle numbers and booleans in CSV?

CSV stores everything as text; when converting CSV to JSON, numeric strings, true/false, and null are parsed into native JSON primitives while preserving zip codes or mixed text safely.

Can I download the resulting spreadsheet directly?

Click Download in the toolbar to save a clean .csv (or .json in reverse mode) file generated via a local Blob URL.

Continue Your Workflow

24 offline developer utilities