CSV to JSON Converter - Turn Spreadsheets into JSON Online (Free)

Convert CSV to JSON instantly in your browser. Paste any CSV, pick your delimiter, and get a clean JSON array of objects. Free, private, no upload needed.

Tool options

Mode

Delimiter

Nested objects

Input
303 chars · 1 lines · 303 bytes
Output

Turn Any CSV Into a JSON Array in Seconds

Paste your CSV data above and get a clean JSON array of objects instantly. Every column header becomes a key, every row becomes an object — no signup, no upload, nothing sent to a server.

How to Convert CSV to JSON

  1. Paste your CSV into the input box (or upload a .csv file).
  2. Pick your delimiter — comma, semicolon, tab, or pipe. The tool auto-detects in most cases.
  3. Click Convert and your JSON appears instantly in the output panel.
  4. Copy or download the result with one click.

Worked Example: CSV to JSON

Say you have a small CSV export from a spreadsheet or database:

name,age,city
Alice,30,New York
Bob,25,London

Paste that in and the converter produces this JSON array:

[
  { "name": "Alice", "age": "30", "city": "New York" },
  { "name": "Bob", "age": "25", "city": "London" }
]

Each header row column maps to a key, and each data row maps to one object. Quoted fields with embedded commas or line breaks are handled correctly — for example, "Smith, John" stays as one value, not split at the comma.

Quick Snippet-Bait: What the Conversion Looks Like

Here is the exact mapping at a glance:

CSV rowJSON result
Header rowObject keys
Data row 1First object in the array
Data row 2Second object in the array
Quoted field: "New York"String value with no extra escaping
Custom delimiter: ; or |Works the same — just select it in the options

Your data never leaves your browser. The conversion runs entirely in client-side JavaScript — nothing is uploaded to any server.

How to Do This in Python and JavaScript

Need to automate the same conversion in your own code? Here are the most common one-liners.

Python

import csv, json

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

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

csv.DictReader uses the first row as keys automatically. The result is a list of dictionaries — identical to the JSON array this tool produces.

JavaScript (Node.js, using the built-in fs module)

const fs = require('fs');

const text = fs.readFileSync('data.csv', 'utf8');
const [headerLine, ...dataLines] = text.trim().split('\n');
const headers = headerLine.split(',');

const json = dataLines.map(line => {
  const values = line.split(',');
  return Object.fromEntries(headers.map((h, i) => [h.trim(), values[i]?.trim()]));
});

console.log(JSON.stringify(json, null, 2));

This minimal snippet works for simple CSVs. For files with quoted fields or embedded commas, use a library like Papa Parse — it handles edge cases the same way this tool does.

How It Works Under the Hood

The converter parses your CSV according to RFC 4180, the widely-followed specification for comma-separated values. It reads the first row as field names (the JSON keys), then walks each subsequent row, pairing each value with its matching header.

Quoted fields — anything wrapped in double quotes — are treated as a single value even if they contain commas, newlines, or quote characters. The output is a JSON array of objects, the format expected by most REST APIs, JavaScript frontends, and data-processing tools.

Type coercion (turning "30" into the number 30) is optional and off by default, so your data comes out exactly as it appears in the CSV.

When to Use This Tool (and When Not To)

Good fits

  • Converting a spreadsheet export to feed a web API or JavaScript app.
  • Quickly previewing what a CSV looks like as structured data.
  • One-off conversions where writing a script would be overkill.
  • Transforming tab-separated or pipe-delimited exports from databases or BI tools.

Think twice if…

  • Your file is very large (hundreds of MB). Browser memory has limits; for giant files a server-side script or command-line tool is faster.
  • You need nested JSON. CSV is flat by nature — it cannot represent arrays-within-objects or multi-level nesting. You would need to transform the flat output afterward.
  • You want to go the other way. If you need to turn JSON back into a spreadsheet-friendly format, the JSON to CSV Converter handles that in one step.

Bottom line: if you have a CSV and need JSON right now, paste it in above and you are done in seconds.

Frequently asked questions

Is my CSV data uploaded to your servers?+
No. The conversion runs entirely inside your browser using JavaScript. Your data is never sent to any server, so sensitive or private files stay completely on your machine.
Does the tool handle semicolon, tab, or pipe-delimited files?+
Yes. You can choose comma, semicolon, tab, or pipe as the delimiter before converting. The tool also tries to auto-detect the right one if you leave it on automatic.
What happens if a field contains a comma or a line break?+
Quoted fields are handled correctly. If your CSV wraps a value in double quotes — for example "Smith, John" — the converter treats everything inside the quotes as a single value and does not split at the comma.
How do I convert CSV to JSON in Python?+
Use the built-in csv.DictReader: import csv, json; rows = list(csv.DictReader(open('data.csv'))); print(json.dumps(rows, indent=2)). No third-party packages needed for simple files.
How do I convert CSV to JSON in JavaScript?+
For quick scripts, split on newlines and commas manually. For production code with quoted fields and edge cases, use the Papa Parse library (Papa.parse(csvString, { header: true })) — it returns the same array-of-objects format this tool produces.
Can I convert CSV to JSON in VS Code?+
Yes — install the 'Excel to JSON' or 'CSV to JSON' VS Code extension from the Marketplace, or simply paste your CSV here and copy the result into your project file. The browser tool is usually faster for a quick conversion.
Are numbers and booleans converted automatically, or do they stay as strings?+
By default, all values come out as strings (exactly as they appear in the CSV). Turn on the 'auto-detect types' option if you want numbers like 30 to appear as JSON numbers rather than "30".
What is the difference between a CSV to JSON converter and a JSON to CSV converter?+
They go in opposite directions. This tool turns a flat spreadsheet-style CSV file into a JSON array of objects. If you already have JSON and need a spreadsheet or database import file, use the JSON to CSV Converter instead.