CSV to JSON converter
Convert CSV spreadsheets to JSON
Paste a table or drop a .csv file and Papa Parse reads it with the header row switched on, so every data row becomes an object whose keys are the column names. Blank lines are skipped and values are typed as it goes: digits become numbers, the words true and false become booleans, and everything else stays a string. The delimiter is sniffed from the text rather than configured, so comma, semicolon, tab and pipe files all work. The output is a JSON array printed with two-space indentation, ready to paste into code.
Key facts about CSV to JSON converter
| Parser | Papa Parse 5.5 with header, skipEmptyLines and dynamicTyping enabled. No options are exposed for you to change. |
|---|---|
| Output shape | Always a flat array of objects, one per data row, serialised with two-space indentation. |
| Delimiter | Detected from the content, covering comma, semicolon, tab and pipe, which suits European exports out of the box. |
| Value typing | Numeric strings become numbers and true or false become booleans. Empty cells stay as empty strings. |
| Leading zeros | Lost. A postcode or product code like 007 arrives in the JSON as the number 7, not the string. |
| Long identifiers | A 19-digit ID exceeds what a JSON number holds exactly, so the last digits change. Prefix or quote such columns. |
| Quoted fields | Commas, semicolons and line breaks inside double quotes are handled, including doubled quotes as an escape. |
| Duplicate headers | Two columns with the same name collapse into one key, and the later column wins. |
| Nesting | None is inferred. A header such as user.name becomes a literal key with a dot in it, not a nested object. |
| Live preview | In paste mode a table shows the first ten rows and the total row count before you convert. |
| Modes | Paste and convert, or file upload. This pair is one of the few with both, because CSV and JSON are both text. |
| Size ceiling | The file picker stops at 500 MB, but practical limits come from your device memory long before that. |
What happens to your file
Both modes stay on your machine. Pasted text never leaves the textarea it is typed into, and an uploaded file is read with the File API and parsed by the copy of Papa Parse bundled into this page. The JSON is built with JSON.stringify in the same tab and handed to the clipboard or to a local download. Nothing is logged, nothing is queued for processing elsewhere, and no request carrying your rows is made, which matters when the table contains customer records or export data.
About this tool
- 1
Choose a mode
Paste and convert is selected by default. Switch to file upload for anything too large to paste comfortably.
- 2
Add the data
Paste the CSV into the input panel or drop a .csv file. The first row is treated as the header.
- 3
Check the preview
In paste mode a table appears under the panels showing the first ten parsed rows and the total count.
- 4
Convert
Press the convert button and the JSON array appears in the output panel with a character count.
- 5
Copy or download
Use the copy button for pasted input, or save a .json file when you converted from an uploaded file.
| Input and output | Takes .csv (text/csv) and returns the JSON as a blob with the application/json type, named after the file you dropped in. |
|---|---|
| Engine | Papa Parse 5.5.3 bundled into the page reads the CSV, and JSON.stringify writes the array back out - no worker, no WebAssembly, no download. |
| Modes | Both modes: paste the CSV in and copy the JSON straight back out, or hand over a file and take the JSON as a download. |
| Batch and caps | Twenty CSV files per run at 500 MB each; several JSON results are zipped in page memory as converted-json-files.zip. |
| Browser and device | CSV to JSON needs only the File API, a Blob download and the parser already in the bundle, so every current browser behaves the same and the page keeps working with the network off. |
- Clean the header row before converting. Those exact strings become your JSON keys, spaces, capitals, trailing blanks and all.
- Protect codes that must stay text. Automatic typing turns 007 into 7 and strips a leading plus from phone numbers, so rename the column or fix the values afterwards.
- Semicolon files from a European spreadsheet need no special handling, because the delimiter is detected from the text rather than assumed to be a comma.
- Use the preview table as a sanity check on quoting. If a field containing a comma has spilled into the next column, the quotes in your source are unbalanced.
- For anything above a few megabytes, switch to file upload rather than pasting, since a very large paste makes the textarea itself sluggish.
- Turn a spreadsheet export into seed data for an API, a test fixture or a MongoDB import without writing a parsing script.
- Convert an analytics or billing export into JSON so it can be filtered and reshaped in a JavaScript console.
- Prepare a lookup table from a CSV for a static site or a configuration file that expects JSON.
Related tools
View allNeed the opposite? Try JSON to CSV
Works well with this4
Other JSON tools12
Updated