CSV to JSON Converter · CSV JSON Matrix
Convert CSV to JSON and back, with full RFC 4180 quoted-field support. Your data never leaves your browser.
Updated:
CSV Input
JSON Output
What the CSV to JSON converter does
CSV (comma-separated values) is the plain-text table format spreadsheets export to, while JSON is the structured format most APIs and apps expect — and converting between them by hand means writing a parser or fighting with quoted commas. CSV JSON Matrix converts a CSV table into an array of JSON objects, or a JSON array back into CSV, handling quoted fields (like a value containing a comma) correctly along the way.
How to use the CSV to JSON converter
- Pick a direction with the CSV → JSON / JSON → CSV switch at the top of the input panel.
- Paste your data with the Paste button, type it directly, or click Example to see sample data.
- Read the converted result as it appears instantly in the output panel on the right.
- Click Copy to copy the result, or Download to save it as a file.
How CSV ↔ JSON conversion works
CSV looks simple until a field itself contains the delimiter. RFC 4180 solves this by allowing a field to be wrapped in double quotes — inside quotes, commas and even line breaks are just data, and a literal quote is written as two quotes in a row (""):
// CSV
name,note
"Smith, John","He said ""hi"" to me"
// JSON
[
{ "name": "Smith, John", "note": "He said \"hi\" to me" }
]
This tool detects the delimiter (comma, semicolon or tab) from the first line and parses character-by-character rather than splitting on the delimiter — a plain split(',') would cut the "Smith, John" example into two broken fields. Converting JSON back to CSV builds the header row from the union of every object's keys, and re-quotes any field that contains a comma, quote, or line break.
Examples
1. A semicolon CSV from a European spreadsheet. Excel in locales that write decimals with a comma exports with ; as the separator. The tool picks the semicolon up from the header line, keeps the ; inside the quoted field as data, and leaves every value as a string, so 3,50 is not mangled into a number:
// CSV
sku;product;price
A-102;"Té verde; lata";3,50
// JSON
[
{
"sku": "A-102",
"product": "Té verde; lata",
"price": "3,50"
}
]
2. JSON records that don't all have the same keys. API responses often have optional fields. In JSON → CSV mode the header row is the union of every object's keys in first-seen order, a missing key becomes an empty cell, and a nested array is written as JSON inside a quoted field, with its quotes doubled:
// JSON
[
{"id": 1, "name": "Ada", "tags": ["admin", "dev"]},
{"id": 2, "name": "Linus", "email": "linus@example.com"}
]
// CSV
id,name,tags,email
1,Ada,"[""admin"",""dev""]",
2,Linus,,linus@example.com
If the JSON side won't parse, the JSON Formatter points to the exact error; once you have clean JSON rows, JSON to Types turns one into a TypeScript, Python or Go type. The quoting rules used in both directions are the ones in RFC 4180.
Frequently asked questions
Does it handle commas inside quoted CSV fields?
Yes. Fields wrapped in double quotes can contain commas, line breaks, and escaped "" quotes, per RFC 4180 — a naive comma-split would break on all three.
How is the CSV delimiter detected?
The tool inspects the first line and picks whichever of comma, semicolon, or tab appears most often outside quotes.
What does JSON to CSV do with missing fields?
The header row is the union of every key seen across all objects. Any object missing a key gets an empty cell for it.
Is my data uploaded anywhere?
No. All parsing happens in your browser with plain JavaScript; nothing is sent to a server.