CSV to JSON Converter
Convert CSV to JSON and JSON to CSV. Detects comma, semicolon, tab and pipe delimiters, handles quoted fields, infers numbers and booleans, and flattens nested objects.
Input (CSV)
Output (JSON)
How to convert CSV to JSON
- 1
Choose a direction
Select CSV → JSON or JSON → CSV.
- 2
Paste your data
Paste CSV or a JSON array. The output updates as you type.
- 3
Adjust options
For CSV input, set the delimiter, header row and type inference. For JSON input, choose how nested objects are written.
- 4
Copy or download
Copy the result, or download it as data.json or data.csv.
CSV dialects and conversion pitfalls
There is no single CSV format
RFC 4180 describes the common form: comma separator, CRLF line endings, fields wrapped in double quotes when they contain a comma, quote or line break, and quotes inside a field doubled (""). Real files deviate. Excel in many European locales uses semicolons, database exports often use tabs or pipes, and some tools escape quotes with a backslash, which RFC 4180 parsers, including this one, read as a literal character.
Encoding and the BOM
Excel's "CSV UTF-8" format starts the file with a byte order mark (EF BB BF). If it is not stripped, the first header is read as "id" with an invisible U+FEFF in front, and lookups by that key fail. This converter removes a leading BOM. Files saved as Windows-1252 or Shift_JIS show garbled accented characters; re-save them as UTF-8 first.
Types are guesses
CSV has no types; every cell is text. Inference is a heuristic: 1e5 becomes 100000, TRUE becomes true, and an empty cell becomes null. Leading zeros, plus signs and integers beyond 2^53 stay strings because converting them loses information. Spreadsheet apps guess too (Excel turns 1-2 into a date on import), so check product codes and IDs after a round trip.
Flattening JSON
CSV is flat, so nested data has to be encoded. Dot paths ({"user":{"id":1}} becomes a user.id column) keep each value in its own column and match the default of pandas.json_normalize. Arrays are written as JSON text because their length varies between rows. Columns are ordered by the first appearance of each key across all rows.
Formula injection
A cell starting with =, +, - or @ is treated as a formula when the file is opened in Excel or Google Sheets. If the CSV contains user-supplied text and will be opened by other people, prefix such cells with a single quote or validate the data first. This converter writes values unchanged.