JSON to CSV Converter — Export JSON Records as a Spreadsheet Table

A JSON to CSV converter transforms a JSON array of objects into a table with column headings. Paste JSON or upload a file, choose how nested fields are represented, and download a CSV.

JSON to CSV Converter

Loading conversion controls…

JSON to CSV Converter At a Glance

JSON is commonly used to exchange application data, and CSV is a familiar format for flat tables. This converter accepts a JSON array containing objects and creates a set of CSV columns from their property names. It recognizes property names that appear only in later records, combines the complete set of headings, and places missing values into empty cells. The result can be reviewed in a table preview before export.

When objects contain nested properties, you can flatten those properties into dotted column names such as customer.name or address.city. Arrays are represented as JSON text inside a cell so their contents are not silently discarded. If you prefer to keep an entire nested object together, disable flattening and the object will be serialized in one cell. Neither option converts a deeply nested dataset into multiple relational tables automatically.

How to Convert JSON into CSV

Paste a JSON array into the editor or choose a .json file. Check that the text begins with an opening square bracket and contains object records rather than a single standalone object. The converter does not treat arbitrary JSON values as rows because a clear record structure is necessary to build meaningful columns. Select whether nested objects should be flattened into dotted fields.

Choose your CSV separator and run the conversion. Comma is widely used, while semicolon and tab can be better choices for certain systems or regional exports. Inspect the heading row and a few records, then download the CSV. The tool adds quoting where necessary, including cells containing delimiters or newlines. It also protects text that a spreadsheet might otherwise interpret as a formula when opening the CSV.

Understanding JSON Objects and CSV Rows

A JSON object associates property names with values. An array of objects can represent customers, orders, event logs, or product records. CSV does not preserve that object structure directly; it writes a heading row followed by a rectangular table. If one record contains a property that another record lacks, the output still includes that column, but the missing cell is empty.

This difference matters when CSV files are imported back into software. An empty cell cannot always distinguish between an absent JSON property, a property whose value was null, and a property containing an empty string. The converter favors a readable table, not perfect round-trip preservation of every JSON type. Keep the original JSON if those distinctions affect software behavior or audits.

How Nested JSON Becomes Columns

Suppose an object contains a customer property holding a second object with name and city. With flattening enabled, the table has customer.name and customer.city headings. This makes it easier to filter the customer city in a spreadsheet and sort values beside other record fields. Dotted names are a practical convention, but they are not an official schema guaranteed to reconstruct the original hierarchy.

Arrays have no obvious one-row CSV representation when elements contain several objects. This converter writes their serialized JSON into one cell instead of creating an unpredictable number of new rows. That preserves the visible contents, although a spreadsheet user may need to inspect or process the cell separately. If your application requires one row per array item, restructure the input JSON deliberately before converting it.

What Happens to Numbers, Booleans, and Null Values

JSON distinguishes strings, numbers, booleans, null, arrays, and objects. CSV fundamentally stores text separated by delimiters. A JSON number such as 19.5 is written as visible characters, and a boolean such as true becomes the text true. A null value is represented as an empty CSV cell. The original JSON type is not stored in the CSV standard, so programs importing the output may choose their own interpretation.

This can be important for long numeric identifiers, dates, or values beginning with zeros. JSON itself may already have lost leading zeros if the source encoded an identifier as a number rather than a string. CSV cannot recover information missing from the original. If an identifier must keep a precise string representation, make sure it is a string before conversion and verify how your destination spreadsheet or database imports that text.

CSV Quoting and Spreadsheet Safety

Consider a product description that contains commas, embedded quotation marks, and a second line of explanatory text. In the output, the field is wrapped in quotation marks and internal quotes are escaped so compliant CSV readers treat it as one value. A semicolon-delimited export uses the same principle, but quotes fields when they contain semicolons. This makes CSV suitable for ordinary human-readable tabular data despite its simple appearance.

Some spreadsheet applications interpret cells beginning with equals signs or certain other characters as formulas. That is risky when text originates from untrusted records. The converter adds a text prefix to values that might be interpreted as spreadsheet formulas during CSV import. The prefix deliberately changes the exported text representation to make spreadsheet use safer; verify downstream requirements if exact byte-for-byte preservation matters.

Example: Exporting API Results

Imagine an API returns three product objects. The first contains sku, title, price, and stock. The second includes an additional color property, while the third omits stock. The converter gathers all five property names and makes them CSV headings. The missing stock cell stays empty, and the color column still appears for every row. This allows a spreadsheet user to compare records even when the JSON objects are not identical.

After exporting, check the title values for punctuation and verify price formatting. A price field that is numeric in JSON becomes text in the CSV file, and spreadsheet software may interpret it as a number when opened. That may be desirable for analysis, but it depends on the import settings. If you later need records back in object form, CSV to JSON conversion can rebuild a flat JSON array, although nested types need special handling.

Flattening Versus Keeping Complex Values Together

Flattening is useful when the immediate task is filtering, sorting, and examining individual nested properties. For example, a report of shipping addresses can become easier to work with when city and country occupy separate columns. However, flattening also creates longer headers, and special characters in property names can make those headers harder to parse elsewhere. Review the resulting names before treating them as a long-term data schema.

Keeping nested objects in one CSV cell is more appropriate when those structures are opaque data that another application will parse later. The result is less convenient for spreadsheet filtering, but it avoids inventing extra columns for every nested field. Neither mode turns multiple independent arrays into a well-normalized database. For complicated business exports, define the desired table layout before conversion rather than assuming one automatic flattening rule can describe every record.

Checking the Export Before Sharing

Count the records in the JSON array and compare that with the rows beneath the CSV heading. Confirm that property names are spelled correctly and examine any columns with missing values. Check non-English characters and symbols after opening the CSV in the destination application, because encoding assumptions may differ. The downloaded file includes a UTF-8 marker to help commonly used spreadsheet programs recognize its character encoding.

A preview shows representative rows but does not replace a full inspection of a high-stakes dataset. Read a few late records that contain less common properties and test the CSV with the actual import system. The Data & CSV tools category includes additional paths for moving the same information into a spreadsheet workbook when editing in Excel is the ultimate goal.

File Size and Format Limits

The converter accepts up to 25,000 records and 100 distinct headings, with a maximum of 500,000 table cells. Very large JSON files may require a streaming conversion process instead of a single-page editor. The input must be a valid JSON array of objects. A top-level object, mixed arrays of strings and objects, or invalid commas produce a clear error rather than a partial CSV output.

For data with many nested arrays, consider whether CSV is the correct destination format at all. A rectangular table cannot retain arbitrary nested relationships without choosing a convention. When the objective is simply sharing records in Excel, CSV to XLSX conversion can take the generated CSV and produce an editable worksheet. Keep the source JSON for cases where structure and types matter more than spreadsheet convenience.

Frequently Asked Questions

Can I convert a single JSON object?

The input must be an array of objects, even when it contains only one object, so that rows and headings are well defined.

Will nested JSON be preserved exactly?

Not as a full hierarchy. Flattening creates dotted columns, while the alternative stores a nested object as serialized JSON text.

How are JSON arrays represented?

Arrays are serialized as JSON strings in their cells. They are not automatically expanded into additional CSV records.

Does CSV keep JSON numeric and boolean types?

CSV stores characters, not native JSON types. The destination program decides how to interpret the exported values.

What happens when records have different properties?

The converter combines property names into a complete heading row and leaves missing entries blank.

Is the generated CSV safe to open in spreadsheets?

Potential formula-like text receives a safety prefix, but users should still check data provenance and the spreadsheet importer.