CSV to JSON Converter
About this tool
About CSV to JSON
Turn a spreadsheet export into JSON you can drop straight into an API request, a test fixture or a config file. Paste CSV or open a .csv or .tsv file and the converter detects the delimiter (comma, semicolon, tab or pipe) and reads quoted cells with commas and line breaks correctly. Choose the shape you need: an array of objects using the header row as keys, an array of arrays, or one object keyed by a column such as id or code. Type detection turns 42 into a number and true into a boolean, while columns with leading zeros, like zip codes or account numbers, stay text in every row, and integers too long for JavaScript keep all their digits. Headers written as address.city become nested objects, and tags.0, tags.1 become arrays. Empty cells can be null, an empty string or left out, and you can switch to JSON Lines for streaming and log tools. It all runs locally, so customer exports never leave your device.
Built and maintained by Abhi JainUpdated
How to Convert CSV to JSON
- 1
Paste or open the CSV
Paste CSV into the left pane, drop a .csv file on it, or click Sample to try it.
- 2
Pick the output
Choose Objects, Arrays or Keyed by, and set the key column if you key by a column.
- 3
Set the options
Leave Detect numbers & booleans on for typed values, turn on Nest a.b headers for nested objects, and choose how empty cells are written.
- 4
Copy or download
Copy the JSON or click Download to save data.json (or data.jsonl for JSON Lines).
CSV to JSON: questions and answers
How do I convert a CSV file to JSON?
Open the file or paste its contents above. The first row becomes the keys and each following row becomes one object in a JSON array. Download the result as a .json file.
Why are some numbers kept in quotes?
Values with leading zeros, such as 02139 or 007, would lose their zeros as numbers, so the whole column stays text. Integers longer than 15 to 16 digits also stay text because JavaScript numbers cannot store them exactly.
Can I create nested JSON from a CSV?
Yes. Name the columns with dots, for example address.city and address.zip, and turn on Nest a.b headers. Numbered parts such as tags.0 and tags.1 become an array.
What is JSON Lines?
JSON Lines (also called NDJSON) puts one JSON object on each line with no surrounding array. Tools like BigQuery, Elasticsearch and many log pipelines import it directly.
My CSV uses semicolons. Will it work?
Yes. The delimiter is detected automatically, which covers the semicolon files that Excel writes in many European locales. You can also set it by hand.
Related Tools
- JSON to CSVConvert a JSON array to CSV, flattening nested objects and choosing the columns you want.
- CSV Viewer & EditorOpen, edit, sort, filter and search big CSV files like a spreadsheet, then export CSV, TSV or JSON.
- JSON FormatterBeautify, minify and validate JSON with exact error locations, without changing a single value.
- CSV to SQLTurn a CSV file into CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.
- JSON Schema GeneratorGenerate a draft 2020-12 JSON Schema from one or more JSON samples.