SS Toolbox
SS Toolbox
All data is processed locally

CSV to JSON Converter for Excel, Header Rows & Nested Fields

Turn spreadsheet CSV exports into JSON arrays and write JSON back to CSV in your browser. The first row becomes object keys, nested objects flatten to dotted headers, and arrays are stored as JSON text inside a single cell.

How this CSV ↔ JSON converter behaves

  1. The first row is always the header

    CSV → JSON uses row 1 as field names and emits one object per remaining row. A file without a header row loses its first data line; a header-only file returns an empty array.

  2. Nested JSON flattens to dotted columns

    JSON → CSV writes meta.x / meta.y for nested objects, and converting that CSV back rebuilds the nested object. Simple structures round-trip cleanly.

  3. Arrays stay inside one cell as JSON

    Lists and arrays of objects are serialized as strings such as [1,2,3], keeping the table rectangular. CSV → JSON parses a cell that looks like JSON back into an array or object.

  4. Numbers are guessed, not preserved

    Numeric cells become numbers (1.50 → 1.5, 1e5 → 100000). Leading-zero values like 007 stay strings, but IDs beyond 2^53 lose precision and +4 is not treated as a number.

  5. Runs in the page, files stay local

    Pick a .csv or .json file or paste text; download the result. Nothing is uploaded, but conversion runs synchronously, so very large files can freeze the tab.

CSV ↔ JSON conversion FAQ

Does the CSV need a header row?

Yes. The first non-empty line is treated as the header and every row after it becomes one JSON object. If your file has no header, the first data row is consumed as column names. A header-only file returns an empty array.

How do I keep phone numbers, postcodes or order IDs as text?

Leading zeros such as 007 are kept as strings automatically, but 1.0 becomes 1, 1e5 becomes 100000, and integers longer than 2^53 lose digits. There is no treat-all-columns-as-text switch, so quote or pre-format such values in the source file.

How are nested objects and arrays represented?

JSON → CSV flattens objects into dotted headers (user.name) and stores arrays as JSON text in one cell. CSV → JSON splits dotted headers back into objects and parses JSON-looking cells. A key that really contains a dot is written as a\.b so it is not split.

What happens with empty values, quotes, line breaks and delimiters?

Empty cells become empty strings. Commas, quotes and newlines are quoted on export and parsed back correctly. An empty line produces a partial object with only the first column filled, and cells beyond the header count are dropped or shifted. Only comma-separated input is supported; semicolon or tab files become one column.

My Excel CSV has \r\n endings and a BOM — why does it break?

The parser splits on LF only: with CRLF files the last header name can keep a \r, and a quoted field containing CRLF may swallow the rest of the file. A UTF-8 BOM is also glued to the first header key. Re-save as UTF-8 without BOM and LF before converting.

Can I choose a different delimiter?

No. There is no delimiter, quote or encoding option, and only comma-separated text is parsed. Semicolon- and tab-separated files are read as a single column whose key is the whole line. Convert to comma CSV first if needed.

Is CSV → JSON → CSV a lossless round trip?

Not guaranteed. Field order is preserved, but type guessing, dotted-key flattening, JSON-encoded arrays and literal output for missing keys can change data: null is written as null and a missing key as the text undefined. Date-like values stay plain strings — the JSON editor cannot produce Date objects, so no date formatting is applied. Make objects uniform before exporting.

Related Tools
SponsorMindElixir