Skip to content

JSON to CSV

Transform JSON arrays into CSV format effortlessly with our free online JSON to CSV converter. Ideal for exporting data to spreadsheets, databases, or any application that requires CSV input. Convert complex JSON data structures into simple, tabular CSV format in seconds.

Reset

Frequently asked questions

How do I convert JSON to CSV?

Paste your JSON array of objects into the input field and click the Convert to CSV button. The tool will automatically extract the object properties as column headers and convert each object into a row of comma-separated values.

What format should my JSON be in?

The JSON should be an array of objects where each object has the same structure, like [{"name": "John", "age": 30}, {"name": "Jane", "age": 25}]. The object keys become CSV column headers, and the values become the data rows.

Can I open the CSV in Excel or Google Sheets?

Yes! The generated CSV format is compatible with all major spreadsheet applications including Microsoft Excel, Google Sheets, LibreOffice Calc, and others. Simply copy the output and paste it, or save it as a .csv file.

What happens to nested objects or arrays in JSON?

Nested objects and arrays are typically converted to strings or flattened depending on the implementation. For complex nested structures, you may need to pre-process your JSON to flatten it before conversion.

How are special characters handled in CSV output?

The tool properly escapes special characters like commas, quotes, and newlines according to CSV standards. Fields containing these characters are automatically wrapped in quotes to ensure valid CSV output.

Can I convert large JSON files?

Yes, the tool can handle moderately large JSON files with hundreds or thousands of records. However, for very large datasets (10,000+ records), performance may vary depending on your browser and device.

How do I preserve data types when converting JSON to CSV?

CSV is inherently a text format, so data type information is lost during conversion. Numbers, booleans, and null values become strings when exported to CSV. To preserve types when importing CSV back into applications: use conventions like quoting strings, leaving numbers unquoted, or add a metadata row indicating column types. Many database import tools and spreadsheet applications have type inference features. For critical type preservation, consider using JSON or other typed formats, or include type information in separate documentation or column naming conventions (like 'age_int', 'price_float').

What's the difference between comma and tab delimited output?

Comma-delimited (CSV) uses commas to separate values and is the most common format, but requires escaping when data contains commas. Tab-delimited (TSV) uses tab characters (\t) as separators, which is beneficial when data frequently contains commas but rarely tabs (like prose, addresses, or descriptions). TSV files are often preferred for datasets with natural language content. However, CSV has broader software support. Both formats require quoting and escaping for newlines and the delimiter character. Choose based on your data content and the receiving application's requirements.

How can I flatten deeply nested JSON for CSV export?

Deeply nested JSON requires flattening strategies: use dot notation for object paths (user.address.city becomes a column header), convert arrays to delimited strings (tags: ['a','b'] becomes 'a;b'), create separate rows for array items (one-to-many relationships), or use multiple CSV files with ID relationships. Libraries like 'json2csv' in Node.js offer automatic flattening with configurable options. Manual flattening gives you control but requires preprocessing. For complex hierarchies, consider if CSV is the right format - databases or JSON might better preserve structure.

Why are there encoding issues when opening CSV in Excel?

Excel often assumes CSV files use the system's default encoding (like Windows-1252) rather than UTF-8, causing international characters to display incorrectly. Solutions: save CSV with UTF-8 BOM (Byte Order Mark) which signals UTF-8 to Excel, use Excel's 'Get Data' import wizard instead of double-clicking, save as Excel format (.xlsx) instead of CSV, or open the CSV in a text editor to verify encoding. For international users, always specify UTF-8 encoding and consider adding BOM. Google Sheets handles UTF-8 better than Excel for direct CSV opening.

About OneClick Pro

OneClick Pro is a free collection of more than 150 web tools for everyday work: converting images and units, formatting and validating code, checking domains and SEO, and working with text, dates and numbers. Every tool runs without registration or subscription, and what you enter is only used to calculate your result and is never stored. Use it as a quick toolbox for one-off tasks, or bookmark the tools you rely on every day.