JSON to CSV

Convert JSON arrays to CSV format for use in spreadsheets or data pipelines. Everything runs in your browser — nothing is sent to any server.

Paste your JSON to get started
Input
CSV

Frequently Asked Questions

How are nested JSON objects handled when converting to CSV?

CSV is a flat, tabular format with no native way to represent hierarchy. The standard approach is flattening: nested objects are expanded into dot-notation column names. For example, {"user": {"address": {"city": "NYC"}}} becomes a column named user.address.city with value NYC. Arrays of primitive values are typically serialized as a JSON string in a single cell. Arrays of objects are the hardest case — some converters create additional rows (one per array element), others serialize the entire sub-array as a string.

What happens to JSON fields with inconsistent structures across array elements?

Real-world JSON APIs often return arrays where not every object has the same keys (sparse data). Most converters collect all unique keys across all objects as column headers and fill missing values with empty strings. This means the output CSV can have many empty cells. If a key appears in only one out of 10,000 objects, that column still appears in the header row. When dealing with heterogeneous API responses, controlling which fields to include is essential to avoid unwieldy output.

How do commas and double quotes inside field values affect CSV output?

Per RFC 4180, any field that contains a comma, a double quote, or a newline must be enclosed in double quotes. A double quote within an already-quoted field is escaped by doubling it: the value He said "hello" is written as "He said ""hello""". If a JSON string value contains these characters and the converter does not wrap them correctly, the resulting CSV will be malformed and will parse incorrectly in Excel or downstream code.

Does JSON-to-CSV conversion preserve data types?

No. CSV has no type system — it is plain text. Numbers, booleans, and null become their string representations. true becomes the string "true", 42 becomes "42", null becomes an empty cell or the string "null" depending on the tool. When you import the CSV into a spreadsheet or parse it with code, type inference re-applies. Excel auto-detects numbers and dates but treats everything else as strings. If you need to round-trip data through CSV without losing types, you need a separate schema to re-cast fields on import.

Can I convert JSON to CSV if the input is not an array of objects?

It depends on the structure. An array of objects is the ideal input — each object becomes a row, keys become column headers. A single object becomes one row. A flat array of primitives ([1, 2, 3]) can be written as a single column or row. Deeply nested single-object structures without a natural array axis cannot be meaningfully converted to tabular CSV without first identifying which repeated sub-structure maps to rows — attempting to flatten an arbitrary document requires manual specification of the 'row-generating' path.