CSV to JSON Converter

Turn CSV into a clean JSON array of objects or JSON Lines — with a real parser that handles quoted commas and line breaks, warns you about ragged rows instead of hiding them, and never uploads your data.

🔀 CSV to JSON converter — paste, upload, done

The JSON updates as you type. Files up to 5 MB are read on this device only — nothing is sent to a server, ever.

Try:
Max 5 MB · processed locally on your device · you can also drag a file onto the CSV box

🔒 Private by design: conversion happens on this device. No server sees your data, and this page stores nothing.

What does this CSV to JSON converter do?

It turns spreadsheet-style CSV text into structured JSON, live in your browser. Paste data or upload a file and you get a JSON array of objects — one object per row, keyed by the header row — ready to paste into an API request, a JavaScript file, a database import or a configuration. Prefer a stream format? Switch the output shape to JSON Lines and each row becomes one compact JSON object per line. As an online csv to json converter it needs no sign-up, no installation and no server round-trip: the file never leaves your device.

Two things set it apart from quick-and-dirty converters. First, it uses a real CSV parser built to the format's rules, so values containing commas, quotes and even line breaks survive intact — the cases where splitting text on commas silently corrupts data. Second, it is honest about imperfect input: if a row has too many or too few fields, you get a warning that names the row and tells you exactly what was done with the extra or missing values. Nothing is quietly dropped, and no mystery columns are invented.

How to use it

  1. Add your CSV. Paste it into the left box, click Upload (up to 5 MB), drag a file onto the box, or load the sample to see how it works.
  2. Check the options. The delimiter is detected automatically; override it if your file uses semicolons, tabs or pipes. Leave “First row is a header” on for normal spreadsheets, or untick it to get an array of arrays with every row treated as data.
  3. Choose types and shape. “Convert numbers & booleans” turns 34 into a number and true into a boolean — but never touches codes like 007 or long ID numbers. Pick empty cells as "" or null, an array or JSON Lines, and the indentation you like.
  4. Read the status line and any warnings. It confirms how many rows and columns were parsed and flags ragged rows by number before you trust the output.
  5. Copy or download the finished JSON.

The CSV format rules this converter follows

CSV looks simple — values separated by commas — but the details decide whether a conversion is correct. This parser follows the widely used RFC 4180 rules. A field that contains a comma, a quote or a line break must be wrapped in double quotes, like "Smith, John". Inside a quoted field, a real quote is written twice: "say ""hi""" means the value say "hi". Quoted fields may contain whole line breaks, so one logical row can span several lines of the file — a parser that simply splits the file into lines will break exactly here. Rows may end with LF or CRLF line endings; both are handled, as is a UTF-8 byte-order mark at the start of a file.

Real-world files are messier than the standard, so the converter has explicit, visible policies instead of silent guesses. If two columns share a name, the later ones are renamed — a, a__1, a__2 — with a warning, so no column overwrites another. If a row has extra values, they are preserved in an _extra array on that row's object and the warning names the row; if a row is short, the missing values are filled with your chosen empty value and that is warned about too. The one true error is an unterminated quote: the output would be guesswork, so conversion stops and the error names the row where the quote opened.

Worked example

This CSV — note the quoted comma, the line break inside a quoted field, and the empty city:

name,age,city
"Smith, John",34,"New
York"
Aisha,29,
José,41,São Paulo

Becomes this JSON (header on, numbers converted):

[
  {
    "name": "Smith, John",
    "age": 34,
    "city": "New\nYork"
  },
  {
    "name": "Aisha",
    "age": 29,
    "city": ""
  },
  {
    "name": "José",
    "age": 41,
    "city": "São Paulo"
  }
]

The embedded line break is preserved as \n inside the string, the empty cell follows the policy you picked, and non-English characters pass through untouched. Load the sample above and you will get exactly this.

How to convert CSV to JSON in Excel

Excel has no “Save as JSON” button, which surprises people — a spreadsheet is already rows and columns, so the gap feels like it should be one click. There are two workable routes. In Microsoft 365, Power Query can do it: select your data, use Data → From Table/Range to load it into Power Query, tidy the types, and then export — newer builds offer a JSON destination, and on older builds you can save the query result and convert the file here. The route that works in every version is dumber and more reliable: File → Save As → CSV UTF-8 (the UTF-8 variant matters — the plain CSV option can mangle accented characters like José), then drop the saved file into the converter at the top of this page and download the .json. Google Sheets is the same story: File → Download → Comma Separated Values, then convert the download here.

Convert CSV to JSON in code

Sometimes the conversion belongs inside a program rather than a web page. In Python, the standard library does it in a few lines — csv.DictReader already understands quoting, so prefer it over splitting lines yourself:

# Python — standard library only
import csv, json

with open("data.csv", newline="", encoding="utf-8") as f:
    rows = list(csv.DictReader(f))

print(json.dumps(rows, indent=2, ensure_ascii=False))

In JavaScript, small inputs are often converted with a library such as Papa Parse, which implements the same quoting rules as this page. Whichever route you take, the lesson from the format rules above stands: never parse CSV with split(",") — the first quoted comma in real data will corrupt the output, usually silently.

Frequently asked questions

How do I convert a CSV file to JSON?

Click Upload a file (or drag the file onto the input box), and the JSON appears instantly — no Convert button and nothing is uploaded. You can also paste CSV text straight into the left-hand box. When the output looks right, use Copy or Download .json to save it as a file.

Why convert CSV to JSON?

JSON is the format web services, apps and APIs speak. CSV is a flat grid of rows and text; JSON keeps the same rows but gives every value a name and a type, nests naturally inside other data, and is what JavaScript — and most programming languages — read natively. Converting is usually the first step in feeding spreadsheet data to an API, a web app, a database import or a configuration file.

What is the difference between CSV and JSON?

CSV stores a table as plain text: one row per line, values separated by commas, everything a string, with quoting rules for values that contain commas or line breaks. JSON stores structured data as text too, but it names every field, distinguishes numbers, booleans and null from strings, and can nest objects and arrays. The same data usually takes a little more space as JSON and is far easier for software to consume correctly.

Is my CSV data uploaded or stored?

No. The converter runs entirely in your browser: files you open are read on your own device and never sent to a server, and this page stores nothing. That makes it safe for customer lists, exports and other data you would not paste into a stranger's server — you can even disconnect from the internet after the page loads and it will keep working.

Can I convert a CSV file that has no header row?

Yes. Untick “First row is a header” and every row — including the first — is treated as data, returned as an array of arrays. Nothing is eaten as a header. With the header option on, the first row supplies the object keys instead.

How do I convert CSV to JSON in Excel?

Excel cannot save JSON directly, but Power Query can: put your data in a table, open Data → From Table/Range, then in Power Query use Home → To JSON in newer Microsoft 365 builds; on older versions, export the query to a file and convert it here. The simpler route for most people is to save the sheet as CSV (File → Save As → CSV UTF-8) and drop the file into the converter above.

Related tools