json:yaml

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.

CSV
JSON

      
Paste CSV to convert.

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:

CellBecomesWhy
429.00429Parses as a number
true / falseBooleanExact lowercase match only
00123"00123"Leading zero — kept as text to preserve it
+44 20 7946TextNot a clean number
Empty cell""An empty string, not null — CSV cannot distinguish them
2026-03-04TextDates 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.

Questions people ask

Does the first row have to be a header?
Yes. The first line is always treated as the header and its cells become the object keys.
How are numbers and booleans detected?
A cell that parses cleanly as a number becomes a number, and exactly true or false becomes a boolean. Values with a leading zero stay as strings so identifiers are not damaged.
Why is my empty cell an empty string and not null?
CSV cannot distinguish an empty string from a missing value, so the safer choice is an empty string. Post-process the output if your consumer needs null.
My whole file lands in one column. What is wrong?
The file is probably semicolon-delimited, which is common in European exports. Replace the semicolons with commas first.
What is the strange character on my first key?
A byte order mark, added by Excel when saving as CSV. Save as CSV UTF-8 without BOM, or strip the first character.
Can I parse CSV by splitting on commas in my own code?
No. It breaks on the first quoted field containing a comma, and real data always has one. Use a proper parser such as Python's csv module or csv-parse in Node.