CSV to JSON
input.csv
output.json
The JSON appears here.
or drop a .csv file into the left pane
How the parse works
The first row is treated as the header, and each subsequent row becomes an object keyed by those column names. Parsing is a character-by-character scan that tracks whether it is inside a quoted field, which is what makes embedded delimiters and line breaks safe:
id,note
1,"Hello, world"
2,"line one
line two"Row 1's note keeps its comma, and row 2's keeps its newline. A naivesplit(',') gets both wrong, which is the single most common reason a hand-rolled CSV import corrupts data.
Type inference
CSV has no types — every field is text. Values are converted only when they match canonical JSON syntax exactly:
42,-1.5,2e10become numbers.trueandfalsebecome booleans,nullbecomes null.- Everything else stays a string — including
007,1,5,+44 20, and0x1F.
That conservative rule is deliberate. Aggressive coercion is how zip codes lose their leading zeros and how product codes turn into scientific notation.
Delimiters and encoding
A leading UTF-8 byte order mark is stripped, so files exported from Excel do not end up with a stray character glued to the first column name. Line endings may be LF,CRLF, or bare CR.
After converting
Send the result to the tree viewer to inspect it, or theformatter to change the indentation. To go the other way, useJSON to CSV.
Common questions
Does it handle semicolons or tabs instead of commas?
Yes. The delimiter is detected from the first line by trying comma, semicolon, tab, and pipe and keeping whichever splits it into the most fields. European exports that use semicolons and TSV files both work without any setting.
Why is my phone number or zip code still a string?
Only canonical JSON number syntax is converted. 007, +1-555-0100, and 1,5 stay strings, because turning them into numbers would silently destroy the leading zero or the formatting. 42 and -1.5e3 do become numbers.
What if two columns have the same header?
Object keys are unique, so a duplicate would silently drop a column. The second occurrence is suffixed instead — name and name_2 — and a blank header becomes column_3 for the third column. Every column stays addressable.
Can a value contain a line break?
Yes, as long as it is inside double quotes. The parser tracks quote state character by character, so a quoted field spanning several lines is read as one value rather than breaking the row.
The rest of the toolkit
Same engine, same privacy — every page runs entirely in your browser.
JSON formatter
Indent JSON with 2 spaces, 4 spaces, or tabs, then copy or download the result.
JSON viewer
Expand, collapse, and search a JSON tree; copy any value or its path.
JSON validator
Find syntax errors with exact line, column, and a suggested fix.
JSON minifier
Strip whitespace and see the byte savings before and after.
JSON beautifier
Turn minified or broken JSON into clean, highlighted output.
JSON pretty print
Readable indentation with optional deep key sorting.
JSON to CSV
Flatten an array of objects into spreadsheet rows, quoted correctly.
JSON to YAML
Config-ready YAML with no folded strings and no anchors.
YAML to JSON
YAML 1.2 parsing, multi-document streams, errors reported by line.
JSON to XML
Arrays repeat their tag; @keys become attributes.
XML to JSON
Entities, CDATA, and namespaces handled by the browser’s XML parser.
JSON diff
Compare two documents by path — key order and indentation are ignored.