JSON ke CSV

Ubah array JSON ke format CSV.

Alat Developer

Cara Menggunakan JSON ke CSV

  1. 1Tempel array JSON Anda
  2. 2Klik Konversi ke CSV
  3. 3Salin atau unduh output CSV

Tentang JSON ke CSV

Konverter JSON ke CSV mengambil array JSON dari objek dan mengubahnya ke format CSV. Nama properti dari objek pertama diekstrak dan digunakan sebagai header kolom.

Fitur Utama JSON ke CSV

  • Convert a JSON array of objects to CSV format instantly
  • Automatically extracts column headers from the first object's keys
  • Properly quotes fields containing commas, newlines, or double quotes
  • Handles missing properties in some objects (outputs empty cells)
  • RFC 4180-compliant CSV output — compatible with Excel and Google Sheets
  • Works entirely in-browser — no server upload required
  • Copy or download the CSV output with one click
  • Handles large JSON arrays efficiently

Format yang Didukung

Format Input

Array JSON dari objekJSON terformat atau diminifikasi

Format Output

CSV dengan baris headerFormat yang sesuai RFC 4180

Mengharapkan array objek datar. Objek bersarang diserialisasi sebagai string JSON dalam sel CSV.

Contoh

Convert API response data to CSV for a spreadsheet

Export a JSON array from an API into a format ready for Excel or Google Sheets.

Input

[{"name":"Alice","role":"Admin","active":true},{"name":"Bob","role":"User","active":false}]

Output

name,role,active
Alice,Admin,true
Bob,User,false

Convert a JSON product catalog to CSV for bulk import

Prepare product data from a JSON file for bulk import into an e-commerce platform.

Input

[{"sku":"ABC-1","title":"Widget","price":9.99},{"sku":"ABC-2","title":"Gadget","price":24.50}]

Output

sku,title,price
ABC-1,Widget,9.99
ABC-2,Gadget,24.50

Kasus Penggunaan Umum

  • Exporting API response data into a spreadsheet for non-technical stakeholders
  • Converting database JSON exports to CSV for bulk import into other systems
  • Preparing JSON data for analysis in Excel or Google Sheets
  • Generating CSV reports from JSON log or event data
  • Converting JSON configuration arrays to CSV for data validation workflows
  • Sharing structured data with colleagues who prefer spreadsheet tools

Pemecahan Masalah

Only the first object's keys appear as headers

Solusi

The tool derives column headers from the first object in the array. If different objects have different keys, only the first object's keys will become columns. Normalize your data so all objects have the same keys.

Nested objects appear as [object Object] in the CSV

Solusi

Nested objects are serialized as JSON strings. For cleaner output, flatten your JSON structure before converting, or post-process the nested fields after import.

CSV does not open correctly in Excel

Solusi

Ensure Excel is configured to use commas as the delimiter. In some regions, Excel defaults to semicolons. Open the CSV using the Data > Text Import Wizard to specify the comma delimiter explicitly.

Pertanyaan yang Sering Diajukan

What JSON structure is expected?

The tool expects a JSON array of objects, for example: [{"name":"Alice","age":30},{"name":"Bob","age":25}]. Each object becomes a row, and the keys of the first object become the CSV headers.

Are nested objects supported?

Nested objects and arrays are serialized as JSON strings (using JSON.stringify) in the CSV cell. For fully flat output, flatten your JSON structure before converting.

What if some objects are missing certain keys?

If an object is missing a key that exists in other objects, the corresponding CSV cell will be empty. The tool uses the first object's keys as the definitive set of columns.

Can I import the CSV into Excel?

Yes. The output is RFC 4180-compliant CSV which Excel can open directly. If Excel misinterprets the delimiter, use Data > From Text/CSV to specify the comma as the delimiter manually.

How does the tool handle commas inside values?

Values containing commas, double quotes, or newlines are automatically wrapped in double quotes per the CSV standard. Inner double quotes are escaped by doubling them.

Is there a size limit for the JSON input?

There is no server-imposed size limit. The practical limit depends on your browser's available memory. Arrays with thousands of objects typically convert in under a second.

Is my data sent to a server?

No. All processing is done entirely in your browser using JavaScript. Your JSON data never leaves your device and is not stored or logged anywhere.

What happens if my JSON is invalid?

The tool will display an error message if the JSON cannot be parsed. Validate your JSON using the JSON Validator tool first to identify and fix any syntax issues.