← Back to PtrJns.co.uk

JSON to CSV Converter

Processes various JSON formats including arrays of objects, single objects, arrays of primitive values, and schema/data structures. See "JSON Processing Guide" below for details.

Drop your JSON file here

Download CSV
No file chosen.
JSON Processing Guide
How Different JSON Formats Are Processed

This converter is designed to intelligently interpret various JSON structures and transform them into a flat, tabular CSV format suitable for tools like Google Sheets. Here's how different types of JSON are handled:

1. JSON with "schema" and "data" arrays

Format: {"schema": [{"field_code": "col1"}, {"field_code": "col2"}], "data": [["val1", "val2"], ["val3", "val4"]]}

  • Processing: The tool directly uses the field_code values from the schema array as CSV headers. The corresponding arrays of values from the data array are used as rows.
  • Modification: This format is processed as-is, with no structural modification to the data itself, only conversion to CSV syntax.

2. Array of Objects (Flat or Nested)

Format: [{"id": 1, "name": "Item A"}, {"id": 2, "details": {"color": "red", "size": "M"}}]

  • Processing: Each object in the array becomes a row in the CSV.
  • Modification (Flattening):
    • Nested Objects: Keys of nested objects are flattened using dot notation (e.g., "details.color", "details.size").
    • Simple Arrays: Arrays containing only primitive values (strings, numbers, booleans) are expanded into new columns with indexed keys (e.g., "tags": ["a", "b"] becomes "tags.0": "a", "tags.1": "b").
    • Complex Arrays: Arrays containing objects or other arrays (e.g., "items": [{"id": 1}, {"id": 2}]) are converted into a JSON string within a single CSV cell to prevent an explosion of columns.
    • Inconsistent Keys: If objects in the array have different keys, all unique keys across all objects will become headers. Missing values for a given key in a row will appear as empty cells.

3. Single Object

Format: {"product_code": "XYZ", "price": 10.99, "dimensions": {"length": 5, "width": 3}}

  • Processing: The single object is treated as one row in the CSV.
  • Modification (Flattening): Similar to arrays of objects, any nested objects or simple arrays within this single object will be flattened into new columns using dot notation.

4. Array of Primitive Values

Format: ["apple", "banana", "cherry"]

  • Processing: A single column named "Value" is created. Each primitive value from the array becomes a separate row under this column.
  • Modification: The array is transformed into a list of single-column rows.

5. Single Primitive Value

Format: "hello world" or 123 or true

  • Processing: A single column named "Value" is created, and the primitive value becomes the single row under this column.
  • Modification: The primitive value is wrapped to fit into a single-cell CSV structure.
About & Security
About This Tool & Your Data Security

Secure JSON to CSV Conversion – Right in Your Browser.

Effortlessly transform your large JSON files into Google Sheets-ready CSVs, with absolute peace of mind.

Dealing with large JSON data? Need it neatly organised for Google Sheets, but concerned about privacy and data security? This client-side JSON to CSV converter is built precisely for you.

Your Data Stays Yours. Period.

Sensitive data needs to be handled with the utmost care. Unlike many online converters, this tool operates entirely within your web browser. This means:

  • No Uploads: Your JSON file is never uploaded to servers, or any server.
  • Local Processing: All conversion happens directly on your computer.
  • Zero Storage: No data is stored, logged, or even temporarily accessed.
  • Complete Privacy: Your information remains private and secure on your device from start to finish.

This ensures that even your most confidential datasets can be converted without compromise.

How It Works (The Secure & Simple Way):

  1. Select Your File: You choose your JSON file from your local computer.
  2. Browser Processes: Your web browser reads the file's content directly into its memory. The JavaScript code then performs the conversion from JSON to CSV, all within your browser's environment.
  3. Instant Download: The generated CSV file is immediately prepared for download to your device. It's never transmitted over the internet.

Once the process is complete, the temporary data is cleared from your browser's memory.

Key Features & Benefits:

  • Unmatched Privacy: Your data stays local, always.
  • Google Sheets Ready: Generates clean CSV files optimized for easy import.
  • Flexible Input: Supports standard JSON arrays of objects, or JSON with dedicated schema and data sections.
  • Fast & Efficient: Client-side processing means quick conversions (dependent on your computer's resources).
  • User-Friendly: Simple interface for a straightforward conversion experience.
  • Free to Use: Access powerful conversion capabilities without cost.

Important Note for Very Large Files: While this tool is efficient, browser limitations might affect performance when handling extremely massive JSON files (e.g., hundreds of megabytes to gigabytes). For such cases, local scripting solutions might offer superior performance.