How to convert CSV to JSON
- Paste your CSV into the Input box, click Open file to pick a .csv, .tsv or .txt file, or drop the file onto the box. Load sample fills in an example.
- Leave Delimiter on Auto-detect, or choose comma, semicolon, tab or pipe yourself. The status line shows which delimiter was used.
- Set the parse options: First row is the header gives one object per row, and Detect numbers and true/false turns those cells into JSON numbers and booleans. Choose Pretty or Minified output.
- Click Copy to put the JSON on your clipboard, or Download .json to save it as a file.
Why use this tool
Spreadsheet data into an app
Export a sheet from Excel, Google Sheets or Numbers as CSV and get an array of objects you can use as seed data, a fixture in a test, or the body of an API request.
Excel exports from European locales
Excel in many European locales saves CSV with semicolons and a byte order mark at the start of the file. The converter detects the semicolon and removes the mark, so the first column name comes out clean instead of with an invisible character in front.
Reading a CSV export before you import it
Converting a database or CRM export to JSON shows exactly what each row holds, including empty cells and values that span several lines, before you feed it to another system.
Private by design
Whatever you paste or drop here is parsed in this browser tab and never uploaded, so exports holding customer records, tokens or internal URLs stay on your device. No account needed.
Good to know
Header row. With First row is the header on, each row becomes an object keyed by the column names. Duplicate column names are renamed so no value is lost: a second name column becomes name_1 (and a column named __proto__ becomes __proto___1). With it off, each row becomes an array of values.
Uneven rows. A row with fewer cells than the header simply lacks the missing keys. A row with more cells keeps the extra values in an array under the key __parsed_extra.
Detecting types. With Detect numbers and true/false on, a cell becomes:
- a number when it is a plain decimal number such as
42,-3.5or1e3. Values with leading zeros (02134), spaces, thousands separators or a decimal comma stay text, and so do integers too large to hold exactly; - a boolean when it reads
trueorfalsein any letter case; - text otherwise. Empty cells stay empty strings (
""), and dates stay as written.
Turn the option off to keep every value as text.
Quoting. Fields in double quotes may contain the delimiter, line breaks and doubled quotes (""), as in RFC 4180. A quote that is never closed is reported with the line where it opens. Blank lines, and lines holding only spaces, are skipped. A byte order mark at the start of the file is removed.
Output. Pretty indents the JSON with 2 spaces; Minified writes it on one line.
In — Semicolon-separated export
name;age;city
Ana;30;"Lisbon; PT"
Bo;;PortoOut — JSON, auto-detected semicolon
[
{
"name": "Ana",
"age": 30,
"city": "Lisbon; PT"
},
{
"name": "Bo",
"age": "",
"city": "Porto"
}
]| Case | What happens |
|---|---|
| Candidates | Comma, semicolon, tab and pipe are each tried on the first 10 rows |
| Winner | The delimiter that gives every row the most consistent number of fields |
| Tie | The one that splits rows into more fields wins; then the order comma, semicolon, tab, pipe |
| Quoted fields | A delimiter inside quotes does not count: "Lisbon; PT" is one field |
| Single column | No candidate gives at least 2 fields per row, so comma is used |
| Chosen by you | Picking a delimiter in the options skips detection |
Frequently asked questions
How does the converter know which delimiter my file uses?
It tries comma, semicolon, tab and pipe on the first 10 rows and keeps the one that splits every row into the same number of fields. The status line under the output shows the result. If it guesses wrong, choose the delimiter yourself in the options.
Why did my zip codes or IDs not turn into numbers?
On purpose. Values with leading zeros, such as 02134 or 007, stay text so the zeros are not lost, and so do integers too large for JavaScript to store exactly. Turn off Detect numbers and true/false to keep every value as text.
Can a CSV field contain commas or line breaks?
Yes, when the field is wrapped in double quotes, which is what Excel and most tools write. The quotes are removed in the JSON, line breaks inside the field are kept, and a doubled quote ("") becomes a single quote character.
What if my CSV has no header row?
Turn off First row is the header. Each row then becomes an array of values instead of an object, and the first row is treated as data like the others.
Why does the first column name have a strange character in other converters?
Excel adds a byte order mark (the bytes EF BB BF) to the start of UTF-8 CSV files. Converters that do not remove it glue it to the first column name, so "name" no longer matches. This converter removes it before parsing.