formatting
JSON to CSV Converter
Convert a JSON array of objects to CSV, or parse CSV back to JSON.
JSON to CSV Converter
Convert a JSON array of objects to CSV, or parse CSV back to JSON.
What is this?
JSON (JavaScript Object Notation) and CSV (Comma-Separated Values) are the two most common formats for exchanging tabular data. JSON is the native format for REST APIs, NoSQL databases, and JavaScript applications. CSV is the native format for spreadsheet tools like Excel and Google Sheets, SQL import utilities, data pipelines, and business reporting tools. Converting between them is one of the most frequent data engineering tasks: you might export an API response to a spreadsheet for analysis, import a CSV upload into a database, or transform a data warehouse export into JSON for an API. This tool converts a JSON array of objects to a CSV with a header row derived from the object keys, or parses a CSV back to a JSON array. Nested objects are optionally flattened using dot-notation keys (address.city) so the entire structure fits into a flat table.
How to use
- Paste your JSON array or CSV: For JSON-to-CSV: paste a JSON array of objects (e.g. [{"name":"Alice","age":30}]). For CSV-to-JSON: paste a CSV string with a header row as the first line.
- Choose mode and delimiter: Select 'json-to-csv' or 'csv-to-json'. Choose the field delimiter — comma is the universal default; semicolon is common in European locales where comma is the decimal separator; tab (TSV) is used by Excel exports and some databases.
- Copy the output: The converted CSV or JSON appears instantly. For CSV output, paste it directly into a spreadsheet or save it as a .csv file. For JSON output, paste it into your application or use it in a script.
FAQ
- What happens to nested objects?
- With flatten enabled (the default), nested objects are expanded using dot-notation keys. For example, {address: {city: 'London'}} becomes a column named 'address.city'. With flatten disabled, the nested object is JSON-stringified and placed in a single cell.
- What if my CSV values contain commas or newlines?
- The converter follows RFC 4180: values containing the delimiter, double quotes, or newlines are enclosed in double quotes, and any double quotes within the value are escaped as two consecutive double quotes. The CSV-to-JSON parser handles this correctly.
- Does the JSON-to-CSV converter handle arrays of arrays or mixed types?
- The converter expects a JSON array of flat objects. Arrays of arrays are not tabular data and cannot be meaningfully converted to CSV. Mixed types (some rows have extra fields) are handled by taking the union of all keys across all rows and leaving cells empty where a field is absent.
What is JSON to CSV Converter?
JSON (JavaScript Object Notation) and CSV (Comma-Separated Values) are the two most common formats for exchanging tabular data. JSON is the native format for REST APIs, NoSQL databases, and JavaScript applications. CSV is the native format for spreadsheet tools like Excel and Google Sheets, SQL import utilities, data pipelines, and business reporting tools. Converting between them is one of the most frequent data engineering tasks: you might export an API response to a spreadsheet for analysis, import a CSV upload into a database, or transform a data warehouse export into JSON for an API. This tool converts a JSON array of objects to a CSV with a header row derived from the object keys, or parses a CSV back to a JSON array. Nested objects are optionally flattened using dot-notation keys (address.city) so the entire structure fits into a flat table.
How to use JSON to CSV Converter
- Paste your JSON array or CSV: For JSON-to-CSV: paste a JSON array of objects (e.g. [{"name":"Alice","age":30}]). For CSV-to-JSON: paste a CSV string with a header row as the first line.
- Choose mode and delimiter: Select 'json-to-csv' or 'csv-to-json'. Choose the field delimiter — comma is the universal default; semicolon is common in European locales where comma is the decimal separator; tab (TSV) is used by Excel exports and some databases.
- Copy the output: The converted CSV or JSON appears instantly. For CSV output, paste it directly into a spreadsheet or save it as a .csv file. For JSON output, paste it into your application or use it in a script.
Frequently asked questions
- What happens to nested objects?
- With flatten enabled (the default), nested objects are expanded using dot-notation keys. For example, {address: {city: 'London'}} becomes a column named 'address.city'. With flatten disabled, the nested object is JSON-stringified and placed in a single cell.
- What if my CSV values contain commas or newlines?
- The converter follows RFC 4180: values containing the delimiter, double quotes, or newlines are enclosed in double quotes, and any double quotes within the value are escaped as two consecutive double quotes. The CSV-to-JSON parser handles this correctly.
- Does the JSON-to-CSV converter handle arrays of arrays or mixed types?
- The converter expects a JSON array of flat objects. Arrays of arrays are not tabular data and cannot be meaningfully converted to CSV. Mixed types (some rows have extra fields) are handled by taking the union of all keys across all rows and leaving cells empty where a field is absent.