CSV → JSON
Runs in your browserQuoted fields, embedded commas, and newlines inside cells all handled.
CSV
JSON
What happens to nested data
CSV is flat and JSON isn't, so something has to give. Nested objects become dotted column names — address.city — and arrays become indexed ones, tags.0 and tags.1. Rows that don't share every key get null in the columns they're missing, the same as an explicit null, so they convert back to null too. Going the other way, anything that looks like a number or a boolean is converted, but only when the text survives the round trip — so a zip code of 007 or an ID longer than a double can hold stays a string instead of quietly changing.
Questions
- My spreadsheet opens it as one long column.
- That's usually a delimiter mismatch — Excel in a lot of European locales expects semicolons, not commas. Switch the delimiter above and re-copy, or use Data → From Text/CSV and pick the separator there.
- Why did my leading zeros survive here but not in Excel?
- Because this only converts a cell when the text round-trips exactly, so 007 stays the string "007". Excel is far more eager and will happily turn it into 7 on import — that's a spreadsheet behaviour, not something the CSV itself is doing.
- Can it handle commas and line breaks inside a value?
- Yes, in both directions. Values containing a delimiter, a quote, or a newline get wrapped in quotes with any inner quotes doubled, per RFC 4180 — and the parser understands the same rules coming back, including newlines inside a quoted cell.