HomeBlogsHow To Use Json To Csv
Developer ToolsUpdated 2025-04-10

How to Convert JSON to CSV: Turn APIs Into Spreadsheets Instantly

Master the JSON to CSV converter with live table preview, nested object flattening, and custom delimiters. Perfect for data analysts, backend developers, and anyone working with REST API responses.

Introduction

REST APIs return data as JSON, but spreadsheets, data analysis tools like Excel and Google Sheets, and most reporting platforms expect CSV. Bridging this gap manually is tedious and error-prone. Our JSON to CSV converter handles the translation automatically—including flattening nested JSON objects into flat columns—with a real-time table preview so you can see exactly what your spreadsheet will look like before downloading. Everything runs in your browser, so your data stays private.

Step-by-Step Guide

1

Paste Your JSON Array

Click the "JSON SOURCE" editor panel on the left and paste your JSON. The input must be a top-level array of objects (e.g., from a REST API response). Click "Load Sample" to see an example with nested objects demonstrating the flattening feature.

2

Configure Conversion Options

In the Options panel below the editor, toggle "Include Header Row" to control whether column names appear in the first row. Enable "Flatten Objects" to automatically convert nested objects like {"metrics": {"reach": 4500}} into flat columns like "metrics_reach". Choose your delimiter: Comma for standard CSV, Semicolon for European Excel, or Tab for TSV.

3

Click Convert and Preview

Click the "Convert" button. The live table preview on the right will immediately show your data as a formatted table with proper headers and rows. Scroll through to verify the structure before downloading.

4

Download or Copy

Use "Download .csv" to save the file directly to your device, or "Copy CSV" to paste it into a spreadsheet application. The download button in the preview header also gives you quick access.

Pro Tips & Best Practices

Pro Tip

Always verify nested object flattening with a small sample first—deep nesting can produce many columns.

Pro Tip

For European Excel users, switch to the Semicolon delimiter since Excel in some locales uses semicolons by default.

Pro Tip

The "Format JSON" button in the editor header will auto-indent your JSON, making it easier to spot structural issues before converting.

Pro Tip

If your JSON contains dates as ISO strings, they will be preserved as-is in CSV. Excel may auto-format them upon import.

Pro Tip

Numeric values like prices or IDs are exported without quotes, ensuring they are treated as numbers in Excel.

Common Mistakes to Avoid

Common Mistake to AvoidPassing a JSON object instead of an array: The tool expects a root-level array. If your API returns a single object, wrap it in square brackets: [{...}].
Common Mistake to AvoidDeeply nested arrays within objects: Arrays inside JSON objects (like tags: ["a", "b"]) will be converted to a string representation. Consider flattening these manually first.
Common Mistake to AvoidInvisible special characters: Some JSON copied from web pages may contain non-breaking spaces or Unicode control characters that disrupt parsing.
Common Mistake to AvoidInconsistent keys across objects: If different objects in the array have different keys, some cells will be empty. Ensure your data has a consistent schema.

Frequently Asked Questions

Does the JSON have to be a specific structure?

Yes—the root element must be a JSON array. Each item in the array should be an object. The converter collects all unique keys across all items to build the column headers, handling missing fields with empty values.

What happens to nested objects if I turn off flattening?

Without flattening, nested objects are serialized as their JSON string representation within the CSV cell. For example, a "metrics" object becomes the string {"reach":4500,"engagement":0.85} in one cell.

Is there a file size limit?

Since processing happens locally in your browser, the limit is determined by your device memory. In practice, JSON files up to several megabytes convert instantly. Very large files (100MB+) may cause the browser to slow down.

Can I import the CSV into Google Sheets directly?

Yes. Download the CSV, then in Google Sheets go to File → Import and upload the file. Select the appropriate separator (comma or semicolon) that matches your chosen delimiter.

Ready to use the
How to Convert JSON to CSV: Turn APIs Into Spreadsheets Instantly?

Join thousands of developers who trust Toolkitscenter for fast, secure, and private browser-based utilities.