CSV to JSON
Paste CSV data and get a clean JSON array. Supports quoted fields, custom delimiters, and header rows.
What is CSV to JSON conversion?
CSV (Comma-Separated Values) stores one record per line with fields separated by a delimiter. JSON conversion maps that table into an array of objects (when a header row names the columns) or an array of arrays (when there is no header). The parser here follows RFC 4180: wrap a field in double quotes if it contains the delimiter, a newline, or a quote, and write a literal quote as two quotes (""). See the RFC 4180.
Paste a spreadsheet export and this converter turns each row into JSON without sending the file anywhere. Conversion uses a character-level parser that understands RFC 4180 quoting, so a field such as "Charlie, Jr." stays one value instead of splitting on the comma. You pick the delimiter (comma, semicolon, or pipe) and whether the first row is a header. With the header on, rows become objects keyed by column name. With it off, rows become arrays of strings. Every cell is a string — the tool never guesses numbers or booleans — so "0123" and "false" survive as they appeared in the sheet. Copy the JSON or download it as a .json file. For a sortable table instead of JSON, open the same paste in the CSV Viewer. To go back from JSON to a sheet, use JSON to CSV.
When to use this tool
- API payloads from a sheet — Export a roster or product list from Excel as CSV, convert it here, and POST the array to a REST endpoint.
- NoSQL seed data — Turn a CSV dump into JSON documents for MongoDB, CouchDB, or a fixture file.
- European semicolon files — Switch the delimiter to semicolon when the export used comma as the decimal mark (12,50).
- Inspect before you convert — If you need to sort or search first, open the file in CSV Viewer, then convert the same text here. CSV Viewer
- Pretty-print the result — The output is already indented with two spaces. Use JSON Formatter if you need to minify or validate it further. JSON Formatter
How to use the CSV to JSON Converter
Paste the CSV
Copy from a .csv file or a spreadsheet and paste into CSV Input. Click Sample to load a three-row roster that includes a quoted name with a comma.
Choose the delimiter
Comma is RFC 4180 CSV. Semicolon is common in European locales. Pipe shows up in logs and some warehouse exports. The parser treats the chosen string as the field separator, including inside detection of quoted regions.
Toggle the header row
Leave “First row is header” on to key each object by the trimmed header cells. Turn it off to emit a JSON array of arrays — useful for files that are only values.
Copy or download
Copy JSON places the pretty-printed array on the clipboard. Download saves output.json. Clear empties the textarea; Sample restores the demo.
Worked examples
Header row with a quoted comma
id,name,email,role 1,Alice,alice@example.com,admin 2,Bob,bob@example.com,user 3,"Charlie, Jr.",charlie@example.com,user
[
{
"id": "1",
"name": "Alice",
"email": "alice@example.com",
"role": "admin"
},
{
"id": "2",
"name": "Bob",
"email": "bob@example.com",
"role": "user"
},
{
"id": "3",
"name": "Charlie, Jr.",
"email": "charlie@example.com",
"role": "user"
}
]The quoted name stays one field. id values remain strings, not numbers.
No header — arrays of strings
Alice,alice@example.com Bob,bob@example.com
[
[
"Alice",
"alice@example.com"
],
[
"Bob",
"bob@example.com"
]
]Semicolon delimiter and a decimal comma
sku;price W-104;12,50
[
{
"sku": "W-104",
"price": "12,50"
}
]Select Semicolon (;) in the sidebar. The price is the string 12,50, not 12.5.
Tips
- Export from Excel as CSV UTF-8 when names contain accents or non-Latin scripts.
- Keep header cells unique; duplicate headers overwrite each other on the same object.
- Trailing empty rows are dropped. A completely empty paste yields [].
- Pipe-delimited logs convert the same way — switch the delimiter, leave the header toggle as it matches the file.
Frequently Asked Questions
Does CSV to JSON upload my spreadsheet?
No. Parsing runs in the page with JavaScript. The CSV never leaves the browser, so it is safe for internal rosters and unreleased catalogs.
Why are numbers quoted as strings in the JSON?
CSV has no types. The converter trims each cell and stores it as a string so leading zeros, phone numbers, and decimal commas are not altered. ParseInt or Number in your own code if you need numeric fields.
How are quoted fields and escaped quotes handled?
A field wrapped in double quotes may contain commas, newlines, or quotes. A literal quote inside a quoted field is written as two quotes (""), matching RFC 4180. The Sample row "Charlie, Jr." demonstrates a comma inside quotes.
What if my file uses semicolons or pipes?
Pick Semicolon (;) or Pipe (|) in the sidebar before you rely on the output. The delimiter is not auto-detected here — unlike CSV Viewer, which counts separators in the first 1,000 characters.
Can I convert an Excel workbook directly?
Save or export the sheet as CSV (UTF-8 if you have non-ASCII names), then paste the text. This tool does not read .xlsx binaries.