How does CSV become JSON?
CSV is a rectangle of text with no type information: every cell is a string, and the only structure is the column order. JSON is a tree with real types. Converting between them means deciding two things the CSV file cannot tell you — what the keys are called, and which strings are actually numbers.
This converter takes the column names from the header row and turns each remaining row into one object in an array. Values that look like numbers or booleans become real JSON numbers and booleans, so the receiving code does not have to convert them again — with one deliberate exception described below.
Each record is located on a separate line, delimited by a line break.
Features
- Types that a parser would agree with
- 42 becomes a number, true becomes a boolean, an empty cell becomes null. The receiving side gets values it can use directly instead of a wall of quoted strings.
- Leading zeros stay strings
- 03187 stays "03187". Postal codes, phone numbers, and zero-padded identifiers lose their meaning the moment they become numbers, and that loss is silent.
- Delimiter detection
- Comma, semicolon, tab and pipe are tested for how evenly they appear outside quoted fields. Excel exports semicolons on Korean and European locales, and a comma-only converter turns those files into one column.
- Quoted fields survive
- A field like "Doe, Jane" stays one value, and quotes doubled inside a field are unescaped correctly, per RFC 4180.
- Rows that do not fit are reported
- A row with more or fewer fields than the header is listed rather than silently trimmed — it is usually a missing quote, and finding it in production costs much more.
How to use
- 1
Paste the CSV
Paste the file contents, or a range copied straight out of a spreadsheet.
- 2
Confirm the header row
Keep "first row is a header" on so the JSON keys come from the column names.
- 3
Decide about types
Leave type inference on for a normal API payload; turn it off when every value must stay a string.
- 4
Copy the JSON
Copy the array and paste it into a request body, a fixture, or a seed file.
Frequently asked questions
How do I convert CSV to a JSON array?
Paste the CSV with its header row and the output is an array of objects, one per data row, with keys taken from the header. That is the shape almost every API and test fixture expects.
Why did my ID column turn into a number?
Because it looked like one. Turn off type inference if every value must stay a string. Values with a leading zero are kept as strings automatically, but a plain long number such as an order ID is converted — and very long ones can exceed the range JavaScript represents exactly, so IDs are safer as strings on the producing side too.
What happens to an empty cell?
It becomes null with type inference on, and an empty string with it off. CSV cannot distinguish an empty string from a missing value, so this is a choice rather than a translation — pick the one your consumer expects.
Can it handle a file exported from Excel?
Yes. Set the delimiter to semicolon, or leave it on Auto, if your Excel runs on a locale where the comma is the decimal separator. If the text arrives with mojibake, the file was saved without a UTF-8 byte order mark — save it as "CSV UTF-8" from Excel.
Is my file uploaded?
No. Parsing and conversion run in your browser and this page has no backend, so a customer export can be converted without leaving your machine.
What is the difference between this and the CSV viewer?
The viewer is for reading a file — it shows the table, the detected delimiter, and any malformed rows. This page is for producing JSON from it. Both use the same parser.
If you hit this
Specifications this follows
- RFC 4180 — Common Format and MIME Type for CSV Files — The quoting and record rules this parser follows.
- RFC 8259 §6 — JSON Numbers — Why very long numeric IDs are safer as JSON strings.
Related tools
- JSON to CSV ConverterTurn a JSON array into a spreadsheet, flattening nested objects and keeping every field.
- CSV Viewer & ConverterOpen delimited data as a table, guess the delimiter, and convert it to JSON.
- JSON ViewerValidate, format, and explore JSON as a tree or a table. Large API responses stay foldable.