CSV to JSON Converter — Turn CSV into Objects
Convert CSV to JSON (delimiter auto-detect, headers, type conversion, nesting)
Runs in your browser · nothing is uploaded
What it is
CSV is the usual way to move a table out of a spreadsheet or database, while web code mostly wants JSON. This tool converts pasted CSV into JSON. The default is an array of objects keyed by the header row, and without a header you get an array of arrays.
How to use
- Paste the whole CSV into the input, or open a file with Open CSV file (Korean Excel files saved in EUC-KR open as they are).
- Leave the delimiter on Auto-detect or choose one. Turn off the header option if the first row is data.
- Turn on type conversion if you want numbers and true/false as JSON types.
- Turn on nesting restore to turn a column like
address.cityback into{"address":{"city":...}}. It is handy for CSV made by a JSON to CSV converter. - Pick an indentation and copy the result.
How it works
-
Parsing follows RFC 4180. Delimiters and line breaks inside double quotes belong to the value, and two double quotes read as one. Completely blank lines are skipped.
-
Type conversion applies only to
trueandfalse(lowercase) and plain decimal notation like-12,3.5or1e3.007,+1,1e999and integers beyond 9007199254740991 stay strings. An empty cell is an empty string. -
Duplicate header names become
name,name_2,name_3so no column disappears. -
Nesting restore stacks dotted headers into objects and expands cells that start with
[or{and are valid JSON into arrays and objects. If a dotted key collides with an existing value, it stays as a literal key. -
A UTF-8 BOM at the start of the input is removed.
-
Round-trip caveats: empty cells become empty strings, not
null, and turning on type conversion converts numeric strings such as"123"into the number123, so a JSON → CSV → JSON trip may not reproduce the original exactly.
Examples
Input:
name,age,address.city
홍길동,30,Seoul
Result with type conversion and nesting restore on:
[{"name": "홍길동", "age": 30, "address": {"city": "Seoul"}}]
FAQ
Do I have to choose the delimiter?
By default it is detected automatically from comma, semicolon, tab and pipe, based on how the first lines look. If a value contains many of another delimiter and the guess is wrong, pick one yourself. The detected delimiter is shown above the result.
Why are my numbers strings?
Every value stays a string by default. Turn on Convert numbers and true/false to change that. Even then, values such as 007 with a leading zero, +1 and integers beyond 2^53 stay strings so no information is lost.
Will CSV saved from Excel keep non-English text intact?
Open the file with **Open CSV file**. A UTF-8 or UTF-16 byte order mark decides the encoding; otherwise the file is read as UTF-8 and, if that fails, as EUC-KR (CP949), the default of Korean Excel, and if it is not valid EUC-KR either, as Windows-1252 (Western European Excel). The page says which it used. Text that already looks garbled after copying from another program cannot be repaired by pasting, so open the file instead.
What happens to rows with the wrong number of fields?
They are still converted, and the tool lists those row numbers under Rows to check. Missing cells leave their keys out of the result and extra cells are dropped.
Related tools
JSON to CSV Converter
Convert a JSON array of objects to CSV (flattening, delimiters, Excel BOM)
JSON Formatter
Beautify, minify and validate JSON, sort keys, errors with line and column
YAML to JSON Converter
Convert YAML to JSON (safe schema, anchors and merge keys, error line)
Charset Converter
A converter that re-encodes text and files between Korean, Japanese and Unicode encodings