Paste CSV or TSV and get a clean JSON array as you type.
Paste CSV, upload a .csv or .tsv file or drop one here.
Updates as you type. Copy it or download a .json file.
Converting…
This free CSV to JSON converter turns comma-separated values into a formatted JSON array. Paste an export from a database or spreadsheet, or drop in a .csv or .tsv file, and the JSON appears as you type. Each row becomes an object keyed by your column names, ready to use in an API request, a test fixture or a JavaScript app. Nothing is uploaded: the conversion runs in your browser.
CSV is the format every spreadsheet and database can export, but code usually wants JSON. The conversion looks simple until real files get involved: quoted commas, multi-line cells, semicolon delimiters from European locales, ZIP codes that start with zero, and IDs too long for a JavaScript number. This converter handles those cases deliberately, and the sections below explain exactly how.
.csv, .tsv or .txt file. You can also drag a file onto the editor.data.json.The header row supplies the keys. Numbers and booleans become real JSON values, the quoted cell keeps its comma, and the ZIP code with a leading zero stays a string.
id,name,price,in_stock,zip 1,Desk lamp,24.90,true,02134 2,"Standing desk, oak",399,false,10001
[
{
"id": 1,
"name": "Desk lamp",
"price": 24.9,
"in_stock": true,
"zip": "02134"
},
{
"id": 2,
"name": "Standing desk, oak",
"price": 399,
"in_stock": false,
"zip": 10001
}
]Notice that 10001 became a number while 02134 did not. Conversion is decided cell by cell, so a column that mixes both will come out mixed. If a column is an identifier rather than a quantity, untick Convert numbers and booleans and all values stay strings.
| CSV cell | JSON output | Notes |
|---|---|---|
Ada | "Ada" | Text is always a string. |
42, -7, 3.14 | 42, -7, 3.14 | Plain decimal numbers become numbers when the option is on. |
true, FALSE | true, false | Case-insensitive. Other words such as yes or no stay strings. |
02134 | "02134" | Leading zeros stay, so ZIP codes and phone numbers survive. |
(empty cell) | "" | Empty cells become empty strings, never null. |
"a, b" | "a, b" | A doubled quote ("") inside a quoted cell becomes one quote. |
JavaScript stores numbers as 64-bit floats, so integers above 9,007,199,254,740,991 (253 minus 1) silently lose their last digits when parsed. A 16-digit order ID such as 9007199254740993 would come back as 9007199254740992. The converter checks each integer and keeps it as a string when it is not safe, and it also keeps decimals with more than 15 significant digits as strings. Forms such as +1, 1e5, .5 and 1,000 are left as text too, because they are not plain JSON numbers.
The delimiter is detected from the first rows: comma, tab, semicolon or pipe. Fields in double quotes can contain the delimiter, doubled quotes and line breaks. Blank lines and rows with only empty cells are skipped, and a byte order mark at the start of the file, which Excel adds when it saves "CSV UTF-8", is removed. If a quote is opened and never closed, or a closing quote is followed by more text, the converter stops and reports the row instead of guessing.
Every key in a JSON object must be unique, so the converter makes header names unique in a predictable way. Repeated names are numbered in order: tag,tag,tag becomes tag, tag_2 and tag_3. An empty header becomes column_ plus its position, so the second column is column_2. Whitespace around header names is trimmed. A row with fewer cells than the header gets empty strings for the missing ones, and a row with extra cells gets column_N keys, so no data is dropped.
CSV is flat, but JSON often is not. Tick Nest dot-notation columns and a header like address.city is written as a nested object. This matches how the JSON to CSV converter names flattened columns, so nested data can make a round trip.
name,address.city,address.zip Ada,Boston,02134
[
{
"name": "Ada",
"address": {
"city": "Boston",
"zip": "02134"
}
}
]If one column name is the parent of another, such as a and a.b, nesting would overwrite a value, so both columns keep their literal names. The same applies to names with an empty part, such as .a or a..b.
CSV has no data types: every cell is text until something decides otherwise. This converter only promotes plain numbers and true or false. Dates such as 2025-03-14 or 3/14/2025, currencies such as $1,200 and percentages are left exactly as written, because guessing a date format wrongly is worse than leaving a string for your code to parse.
If the file has no column names, untick First row is header. The output is then an array of arrays, one per row, in the same order as the file. Number and boolean conversion still applies, but there are no keys, so nesting does not.
In Excel, use Save As and pick CSV UTF-8 (Comma delimited). In Google Sheets, use File, Download, then Comma-separated values. Uploaded files are read as UTF-8, so these exports keep accents and symbols intact, while older "CSV (Comma delimited)" files saved in a Windows code page can show garbled characters. Excel in some locales separates values with semicolons because the comma is its decimal mark; that works without changing anything.
CSV is compact and opens in every spreadsheet, which makes it good for flat tables that people edit. JSON carries types, nesting and arrays, which makes it the better fit for APIs, configuration and anything a program reads. Keep the CSV as the file people edit and convert it to JSON whenever code needs it; the conversion is instant and repeatable.
Working in Excel? Use the Excel to JSON converter to read an .xlsx file directly, or try the JSON to SQL converter to load the result into a database. To go the other way, use the JSON to CSV converter. Need test data first? Create it with the JSON Generator, describe the result with the JSON Schema generator, or read how to seed test databases in CI/CD.
Paste your CSV into the CSV Input editor, or upload or drop a .csv or .tsv file. The JSON appears in the output editor as you type. Click Copy, or Download to save it as data.json.
No. With First row is header ticked, each row becomes an object keyed by the column names. Untick it and every row becomes a plain array of values, which is the right choice for data that has no column names.
With Convert numbers and booleans on, a cell becomes a JSON number only if that changes nothing. Values with leading zeros such as 02134, and integers too large for JavaScript to store exactly, stay strings. Untick the option to keep every value as a string.
Yes. It detects commas, tabs, semicolons and pipes from the first rows of your data, so TSV files and European-style semicolon CSV exports work without any setting. Quoted fields can contain the delimiter and line breaks.
Tick Nest dot-notation columns. A header such as address.city then becomes {"address": {"city": ...}}. This is the same naming our JSON to CSV converter produces, so nested data survives a round trip.
Repeated names are numbered in order (tag, tag_2, tag_3) and empty names become column_2, column_3 and so on, using the column position. That way no column is lost and every key in the JSON is unique.
No. The conversion runs entirely in your browser with JavaScript, so your file never leaves your device. That makes it safe for exports that contain customer or internal data.