CSV to JSON converter
Paste CSV and get back a JSON array of objects. The header row becomes your keys, and quoted fields, embedded commas and doubled quotes are all parsed properly.
Conversion happens in this browser tab. Nothing is uploaded, logged, or stored.
How rows become objects
The first line is treated as the header. Every line after it becomes one object, with the header cells as keys. The result is an array of objects — the shape most APIs and JavaScript code expect.
Quoted fields are parsed per RFC 4180: a doubled quote inside a quoted field is a literal quote, and commas and newlines inside quotes do not split the row. Blank lines are skipped.
Type inference
CSV has no types — every cell is text. Producing useful JSON means guessing, and the guesses are deliberately conservative:
| Cell | Becomes | Why |
|---|---|---|
429.00 | 429 | Parses as a number |
true / false | Boolean | Exact lowercase match only |
00123 | "00123" | Leading zero — kept as text to preserve it |
+44 20 7946 | Text | Not a clean number |
| Empty cell | "" | An empty string, not null — CSV cannot distinguish them |
2026-03-04 | Text | Dates are left alone; you know your format, we do not |
The empty-cell rule is the one to watch. If your consumer needs null
rather than "", post-process the output.
Messy input
Duplicate header names
Two columns called name collapse into one key and the second wins.
Rename the columns before converting.
Rows with the wrong number of cells
Short rows get empty values for the missing keys. Extra cells beyond the header are dropped. If this happens across the whole file, a quoted comma somewhere is being mis-parsed — check for an unbalanced quote.
A byte order mark
Files exported from Excel often start with an invisible BOM, which turns the first
header into "\ufeffsku". Save as "CSV UTF-8" without BOM, or strip the
first character.
Semicolon-delimited files
European exports often use ;. Find and replace it with a comma first,
after checking no field contains a literal comma.
Doing it in code
# Python — everything stays a string, which is often what you want
import csv, json
with open("data.csv", newline="") as f:
rows = list(csv.DictReader(f))
print(json.dumps(rows, indent=2))
// Node, with a real parser — do not split on commas
import { parse } from "csv-parse/sync";
import fs from "node:fs";
const rows = parse(fs.readFileSync("data.csv"), {
columns: true,
skip_empty_lines: true,
});
To go back, use JSON to CSV. If the JSON you get out looks wrong, the JSON validator will show you the structure it actually produced.
Never parse CSV with split(","). It breaks on the first quoted field
that contains a comma, and that field always exists in real data.
Personal data does not leave your device
CSV is the format people export from spreadsheets, which is where finance, HR, and sales data lives. Of everything on this site, files pasted into this box are the most likely to contain names, salaries, addresses, and account numbers.
Nothing is uploaded. Your file is read by your own browser using its
FileReader API and parsed in this tab. No copy is transmitted, and none is
kept once the tab closes.