Convert CSV to JSON
This free converter turns a CSV file into JSON with one object per row, using the header row as keys and typing numbers, true and false while postcodes and other leading-zero values stay text. Your browser does the conversion, so the CSV is not uploaded. Dates stay text because JSON has no date type, and the output is one JSON document, not JSON Lines.
Did a file not convert correctly? E-mail [email protected], ideally with a small sample file, and it will be fixed.
Key facts
- Input: CSV (.csv). Output: JSON (.json).
- Your files are not uploaded: the work is done in your browser, on your own device.
- File size: no fixed limit; very large files are limited by your device's memory.
- Needs a current browser (Chrome, Edge, Firefox or Safari) on a computer, tablet or phone; nothing to install.
- Free to use, with no sign-up.
Why convert CSV to JSON
Web apps, APIs, test fixtures, static site generators and NoSQL databases expect JSON, while the data often starts life in a spreadsheet saved as CSV. This converter turns each row into a JSON object, with the header row as the keys. It detects the separator and the encoding, including semicolon files with decimal commas from Excel in Europe, and shows the first rows so you can check the columns. Numbers become JSON numbers, true and false become booleans and empty cells become null, while values with leading zeros, such as postcodes, stay text. If you would rather decide types yourself, keep everything as text. Columns named with dots, such as address.city, can become nested objects, and you can choose a list of rows instead of objects when the result should be as small as possible. The output is UTF-8 JSON, indented so that it is easy to read.
How to convert CSV to JSON
- Drop your CSV file in the box, or click to choose it.
- Check the columns in the preview and choose how values and the layout should look.
- Click Convert to JSON and download the .json file.
What changes when you convert
The first row is the header
The first row gives the names of the keys. Empty names become column_1, column_2 and so on, and a repeated name gets _2 added, so no value is overwritten. Delete title rows above the header in the spreadsheet first.
Numbers that are not numbers
Postcodes such as 0150, codes such as 007 and numbers with more than 15 digits stay text, because turning them into JSON numbers would drop zeros or digits. Numbers with a thousands separator, such as 1,250.00 or 1.250,00, stay text as well.
Dates stay text
JSON has no date type, so dates are written exactly as they are in the CSV, for example "2024-05-01". If your program needs a particular format, convert the dates in the spreadsheet before you save the CSV.
Nested keys
With the nested option, the columns address.city and address.zip become one address object. If a column called address exists as well, the dotted columns stay flat, so no value is lost.
About the formats
CSV
CSV (comma-separated values) is a plain-text table: one line per row, with the cells separated by a comma, a semicolon or a tab. Excel, Google Sheets, Numbers, every database and most programming languages read and write it, which makes it the usual way to move a table from one program to another.
- There is no standard for the separator: Excel uses a comma or a semicolon depending on the language settings.
- Every value is text; whether 0800 is a number or a postcode is up to the program reading it.
- There are no sheets, formulas, colours or column widths, only the values.
- The encoding is not stored in the file; UTF-8 is the safe choice, and Excel needs a BOM to recognise it.
JSON
JSON (JavaScript Object Notation) is the text format most web APIs, apps and configuration files use for data. Values can be nested: a record can hold another record or a list, which a flat table cannot.
- Objects hold named values, lists hold values in order; both can be nested to any depth.
- Values are text, numbers, true/false or null, so a postcode written as "0150" stays text.
- JSON Lines (.jsonl, .ndjson) puts one JSON object on each line, common in logs and data exports.
- Text is always Unicode, normally UTF-8.
Frequently asked questions
Is my CSV file uploaded?
No. Your browser reads the file and writes the JSON on your own device; nothing is sent to a server.
Which separators work?
Comma, semicolon, tab and pipe are detected automatically, as is the "sep=" line Excel sometimes adds. If the preview shows all values in one column, choose the separator yourself.
Can I get JSON Lines instead?
Not directly. The tool writes one JSON document. Most programs that read JSON Lines also read a JSON list, and a JSON list is what most APIs and tools expect.
What about very large files?
Files up to 200 MB work. The JSON is usually two to three times larger than the CSV, because every value carries its key, so the layout as a list of rows gives a smaller file.