About this tool
Converting between hierarchical JSON object arrays and tabular CSV (Comma-Separated Values, RFC 4180) is a frequent task across business analytics, data engineering, and Excel reporting. While JSON excels at microservice data exchange, CSV is the universal standard for spreadsheets and bulk database ingest. This tool provides bidirectional real-time conversion with nested key flattening, custom delimiter selection, and UTF-8 BOM encoding for seamless Excel compatibility.
How to Use This Tool (Step-by-Step)
Paste JSON Array or CSV Text
Paste your raw JSON object collection or CSV spreadsheet rows into the input area. The parser auto-detects column headers.
Select Direction & Parsing Options
Toggle between 'JSON to CSV' and 'CSV to JSON'. Optionally enable nested object flattening and custom field delimiters.
Copy Converted Text or Download
Preview the structured output instantly. Copy plain text with one click or export a UTF-8 BOM CSV file directly into Microsoft Excel.
Automatic Nested Key Flattening
Recursively unwraps deep hierarchical structures into dot-notation column headers (e.g., 'user.profile.age') for flat tables.
UTF-8 BOM Excel Fix
Injects standard byte-order mark (BOM) on file downloads, preventing character encoding corruption when opening Chinese text in Excel.
100% Client-Side Air-Gapped
Data parsing runs exclusively inside your browser runtime. Proprietary financial records and user tables never touch remote servers.
RFC 4180 Standards & Excel Data Gotchas
- •Prevent Excel scientific notation on IDs: Numbers over 11 digits auto-convert to scientific format (1.23E+11), losing precision. Prepend a tab or format as strings.
- •Preserve column count on missing attributes: Missing JSON keys must yield empty fields between commas (`101,,Dev`) to prevent column misalignment.
- •Guard against CSV Injection: Values beginning with '=', '+', '-', or '@' can execute arbitrary spreadsheet macros in Excel. Sanitize user inputs before exporting.
Code & Transformation Examples
JSON Array to Standard CSV Row Benchmark
[
{ "id": 101, "name": "张三", "role": "开发", "city": "北京" },
{ "id": 102, "name": "李四", "role": "设计", "city": "上海" }
]id,name,role,city
101,张三,开发,北京
102,李四,设计,上海* The first line establishes column headers derived from object keys, followed by value rows.
RFC 4180 Escaping Rules for Commas and Quotes
字段值内含有逗号: "北京, 海淀"
字段值内含有双引号: Say "Hello"id,address,quote
1,"北京, 海淀","Say ""Hello"""* Fields containing commas must be wrapped in quotes; internal quotes must be doubled ("").
Frequently Asked Questions
Q: Why does Excel show gibberish for Chinese CSV files?
A: Windows Excel defaults to local legacy codepages (GBK/ANSI). Prepending a 3-byte UTF-8 BOM (`\uFEFF`) forces Excel to render Chinese characters properly.
Q: Can JSON containing arrays inside fields be converted to CSV?
A: Yes. Array properties are serialized into semicolon-delimited strings inside a single cell (e.g., 'tech; web') to preserve 2D grid structure.
Q: Will converting tens of thousands of JSON rows crash my browser?
A: Buffer optimizations handle tens of thousands of records smoothly. For massive hundred-megabyte datasets, server-side streaming pipelines are recommended.