Data Tools
CSV to JSON Converter
Convert CSV to a JSON array or JSON Lines in your browser. Detects the delimiter, handles quoted fields and line breaks, infers types and reads uploaded files.
How to use CSV to JSON Converter
Paste CSV or upload a .csv file of up to 5 MB. The delimiter is detected for you, or choose one. With a header row you get an array of objects, otherwise an array of arrays. Turn on type detection, nested objects or trimming as needed, then copy or download the JSON.
- Add your CSVPaste CSV or switch the input to a file upload. The file encoding is detected, with a manual override.
- Choose the outputPick an indent or JSON Lines, say whether the first row holds field names and whether to detect types.
- Check and downloadRead the record and column counts and any warnings about uneven rows, then copy or download the JSON.
Quotes, line breaks and uneven rows
The parser reads the CSV character by character: commas and line breaks inside quotes stay in the field, and two double quotes become one. In the sample, Carol's note spans two lines and becomes "line one\nline two". An unclosed quote stops with an error that names the line it starts on. Rows with more or fewer fields than the header are listed by line number and padded, and blank or repeated field names become unique names such as column_3 or name_2 so nothing is overwritten.
Type detection and file encodings
Type detection is off by default, so every value stays a string. Turn it on and 30 becomes the number 30, true becomes a boolean and empty fields become null, while codes with leading zeros such as 041 and numbers longer than 15 digits stay as text, so postcodes and order numbers survive intact. Uploaded files are read as UTF-8; if they are not valid UTF-8 the tool assumes Windows-1252, says so in the result, and lets you pick another encoding such as GBK or UTF-16.
Accuracy and data handling
Keep the original data and spot-check fields, types and delimiters before using an important conversion. The calculation runs in your current browser; the tool code does not send the input to a processing API.
FAQ
Can quoted fields contain commas or line breaks?
Yes. Commas, semicolons and line breaks inside a quoted field are kept as part of the value, and two double quotes in a row become one literal quote.
Which delimiters are detected?
Detection compares commas, semicolons, tabs and pipes outside quotes over the first 30 lines and picks the one that appears the same number of times on most lines. You can also choose one yourself.
Can it build nested JSON?
Yes. Tick Build nested objects from dotted field names and user.name and user.city become one user object. If there is also a plain user column, the dotted names stay flat so nothing is overwritten.
More Data Tools
Related toolsConvert CSV or spreadsheet cells into Markdown, HTML or ASCII table code.
Convert file sizes and estimate how long a transfer takes at any speed.
Pull values out of JSON with JSONPath: wildcards, slices and filters.
Convert XML to JSON with attributes and repeated elements, or JSON back to XML.
Turn CSV into a GitHub Markdown table, or a Markdown table back into CSV.
Convert tab-separated spreadsheet data to CSV, or CSV back to TSV.