Skip to content
cosmodev ~/tools/json-csv

JSON ↔ CSV Dönüştürücü

Converters & Formatters

Nesne dizisi JSON'ı CSV'ye ve geri dönüştürün. Tırnaklı alanları, gömülü virgülleri, satır sonlarını ve kaçışlı tırnakları (RFC 4180) ele alır. %100 tarayıcıda.

CSV
CSV'ye dönüştürülmüş halini görmek için JSON yapıştırın.

(Dokümantasyon İngilizcedir)

What it does

Converts between JSON and CSV in both directions. JSON → CSV takes an array of objects (or a single object) and produces a table: the union of all keys becomes the header row, and one row follows per object. CSV → JSON parses RFC 4180 quoting and rebuilds an array of objects. A Swap button flips the direction and carries the output across as the new input, so a document round-trips without copy and paste. A stat line under the grid counts rows or items and the output size in bytes.

How to use it

  1. Pick a direction with the segmented control: JSON → CSV or CSV → JSON. Swap does the same and moves the current output into the input.
  2. Paste your document into the left pane.
  3. The converted result appears live on the right. Copy takes it.
  4. Read the stat line: N rows · M bytes for JSON → CSV, N items · M bytes for CSV → JSON.

Examples

[{"name":"ada","role":"admin"},{"name":"bob","role":"user"}]

becomes:

name,role
ada,admin
bob,user

Stat line: 2 rows · 28 bytes.

A field containing a comma, a quote, or a newline is quoted per RFC 4180: [{"price":"1,000"}] becomes price on the header line and "1,000" on the data line. CSV → JSON reverses the quoting exactly.

How the table model works

Both formats express the same shape: a table of rows with named columns. JSON spells it an array of objects; CSV spells it a header line plus one line per record:

Concept JSON CSV
table array of objects the whole file
column object key header entry
row one object one line
cell value field

JSON → CSV walks the input once and collects every key it meets, in order of first appearance, as the header. An object missing a key gets an empty cell.

That is where the formats stop being equivalent, because CSV cells are plain text:

  • A nested object or array becomes its string form ([object Object], 1,2) and does not come back.
  • Numbers and booleans become text: the value 1 round-trips as the string "1".
  • An empty CSV cell reads back as "".

So JSON → CSV → JSON is lossy whenever values are more than plain strings or numbers. Use the pair for tabular data, and keep nested documents in JSON.

Good to know

  • Deterministic: column order follows first appearance of each key; output uses \n line breaks with no trailing newline.
  • Round-trip check: convert one way, hit Swap, convert back, and diff the two documents to see exactly what a spreadsheet would keep.
  • Private: all conversion runs locally in your browser.
  • Related tools: JSON Formatter, JSON Validator, JSON Minify.
Kaynak kodu14 dil

%100 istemci tarafında · verileriniz asla tarayıcınızdan çıkmaz. İşinize yaradı mı? Bir meslektaşınızla paylaşın.