JSON → CSV

About the JSON ↔ CSV playground

The JSON ↔ CSV converter flattens an array of JSON objects into comma-separated rows and parses CSV back into JSON records. Object keys become the header row, and each object becomes a data row. This is ideal for moving API data into spreadsheets like Excel or Google Sheets, or for turning exported CSV reports into structured JSON your code can process directly.

JSON is a hierarchical format built from objects and arrays, while CSV (Comma-Separated Values) is a flat, tabular text format where each line is a record and fields are separated by a delimiter, typically a comma. CSV has no native support for nesting, so converting from JSON works best on a uniform array of flat objects; the converter quotes fields that contain commas, quotes, or newlines to keep the output well-formed.

HostedJSON ↔ CSV runtime
mainentry file
single fileworkspace
stdinprogram input

How it works

1

Write

The main file is the entry point for each run.

2

Give it input

Use the Input panel to pipe standard input to your program when it needs data.

3

Run

Run sends your code to a fresh hosted runtime and streams the result into the output panel.

4

Keep or share

Your draft stays in this browser, and Share creates a separate snapshot link.

External resources

  • RFC 4180— Format reference

Input (JSON)

[
  { "name": "Ada", "age": 36 },
  { "name": "Linus", "age": 54 }
]

Output (CSV)

name,age
Ada,36
Linus,54

Input (CSV)

id,city
1,"Paris, FR"
2,Berlin

Output (JSON)

[
  { "id": "1", "city": "Paris, FR" },
  { "id": "2", "city": "Berlin" }
]

Input (JSON with booleans)

[
  { "sku": "A1", "price": 9.99, "inStock": true },
  { "sku": "B2", "price": 4.5, "inStock": false }
]

Output (CSV)

sku,price,inStock
A1,9.99,true
B2,4.5,false

Input (CSV with escaped quote)

name,quote
Ada,"She said ""hi"""

Output (JSON)

[
  { "name": "Ada", "quote": "She said \"hi\"" }
]

Input (JSON)

[
  { "id": 1, "label": "line1\nline2" }
]

Output (CSV)

id,label
1,"line1
line2"

Input (JSON with null & empty)

[
  { "id": 1, "name": "Ada", "note": null },
  { "id": 2, "name": "Linus", "note": "vip" }
]

Output (CSV)

id,name,note
1,Ada,
2,Linus,vip

Input (CSV three columns)

sku,price,qty
A1,9.99,2
B2,4.50,5

Output (JSON)

[
  { "sku": "A1", "price": "9.99", "qty": "2" },
  { "sku": "B2", "price": "4.50", "qty": "5" }
]

How it works

The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.

Both directions

Paste an array of JSON objects to flatten it into comma-separated rows.

Paste CSV to parse it back into a JSON array of records.

Object keys form the header row; each object becomes one data row.

Field handling

Fields containing commas, quotes, or newlines are quoted to stay well-formed.

Works best on a uniform array of flat objects, since CSV has no nesting.

The header row becomes object keys when parsing CSV back to JSON.

When to use it

Moving API data into Excel or Google Sheets.

Turning exported CSV reports into structured JSON your code can process.

Privacy

Flattening and parsing happen in your browser — spreadsheet data never leaves it.

Safe for exports containing personal or business records.

Every shortcut, searchable:

Editing

Undo
Ctrl+Z
Redo
Ctrl+⇧+Z
Select next occurrence
Ctrl+D
Delete line
Ctrl+⇧+K
Move line up / down
Alt+↑ / ↓
Copy line up / down
Alt+⇧+↑ / ↓
Toggle comment
Ctrl+/
Indent line
Ctrl+]
Outdent line
Ctrl+[

Navigation

Find
Ctrl+F
Find & replace
Ctrl+H
Go to line
Ctrl+G
Go to symbol
Ctrl+⇧+O

Selection

Select all
Ctrl+A
Select line
Ctrl+L
Select all occurrences
Ctrl+⇧+L
Shortcuts follow your OS — ⌘ becomes Ctrl on Windows and Linux.
It converts an array of JSON objects into CSV rows and parses CSV text back into an array of JSON objects, using the header row as keys.
Yes. You can convert JSON to CSV or CSV to JSON. CSV values are read as strings, so numbers and booleans appear quoted when converting back to JSON.
No. The conversion runs entirely in your browser, so your data is never sent anywhere.
Yes, it is free with no limits or registration.
CSV uses a comma by default, but many tools accept a custom delimiter such as a semicolon or tab; choose the delimiter that matches the spreadsheet locale you are importing into.
json
plaintext

Output

CSV output

>_compilebytes

A fast place to write code and run it in isolated hosted runtimes. Free, forever.

Playgrounds

Python compilerC compilerJavaScript compilerC++ compilerTypeScript compilerGo compilerJava compilerRust compiler
All playgrounds →

Tools

JSON formatterRegex testerBase64 encoderJWT decoder
JSON formatterBase64 encoder & decoderRegex testerJWT decoder
All tools →

Company

TermsPrivacy[email protected]
© 2026 compilebytes115 runtimes · no signup115 runtimes · isolated sandboxes · no signup