CSV to JSON

Read a CSV into JSON records, including quoted fields holding separators or line breaks, with numbers and booleans converted or kept as text.

Separator
csv
JSONjson
The result appears here

Questions

Does it handle commas inside a field?+

Yes, and line breaks too. Quoted fields are read by the RFC 4180 rules, where a quote inside a quoted field is written twice rather than escaped with a backslash.

What does reading numbers and booleans do?+

It turns 42 into a number, true into a boolean and an empty cell into null. Turn it off when a column holds identifiers such as postcodes or product codes, where a leading zero matters and must stay a string.

What if my file has no header row?+

Turn the header switch off and each row comes out as an array instead of an object, in file order.

Excel splits my file into one column. Why?+

Because Excel picks its separator from your system locale: comma in the UK and the US, semicolon across much of Europe. That is the same reason a file that opens fine for you arrives unreadable for a colleague. The separator switch here reads whichever one the file actually uses.

Related tools

The tools are free. So is most of the library.

1935 blocks and 989 pieces for shadcn/ui and Tailwind, built on the same tokens these tools write. Install one with a command and the code is yours.

No signup for the tools. MIT for free blocks, commercial licence for Pro.

Markdown version