CSV to JSON Converter
Auto-detect headers, convert rows to JSON objects with type inference
Turn spreadsheet rows into JSON objects
CSV is what spreadsheets and database exports give you; JSON is what APIs, front-end code and NoSQL databases expect. This converter takes CSV text you paste into the box, uses the first row as field names, and produces a JSON structure you can copy or save. The conversion runs in your browser through JavaScript on the page.
Converting your data, step by step
- Paste your CSV into the CSV Input box. The Paste button reads from your clipboard, and Sample loads a small example with id, name, email, age, premium and score columns.
- Pick the Delimiter: comma, semicolon, tab or pipe.
- Choose the Output shape. Array of Objects gives a list of records; Keyed Object gives one object whose keys are the row positions 0, 1, 2 and so on.
- Leave First row = Headers ticked if the top line holds column names, and decide whether Infer Types should stay on.
- Set the Indent to 2 spaces, 4 spaces or Minified, then press Convert to JSON.
A summary bar shows the row count, column count and output size in bytes. Use Copy or the JSON download button, which saves a file named output.json.
How type inference behaves
With Infer Types on, the words true and false become booleans, numeric text becomes a number, and empty cells or the word null become null. Everything else stays a string. Turn it off when every value must remain text, for example postcodes, phone numbers or product codes with leading zeros, since a value such as 007 would otherwise turn into 7.
When there is no header row
Untick First row = Headers and the tool names the fields col1, col2, col3 and so on, and treats every line as data.
Where this helps
- Preparing seed data for a database or a mock API from a spreadsheet export.
- Feeding a chart library or a front-end prototype that only accepts JSON arrays.
- Turning a semicolon-separated export from a European version of Excel into something a script can parse.
- Checking how a CSV file will look as structured data before you write an import script.
Limitations worth knowing
Quoted fields containing the delimiter or escaped double quotes are handled, but the parser reads the input line by line, so a quoted cell that spans several lines will be split apart. Empty lines are skipped. If the header row contains duplicate names, later columns overwrite earlier ones in each object. Rows with fewer cells than headers get null values for the missing fields when inference is on, and extra cells beyond the header count are ignored. Whitespace around each value is trimmed.
Related Tools