CSV to JSON
Convert CSV to JSON array.
Loading…
About CSV to JSON
A spreadsheet export is fine for people and awkward for code. Paste the CSV with its header row on top and you get an array of objects, one per line, with the headers as keys and two-space indentation. Fields in double quotes may contain commas, doubled quotes and line breaks. Every value is kept as text, so ZIP codes and IDs that start with zeros survive. All of it happens in your browser.
Features
- First row becomes the keys and each later row an object
- Quoted fields may contain commas, doubled quotes and line breaks
- Duplicate column names get _1, _2 suffixes instead of overwriting each other
- Missing cells become empty strings
- Reads a byte order mark, Windows line endings and blank lines
- Values stay as text, so zeros at the start of an ID are kept
Limitations
- Only commas separate fields; text that uses semicolons or tabs ends up in a single column.
- Every value is a string: 30 becomes "30", true becomes "true" and an empty cell becomes an empty string.
- Cells beyond the number of headers are dropped, and at least a header row plus one data row is required.
- Download saves the text as output.txt and needs a free account; Copy Output does not.
How it works
- Paste CSV with a header row into the CSV Input panel.
- Select Convert to JSON.
- Read the array of objects in the JSON Output panel.
- Use Copy Output to copy it, or Download to save it.
- Press Clear All to load another file.
Example input
name,role
Auro,admin
Nova,editorFrequently asked questions
- CSV has no types, and the tool does not guess them. That keeps values like 00123 or 1E5 exactly as written. If you need real numbers or booleans, convert those fields in your own code after loading the JSON.
- Not as is. Only commas split fields, so a semicolon file comes out as one long key. Replace the separators with commas first, taking care with any field that contains the old separator inside quotes.
- The second and later copies get a numeric suffix. A header of a,a,a produces the keys a, a_1 and a_2, so no column is lost.
- A field wrapped in double quotes may contain commas and line breaks, and a doubled quote inside it becomes a single quote in the JSON string. A quote that is opened and never closed produces an error message.
- A short row is padded with empty strings for the missing keys. Extra cells beyond the header count are ignored, so check the source if a row looks longer than the others.
