Convert JSON to CSV Online
Free, fast, and easy. Paste your JSON or upload a file.
JSON to CSV Converter Tool
Or try an example:
How it works
- 1. Input your JSON
Paste JSON directly or upload a .json file (up to 10MB).
- 2. Convert
Click the convert button. Nested objects are flattened using dot notation.
- 3. Download
Your CSV file downloads automatically. No data is stored on our servers.
Complete Guide to Converting JSON to CSV
When to Use This Tool
This JSON to CSV converter is perfect for developers, data analysts, and anyone who needs to transform JSON data into a spreadsheet-friendly format. Common use cases include:
- Exporting API responses to Excel or Google Sheets
- Converting database exports for reporting
- Transforming log files for analysis
- Preparing data for import into other systems
- Creating readable reports from JSON configuration files
Step-by-Step Instructions
Option A: Paste JSON Directly
Select the "Paste JSON" tab and paste your JSON data into the text area. This is ideal for small to medium datasets or when you want to quickly test a conversion. The tool accepts both JSON arrays (multiple records) and single JSON objects.
Option B: Upload a File
Select the "Upload File" tab to drag and drop a .json file, or click to browse your files. This method is best for larger datasets up to 10MB. The file must have a .json extension and contain valid JSON data.
Converting and Downloading
Once your JSON is loaded, click the "Convert to CSV" button. The conversion happens instantly in your browser, and the CSV file downloads automatically. For uploaded files, the output filename matches your input file with a .csv extension.
Tips for Best Results
- Ensure your JSON is valid before converting. Invalid JSON will show an error message.
- For nested objects, fields are flattened using dot notation (e.g.,
user.address.city). - Arrays within objects are indexed numerically (e.g.,
items.0.name,items.1.name). - If your JSON has inconsistent fields across records, all unique fields will appear as columns.
- Large files may take a moment to process. The loading indicator shows conversion progress.
Understanding JSON Format
What is JSON?
JSON (JavaScript Object Notation) is a lightweight data format used to store and exchange data. It's human-readable and widely used in web APIs, configuration files, and data storage. JSON consists of key-value pairs organized in objects and arrays.
Valid JSON Structures for Conversion
This converter accepts two main JSON structures:
Array of Objects (Recommended)
Each object becomes a row in your CSV. This is the most common format for tabular data.
[
{"name": "Alice", "age": 30, "city": "New York"},
{"name": "Bob", "age": 25, "city": "Los Angeles"},
{"name": "Carol", "age": 35, "city": "Chicago"}
]Single Object
A single object is converted to one row of data.
{"name": "Alice", "age": 30, "city": "New York"}Handling Nested Data
Real-world JSON often contains nested objects and arrays. Our converter flattens these automatically using dot notation:
Input JSON
{
"user": {
"name": "Alice",
"address": {
"city": "NYC",
"zip": "10001"
}
},
"orders": [
{"id": 1, "total": 99},
{"id": 2, "total": 150}
]
}CSV Columns
user.name user.address.city user.address.zip orders.0.id orders.0.total orders.1.id orders.1.total
Common JSON Mistakes
- Missing quotes around keys: Use
{"name": "value"}not{name: "value"} - Single quotes: JSON requires double quotes. Use
"text"not'text' - Trailing commas: Remove the comma after the last item in arrays and objects
- Unescaped special characters: Escape quotes inside strings with backslash:
\"
Understanding Your CSV Output
What is CSV?
CSV (Comma-Separated Values) is a simple text format for storing tabular data. Each line represents a row, and values are separated by commas. CSV files can be opened in Excel, Google Sheets, Numbers, and most database tools, making it the universal format for data exchange.
How Flattening Works
Since CSV is a flat format (rows and columns only), nested JSON structures must be flattened. Our converter uses dot notation to preserve the hierarchical relationship:
- Nested objects:
user.profile.nameindicatesnameinsideprofileinsideuser - Array items:
items.0,items.1,items.2for each array element - Nested arrays:
orders.0.products.0.namefor deeply nested structures
CSV Formatting Rules
The converter handles special characters automatically to ensure your CSV opens correctly:
- Commas in values: Values containing commas are wrapped in double quotes
- Quotes in values: Double quotes are escaped by doubling them (
"") - Line breaks: Newlines within values are preserved and the value is quoted
- Empty values: Null or undefined values become empty cells
Working with Variable Schemas
When your JSON objects have different fields (some records have properties others don't), the converter creates columns for all unique fields found across all records. Records missing a field will have an empty cell in that column. This ensures no data is lost during conversion.
Opening Your CSV File
After downloading, you can open your CSV in:
- Microsoft Excel: Double-click the file or use File → Open
- Google Sheets: Upload to Google Drive or File → Import
- Apple Numbers: Double-click or drag into Numbers
- Text editors: Open in VS Code, Notepad++, or any text editor to see raw data
Frequently Asked Questions
Is my data safe? Where is it processed?▼
What is the maximum file size I can convert?▼
What browsers are supported?▼
Can I convert nested JSON with arrays?▼
user.address.city for nested objects and items.0.name for array elements. This preserves all your data in a flat CSV structure.