Runs in your browser. Your files and text never leave your device - nothing is uploaded.
Convert CSV to JSON Online
The Tools Kit's free CSV to JSON converter turns comma-separated text into a JSON array of objects. The first row of your CSV supplies the keys, and every row after it becomes one object with those keys. Paste the data or upload a .csv file, click Convert to JSON, and copy the pretty-printed result into your code, a config file, or an API request.
The conversion runs entirely in your browser. Your CSV file is read locally and is never uploaded, so it is safe to use for customer lists, internal exports, or anything else you would rather not send to a third-party server.
How to Convert a CSV File to JSON
- 1
Add your CSV
Paste comma-separated text into the CSV Input box, or drop a .csv or .txt file onto the upload area above it. Keep the column names on the first line, because that row becomes the JSON keys.
- 2
Convert to JSON
Click Convert to JSON. An uploaded file converts automatically as soon as it loads. Each data row becomes one object keyed by the header names.
- 3
Check the output
Read the JSON Output panel, which shows a pretty-printed array of objects with 2-space indentation. Every value is a string, exactly as it appeared in the CSV.
- 4
Copy or clear
Use Copy JSON to put the result on your clipboard, or Clear to empty the input and output and start over with another CSV.
CSV to JSON Example: How Rows Become Objects
Here is the three-line CSV shown as the placeholder in the input box, and the exact JSON the tool produces from it:
name,age,city
Alice,30,NYC
Bob,25,LA[
{
"name": "Alice",
"age": "30",
"city": "NYC"
},
{
"name": "Bob",
"age": "25",
"city": "LA"
}
]Three things are worth noticing. The header line name,age,city does not become an object itself; it only names the fields. Each of the two data rows becomes one object, in the same order as the CSV. And the ages come out as "30" and "25", in quotes: CSV has no data types, so the converter keeps every value as a string rather than guessing which ones are numbers, dates, or booleans.
The output is a flat array of objects, which is the shape most JavaScript, Python, and API code expects from tabular data. If you want to re-indent or validate it afterwards, paste it into the JSON formatter; to go the other way and turn a JSON array back into a spreadsheet-ready file, use the JSON to CSV converter.
What the Converter Handles, and What It Does Not
This is a deliberately simple CSV parser that splits each line on commas. That covers the everyday exports most people convert, but it helps to know the exact rules before you paste a large file.
- Whitespace and quotes are cleaned. Each key and value is trimmed, and a double quote at the start or end of a field is removed, so
"NYC"becomesNYC. - Windows line endings work. The carriage return at the end of each CRLF line is trimmed away, so CSV saved on Windows converts cleanly.
- Short rows are padded. If a row has fewer values than the header, the missing keys are set to an empty string.
- Extra values are dropped. Values beyond the last header column are not included in the object.
- Commas inside quotes are not supported. A field such as
"Smith, John"is split at the comma and the rest of the row shifts one column to the right. - Commas only. Semicolon and tab-delimited files are read as one long column, and line breaks inside a quoted field start a new row.
- Unique column names. If two header cells share a name, the later column overwrites the earlier one in each object.
- No empty lines in the middle. A blank line between rows becomes an object whose values are all empty strings; leading and trailing blank lines are ignored.
If your export contains repeated rows, run it through remove duplicate lines first. To check what changed between two versions of an export before converting, compare them side by side with the text compare tool.
CSV vs JSON: Which Format Should You Use?
CSV is a flat, row-and-column format that every spreadsheet can open and that stays compact for large tables. It has no data types and no nesting, and quoting rules vary between programs. JSON is the native data format of the web: it labels every value with a key, supports nested objects and arrays, and can be loaded directly by JavaScript with JSON.parse and by almost every other language with a standard library.
A common workflow is to keep data in a spreadsheet, export it as CSV, and convert CSV to JSON when a web app, API, or test fixture needs it. If your data starts life in another structured format, the XML to JSON converter and the YAML to JSON converter produce the same kind of JSON from those sources, and the full set of format tools is on the conversion tools hub.
Common uses
- Turning a spreadsheet export into a JSON array to seed a database or a mock API
- Building test fixtures or sample data for a JavaScript or Python project
- Converting a product, price, or contact list into JSON for a static site or config file
- Inspecting how a CSV's columns map to key-value pairs before writing an import script
- Drafting a JSON payload by laying the fields out as CSV first, then converting it
If the goal is a readable table for a README or documentation rather than JSON, the Markdown table generator turns the same comma-separated rows into a Markdown table instead.
CSV and JSON terms explained
| Term | What it means here |
|---|---|
| CSV | Comma-separated values: plain text where each line is a record and commas separate the fields |
| Header row | The first line of the CSV; its field names become the keys of every JSON object |
| Delimiter | The character that separates fields. This tool splits on commas only |
| JSON array | An ordered list in square brackets; here it holds one object per CSV data row |
| JSON object | A set of "key": value pairs in curly braces; here, one row of your CSV |
| Pretty-printing | Formatting JSON with line breaks and indentation (2 spaces here) so it is easy to read |
| String value | Text in double quotes. Every value this tool outputs is a string, including numbers |
Frequently Asked Questions
Paste your CSV into the CSV Input box, or upload a .csv or .txt file, and click Convert to JSON. The first row is used as the keys and every following row becomes one object in a JSON array, which you can copy with the Copy JSON button.
Yes. It is free with no signup, and the conversion runs entirely in your browser with JavaScript. Pasted text and uploaded files are read locally and are never sent to a server.
The first line of your CSV is the header row. Its comma-separated names, trimmed of spaces and surrounding double quotes, become the keys used for every object in the output.
Yes. Click or drag and drop a .csv or .txt file onto the upload area. Its contents load into the CSV Input box and convert to JSON automatically. One file is processed at a time.
No. Every value is kept as a JSON string, so 30 becomes "30" and true becomes "true". If your code needs real numbers or booleans, convert those fields after parsing the JSON.
No. The parser splits each line on every comma, so a value such as "Smith, John" is broken into two columns and the rest of that row shifts. Remove or replace commas inside values before converting.
No. The only delimiter is a comma. A semicolon or tab-separated file will be read as a single column, so change the delimiter to commas first, for example by re-exporting the spreadsheet as CSV.
Missing values are filled with an empty string, so every object keeps the full set of keys. Extra values beyond the last header column are dropped.
Yes, as long as the export uses commas and no cell contains a comma or a line break. Windows line endings are handled, because each key and value is trimmed of whitespace including the carriage return.
A JSON array of flat objects, one per data row, pretty-printed with 2-space indentation. A CSV with only a header row produces an empty array, [].
Reviewed by Raja Jahangir · Last reviewed: October 7, 2026
How do you convert CSV to JSON?
To convert CSV to JSON, paste or upload the CSV and it becomes an array of objects, with the first row used as keys for every following row. Values stay strings, conversion runs in your browser, and quoted fields containing commas are not supported because the parser splits on plain commas.
