CSV ⇄ JSON

Paste either format — the other one appears as you type, both directions.

How to use it

  1. Paste CSV (or TSV / semicolon-separated text) or a JSON array into the box — the result is drawn as you type, there is no button to press. The direction is detected from the first character and shown above the result, so you can check it.
  2. If the direction was guessed wrong, pick CSV → JSON or JSON → CSV. If everything lands in one column, drop the delimiter from “Auto” to your character. Switch off “First row is header” when the file starts with data — you then get an array of arrays instead of objects.
  3. Copy or download the result. Both use the exact text you see on screen; the file is named data.json or data.csv. Load sample fills in an example for whichever direction is active.

Example

Input (CSV)

order_id,customer,note,zip,amount,shipped
1001,"Popescu, Ana",asked for a refund,00501,89.90,true
1002,Ben Carter,,10001,42.00,false

Output (JSON)

[
  {
    "order_id": 1001,
    "customer": "Popescu, Ana",
    "note": "asked for a refund",
    "zip": "00501",
    "amount": 89.9,
    "shipped": true
  },
  {
    "order_id": 1002,
    "customer": "Ben Carter",
    "note": "",
    "zip": 10001,
    "amount": 42,
    "shipped": false
  }
]

Four things to check in that output: the comma inside “Popescu, Ana” stayed inside the value instead of splitting the row; the zip 00501 kept its leading zero because it would otherwise become 501; 10001 did become a number, so the zip column ends up with mixed types — switch “Detect numbers & booleans” off to keep every value a string; and 89.90 came out as 89.9, because a JSON number cannot carry a trailing zero.

Rules, limits and known issues

  • No file upload, drag-and-drop or URL fetching: paste the text in. A drop zone would eat the height the result needs, and reading files properly means handling non-UTF-8 encodings — the CSV viewer already does that (GB18030, Big5, Windows-1256), so open the file there and copy the text.
  • Input is capped at 1,000,000 characters; beyond 200,000 the result waits until you pause typing and says so. Above the hard cap you get an explicit error — the input is never truncated silently.
  • Type detection is per cell and conservative: only true / false / null (lower case only) and strict JSON numbers are converted. Integers with a leading zero (00501) and numbers of 16 digits or more (long IDs) always stay strings, and empty cells stay "" rather than becoming null.
  • A JSON number cannot keep trailing zeros, so 89.90 becomes 89.9 and 42.00 becomes 42. Switch “Detect numbers & booleans” off to keep every value exactly as written.
  • The column count is the widest row, so no field is ever dropped: short rows are padded with empty strings and extra fields get an auto-generated name. Rows that do not match the first row are listed by number.
  • Duplicate column names are renamed with _2, _3 … instead of overwriting each other — overwriting would silently lose a whole column. Missing or empty header cells become column_N. Those names are machine-readable and are the same in every interface language.
  • JSON → CSV accepts an array of objects (the main case), an array of arrays (positional columns), a single object and an array of plain values (one “value” column). Anything else — a top-level value, or an array mixing objects with other values — is refused with the line and column, never guessed at.
  • Nested objects are flattened into dotted keys (address.city) by default; arrays are never flattened, they are written as compact JSON inside the cell. Switch flattening off to keep nested objects as JSON too. A null becomes an empty cell.
  • JSON is parsed strictly: no comments, no trailing commas, no single quotes, no unescaped control characters, nesting up to 64 levels. One object per line (JSON Lines) is not accepted — wrap the objects in an array first.
  • CSV is the forgiving side: an unclosed quote is folded to the end of the text and its row is named, blank lines are skipped and counted, and a row with the wrong field count is listed. Only the JSON side produces hard errors.
  • The output CSV is written with CRLF line endings and no byte-order mark, and it is identical to what you copy. If Excel shows mojibake when you double-click a non-Latin CSV, import it via Data → From Text/CSV and pick UTF-8.
  • Out of scope: .xlsx, archives, multiple files, JSON Lines, YAML/XML/SQL/Excel export, sorting, filtering, picking columns and de-duplication — the CSV viewer and the config converter cover those. Nothing is uploaded, stored or put into the URL.

What people usually need next, once the data is in the other format.