Convert CSV to JSON
Turn spreadsheet exports into JSON for APIs, scripts and config files, without your data leaving the page.
Paste or type above to see the result here.
Your files stay on your device
This tool runs entirely in your browser. What you paste is processed on your device and is never sent to a server, so it is safe to use with tokens, keys and unpublished text.
Example
Example: a sign-up sheet with commas in names, leading-zero ZIP codes and a two-line note
A volunteer sign-up sheet is exported from Google Sheets as CSV to load into a small web app. The header is name,email,zip,team,notes. One name has commas in it, the ZIP codes for Boston and Hoboken start with 0, one note is empty and one runs over two lines (shown as ↵ below).
- Detect automatically finds the comma, and the header row becomes the keys of each object.
- Fields in double quotes keep their commas, a doubled quote inside one becomes a single quote, and the quoted line break comes out as \n.
- Every value stays a string: 02134 keeps its zero, which a number would lose.
- The result shows 3 rows and 5 columns. Unticking First row is a header gives 4 arrays of 5 strings instead, the header row among them.
| CSV line | Object in the JSON |
|---|---|
| "Carter, Jr., Sam",sam.carter@example.com,02134,Blue,"Needs a ""large"" shirt" | {"name": "Carter, Jr., Sam", "email": "sam.carter@example.com", "zip": "02134", "team": "Blue", "notes": "Needs a \"large\" shirt"} |
| Priya Shah,priya@example.com,07030,Red, | {"name": "Priya Shah", "email": "priya@example.com", "zip": "07030", "team": "Red", "notes": ""} |
| Tom O'Neil,tom@example.com,10001,Blue,"Arrives late,↵after 6 pm" | {"name": "Tom O'Neil", "email": "tom@example.com", "zip": "10001", "team": "Blue", "notes": "Arrives late,\nafter 6 pm"} |
A JSON array of 3 objects, ready to copy or download as a .json file. Turn the fields you count with into numbers in your own code, but leave zip as a string: as a number, 02134 would become 2134.
How it works
- Paste CSV text into the input box, or export a sheet from Excel or Google Sheets as CSV and paste its contents.
- Leave the delimiter on Detect automatically; the tool counts commas, semicolons and tabs on the first lines and picks the most likely one. Override it if the guess is wrong.
- Keep First row is a header ticked so column names become object keys. Untick it to get an array of arrays instead.
- The result appears as you type; copy it or download it as a .json file.
Frequently asked questions
- Is my data sent to a server?
- No. Parsing runs as JavaScript in the page. The text never leaves your browser, and the tool works offline once loaded.
- What does the output look like?
- With a header row, each subsequent line becomes an object whose keys are the header names, and the whole file is a JSON array of those objects. Without a header, each line becomes an array of strings.
- Why are numbers in quotes?
- All values are kept as strings on purpose. CSV has no type information, and converting automatically would break postcodes with leading zeros, phone numbers and long IDs. Cast the fields you need in your own code.
- Are quoted fields and line breaks handled?
- Yes. Fields wrapped in double quotes can contain the delimiter, doubled quotes and line breaks, following RFC 4180. Empty fields become empty strings.
- What if a row has more or fewer fields than the header?
- A short row gives an object without the missing keys: two values under a three-column header give only the first two keys. A long row keeps the extra values in an array under __parsed_extra, which is usually the sign of a comma inside a field that was not quoted.
- What happens to two columns with the same name?
- The second one is renamed with _1 added, so phone and phone become phone and phone_1, and neither value overwrites the other.
- Is there a size limit?
- The free plan allows 5 runs per day; there is no practical limit on the text length, but very large inputs of several hundred thousand lines may take a few seconds. Pro removes the daily limit.