CSV to JSON Converter
Convert CSV text or a .csv file into a JSON array of objects. Quoted fields containing commas, quotes or line breaks are parsed correctly, and you choose the delimiter.
Drop a CSV file here (optional)
Or paste CSV data below
Max 1 file, up to 50.0 MB each
About the CSV to JSON
Paste CSV text or load a .csv file, pick the delimiter and press Convert to JSON. Each row becomes a JSON object and the header row supplies the keys, so a header name,city followed by the row Asha,Pune becomes {"name": "Asha", "city": "Pune"}. The result is a JSON array indented with two spaces, ready to copy or save as data.json.
The parser follows the RFC 4180 rules that spreadsheet programs use when they export CSV. A field wrapped in double quotes may contain the delimiter, line breaks and doubled quotes ("" stands for one "). That means "Pune, Maharashtra" stays one value, and a multi-line address in a quoted cell stays inside one record instead of breaking the row in two. Windows (CRLF) and Unix (LF) line endings both work, blank lines are skipped, and a byte-order mark at the start of the file is ignored. If a quote is never closed, you get an error naming the line where the quoted field started, rather than silently shifted columns.
Every value stays a string: "42" is not turned into the number 42 and "true" is not turned into a boolean. This keeps leading zeros in PIN codes, phone numbers and IDs intact; convert types in your own code where you need them. To check or pretty-print the output, use the JSON Formatter. To go the other way, JSON to CSV writes CSV with the same quoting rules.
How to use the CSV to JSON
- 1
Add your CSV
Paste it into the CSV Input box, or drop a .csv, .tsv or .txt file on the drop area (or click Browse Files). The file's text replaces the sample data.
- 2
Choose the delimiter
Select Comma, Semicolon, Tab or Pipe. Excel in many European locales exports with semicolons; tab-separated (TSV) files need Tab.
- 3
Set the header and trimming options
Keep "First row is header" ticked to use row 1 as keys, or untick it to get keys named column1, column2 and so on. "Trim spaces around unquoted values" removes spaces such as the one after a comma.
- 4
Convert and export
Press Convert to JSON. The output label shows the number of records; use Copy for the clipboard or Save to download data.json.
What it can do
Correct quoted-field parsing
Delimiters, line breaks and "" escapes inside double quotes are read as part of the value, as RFC 4180 describes.
Four delimiters
Comma, semicolon, tab and pipe, so exports from Excel, Google Sheets, databases and log tools all work.
Safe key names
An empty header cell becomes columnN, and a repeated header such as two "email" columns becomes email and email_2, so no value is overwritten.
Uneven rows reported
If some rows have more or fewer fields than the header, a warning says how many. Missing values become empty strings and extra values get columnN keys.
Clear error for broken quotes
An unclosed quote stops the conversion with the line number where the quoted field began.
Limitations
- All values are output as strings. There is no detection of numbers, booleans or null, and headers like "address.city" stay flat keys rather than nested objects.
- Files are read as UTF-8. A CSV saved in an older Windows encoding can show garbled accented characters; re-save it from Excel as "CSV UTF-8" first.
- Excel workbooks (.xlsx) are not read directly. Export the sheet as CSV first.
- The drop area takes one file of up to 50 MB. Very large inputs make the page slow because the full CSV and JSON are shown in text boxes.
- The delimiter is not detected automatically; pick it before converting.
Privacy
The CSV is parsed by JavaScript in your browser and files you choose are read locally; nothing is uploaded to FlexyPdf's servers.
Frequently asked questions
Some of my values contain commas. Will the columns shift?
Not if those values are wrapped in double quotes, which is what Excel and Google Sheets do when they export CSV. "Pune, Maharashtra" stays one value. A comma in an unquoted value is treated as a delimiter, because CSV has no other way to tell them apart.
Why are numbers shown in quotes in the JSON output?
The converter keeps every value exactly as text, so "007" and "9876543210" keep their digits and leading zeros. If you need real numbers, convert the fields you know are numeric in your own code, for example with Number(value).
What happens when a row has more or fewer columns than the header?
Missing values are filled with empty strings, and extra values get keys such as column5. A yellow note under the output tells you how many rows were uneven so you can check the source file.
My CSV came from Excel and everything ends up in one field. What is wrong?
Excel in many European locales separates fields with semicolons instead of commas. Choose Semicolon in the Delimiter list and convert again.
Are spaces inside quoted values removed?
No. The trimming option only affects unquoted values, so Asha, Pune gives "Pune" while Asha," Pune " keeps " Pune " with its spaces.
Ratings & Reviews
Rate CSV to JSON
Help others by sharing your experience. Your rating is shown without your name.
More Converters
View all →JSON to CSV
Turn a JSON array of objects into CSV for Excel or Google Sheets
JSON to YAML
Convert JSON to YAML, or common YAML config files back to JSON
Base64 Encoder/Decoder
Encode text or files to Base64 and decode Base64 back
HEX to RGB
Convert HEX colour codes to RGB and HSL, and back