JSON ↔ CSV
Convert JSON arrays of objects to CSV and back. Handles nested objects with dot-path flattening, inconsistent keys, and proper CSV escaping.
About this tool
CSV is flat and tabular; JSON is hierarchical. Converting between them requires decisions about how to handle nested data. Common scenarios: exporting database results to CSV for spreadsheet analysis, importing CSV rows into APIs that expect JSON, or moving data between an ETL tool that speaks one format and a destination that speaks the other.
Single objects vs. arrays. CSV represents rows, and rows come from an array. If you paste a single object, the tool wraps it in a one-row array automatically and warns you. Inconsistent shapes. If different rows have different keys, the output takes the union of all keys; missing values render as empty cells.
Nested objects. Enable “Flatten nested objects” to
convert paths like {"user": {"name": "Alice"}} into
columns named user.name. Without flattening, nested
objects and arrays are JSON-stringified into a single cell — rarely
useful for spreadsheet consumers.
CSV edge cases. Values with commas, quotes, or line breaks are quoted on output per RFC 4180. The parser handles quoted fields, escaped quotes, BOMs, and mixed line endings. Unicode is preserved in both directions. The heavy lifting is done by Papa Parse, a well-tested client-side CSV library.
Frequently asked questions
How do I handle nested JSON?
Enable “Flatten nested objects.” Each nested path becomes a column named with dot notation: `{"user": {"name": "Alice"}}` produces a column called `user.name`. Without flattening, nested values are JSON-stringified into a single cell, which is usually not what you want.
Why did my number become a string?
Papa Parse’s “Dynamic typing” option coerces cells that look like numbers or booleans back to those types on CSV → JSON. Turn it off if you need every value as a string.
What about commas in my data?
Handled correctly. CSV fields with commas, quotes, or newlines are quoted on output and parsed as quoted fields on input. The sample data includes a value with a comma to demonstrate.
Can I convert an array with objects that have different keys?
Yes. The converter takes the union of all keys across all rows — missing values become empty cells.
Does this handle large files?
Paste-in works up to about 50 MB before the browser slows. For very large datasets prefer a command-line tool. Everything runs in your browser, so there is no upload limit — just your tab’s memory.