JSON1 / CSV to JSON
CSV to JSON
Convert CSV to a JSON array of objects. Quoted fields, escaped quotes, and embedded newlines are parsed correctly, and numbers and booleans are typed.
Converted output appears here as you type.
About this tool
Going the other way turns an export into an array of objects — the shape you want for feeding a CSV into an API, a database seeder, or a test fixture.
The first row becomes the keys. Parsing follows the actual CSV conventions rather than splitting on the delimiter: a quoted field may contain the delimiter, "" inside a quoted field is one escaped quote, and a field may span several lines. That last one is why splitting a CSV on newlines is a bug rather than a shortcut — a single address field with a line break in it silently becomes two broken records.
Values are typed rather than left as strings, which is convenient for most fields and wrong for a few. The few are worth checking.
- Why did my ID 007 become 7?
- Anything that looks numeric is typed as a number, and a number has no leading zeros. Identifiers, postcodes, phone numbers, and account codes are the fields where this loses real information — and quoting them in the CSV does not help, because quoting is about escaping, not type. Check them in the output before relying on it.
- My file is semicolon separated. Can I still use this?
- Yes — set the delimiter control above the editor to semicolon, tab, or pipe. Exports from spreadsheets in locales that use a comma as the decimal separator are usually semicolon separated, since a comma would be ambiguous.
- What happens to an empty cell?
- It becomes null, not an empty string. A blank in a CSV means "no value here" rather than "the empty string", and null is how JSON says the same thing.
- Do duplicate headers work?
- Not usefully — object keys are unique, so a repeated header means the last column wins and the earlier one is gone. Rename the columns before converting if both matter.
Related tools
- JSON to CSVFlatten a JSON array into CSV. Nested objects become dotted columns, sparse records still line up, and cells containing delimiters are quoted.
- JSON to TypeScriptGenerate TypeScript interfaces from a JSON sample. Fields missing from some records are marked optional, and values that are sometimes null widen to a null union.
- JSON to JavaGenerate Java classes with Jackson annotations from a JSON sample. Optional primitives are boxed, so an absent field stays distinct from zero or false.
Read the guide for the edge cases this converter cannot decide for you.