CSV to JSON
Convert CSV data to JSON.
About the CSV to JSON
Converts CSV into a JSON array of objects, using the header row for keys and the Indent selector for output spacing. The delimiter is detected, so comma, semicolon, and tab-separated files all work, and quoted fields containing commas or newlines are parsed rather than split naively. Spreadsheet exports usually hold customer or financial data, and this one is parsed in your browser rather than uploaded.
How to use the CSV to JSON
- Paste your CSV, header row included, or press Sample to load an example.
- Pick 2 spaces or 4 spaces from the Indent selector.
- Press Convert to produce the JSON array.
- Check any column of identifiers, because a field that looks numeric is converted to a number.
- Press Copy, or Download to save converted.json.
Frequently asked questions
- What does the converted JSON look like?
- One object per row, keyed by the header. The sample row 1,Ada,ada@4devs.app,true becomes { "id": 1, "name": "Ada", "email": "ada@4devs.app", "active": true }. Numeric and boolean fields become real JSON numbers and booleans, an empty cell becomes null, and everything else stays a string.
- Why did the leading zeros disappear from my IDs?
- Because a field that looks numeric is converted to a JSON number. A zip code of 07030 becomes 7030, 0015551234 becomes 15551234, and 1e3 becomes 1000. Quoting the field in the CSV does not prevent it, so repair those columns after converting when the original digits matter.
- What happens when two columns share a name?
- The duplicate is renamed rather than overwritten. A header of a,a yields the keys a and a_1, so no column is silently lost, though the renamed one will not match what your schema expects.
- Why do I get "Too few fields" or "Too many fields"?
- Every row must carry exactly as many fields as the header. A short row reports "Too few fields: expected 3 fields but parsed 2", a long one reports "Too many fields", and nothing is converted. Blank lines are skipped, so the usual cause is an unescaped comma inside a value that was never quoted.
- Can it produce nested JSON?
- No. The output is always a flat array of objects, one key per column. A header written as user.name is taken literally and gives the key "user.name" rather than a nested user object, so reshape the result afterwards if you need depth.