Csv To Json

Convert CSV spreadsheet data into structured JSON, turning rows into objects with named fields. No signup. Ideal for developers, APIs and moving data into code.

Remove Ads
Remove Ads

Result

JSON
Remove Ads

Share on Social Media:

A CSV to JSON converter turns spreadsheet rows into structured JSON you can use in code or send to an API. Paste your CSV, click Convert to JSON, and you get an array of objects — one object per row, with the column headers as the keys. It is free, needs no account, and runs entirely in your browser, so nothing you paste is uploaded.

On this page

  1. How to Convert CSV to JSON Step by Step
  2. What CSV and JSON Are and Why Convert
  3. Worked Example
  4. CSV Versus JSON as Data Formats
  5. Who Needs to Convert CSV to JSON
  6. Pro Tips for Clean CSV to JSON Conversion
  7. Common CSV to JSON Mistakes to Avoid
  8. Related Tools You May Need Next
  9. Frequently Asked Questions

How to Convert CSV to JSON Step by Step

  1. Paste your CSV data. Drop it into the box above. The first row must be the header row with the column names, followed by one record per line.
  2. Check the header row. The headers become the keys in every JSON object, so make sure the first row has clear, correct, unique column names.
  3. Click Convert to JSON. The tool reads the CSV and produces an array of objects, one per data row, indented with two spaces.
  4. Check the output. Each object has the same field names as your headers, in the same order as your columns.
  5. Copy the JSON. Use Copy to Clipboard, then paste it into your code, API request, or config file. There is no download button — copy is the way to take the result with you.

Flat illustration of a spreadsheet turning into a JSON document

What CSV and JSON Are and Why Convert

CSV (comma-separated values) is the language of spreadsheets: a flat table of rows and columns, easy for humans to read. JSON (JavaScript Object Notation) is the language of web apps and APIs: structured data with named fields that code can parse directly. Converting CSV to JSON bridges the two — you take data that lives in a spreadsheet and put it into the shape code expects, with each row becoming an object whose keys are the column names.

Worked Example

Paste this (the tool's own placeholder example):

LineCSV line
1name,age,city
2Alice,30,London
3Bob,25,Paris

Click Convert to JSON and you get exactly this:

LineJSON line
1[
2{
3"name": "Alice",
4"age": "30",
5"city": "London"
6},
7{
8"name": "Bob",
9"age": "25",
10"city": "Paris"
11}
12]

Three things to notice: every value is a string, even the numbers ("30", not 30); the output is indented with two spaces; and there is one object per data row, in the same order as the CSV.

A second example — a value that itself contains a comma. Paste name,note then Alice,"Lives in London, UK" and the quotes protect the comma, giving {"name": "Alice", "note": "Lives in London, UK"}. Without the quotes, Alice,Lives in London, UK would split into three fields and the extra value would be dropped. An empty cell becomes an empty string: Alice,,London gives "age": "".

CSV Versus JSON as Data Formats

AspectCSVJSON
ShapeFlat table of rows and columnsStructured, keyed objects (and arrays)
Best forSpreadsheets, simple exportsCode, APIs, configuration
Field namesOnly in the first row, if presentEvery object carries its own keys
Nested dataNot supportedHandles naturally
Numbers and true/falseJust textReal numbers and booleans — but note this tool outputs all values as strings
Human readingEasy to scan in a spreadsheetEasy to read once formatted

Who Needs to Convert CSV to JSON

Developers. Turning spreadsheet data into JSON for an app, a test fixture, or a config file.

API users. Sending tabular data to an API that only accepts JSON request bodies.

Data analysts. Moving an export out of a spreadsheet and into a tool that reads JSON.

Students. Learning how tabular data maps onto structured objects, one row at a time.

No-code and automation users. Feeding rows into a workflow, a webhook, or a database import that expects JSON.

Laptop showing a spreadsheet converting to JSON objects

Pro Tips for Clean CSV to JSON Conversion

Keep the header row clean. Headers become your JSON keys: short, unique, no typos, no duplicates. A duplicate header silently loses the earlier value.

Quote values that contain commas. "Lives in London, UK" stays one field; without the quotes it splits and the extra piece is dropped.

Keep every record on one line. A quoted field that spans two lines breaks this tool — it splits the field into a bogus extra object. Replace line breaks inside a field before pasting.

Match your column counts. A row with more values than the header row loses the extras silently; a short row gets empty strings for the missing fields.

Expect strings, not numbers. "30" is a string in the output. If your code needs real numbers, convert the fields after pasting (for example, Number(obj.age) in JavaScript).

Validate the result. Paste the output into the JSON Validator to confirm it is valid JSON before you send it to an API.

Trim stray spaces first. Headers are trimmed for you, but values are not — " Alice " stays " Alice ". Clean the spreadsheet before copying.

Common CSV to JSON Mistakes to Avoid

Using semicolons or tabs as separators. This tool only splits on commas. A semicolon-separated file produces one-field objects like {"name;age": "Alice;30"} — re-export with commas first.

Forgetting the header row. The first row always becomes the keys. If your data has no header row, the first record's values become the keys and that row disappears from the output.

Pasting a header row only. With no data rows the tool shows "Invalid Input" and produces nothing — you need at least one data row.

Using single quotes to protect commas. 'hello, world' does not work here — only double quotes protect a comma. Single quotes are treated as ordinary characters and the value still splits.

Expecting numbers or nulls. Empty cells become "", never null, and numbers stay strings. Do not write code that expects 30 or null from this output.

Assuming nested data. CSV is flat, so the output is flat objects — one level, no nesting. If your data is inherently nested, a flat conversion will not build that structure for you.

Related Tools You May Need Next

JSON to CSV. Reverse the conversion, back to spreadsheet rows.

JSON Validator. Check the converted output is valid JSON.

JSON Formatter. Reformat the output with different indentation.

JSON Minify. Compact the JSON for sending over the wire.

JSON Viewer. View the result as a collapsible tree.

CSV to HTML Table. Turn the same CSV into an HTML table for a web page.

CSV to Markdown Table. Turn the same CSV into a Markdown table.

JSON to XML. Convert the JSON onward into XML.

3D illustration of a spreadsheet turning into a tree of JSON objects

Frequently Asked Questions

How do I convert CSV to JSON?

Paste your CSV into the box, with the first row as the header row, and click Convert to JSON. You get an array of objects, one per row, ready to copy.

Does the first row have to be the header row?

Yes. The first row always becomes the keys of every JSON object, and there is no option to turn that off. If your CSV has no headers, add a header row first.

What does the JSON output look like?

An array of objects, indented with two spaces. Each object has one field per column, named after the header, and the values are all strings — including numbers.

What happens if a value contains a comma?

Put it in double quotes, like "Lives in London, UK". The quotes protect the comma. Without them the value splits and the extra piece is dropped.

Can I upload a CSV file?

No. This tool is paste-only — there is no file upload. Open the file in a spreadsheet or text editor, copy the rows, and paste them in.

Does it work with semicolons or tabs?

No. Only commas separate fields. A semicolon- or tab-separated file produces wrong one-field objects, so re-export it with commas first.

Are numbers converted to real JSON numbers?

No. Every value comes out as a string ("30", "9.99", "true"). Convert them in your code if you need real numbers or booleans.

What happens to empty cells?

They become empty strings (""), never null. A short row is padded with empty strings for the missing fields.

Is my data uploaded anywhere?

No. The conversion runs entirely in your browser with JavaScript, so nothing you paste leaves your device. There is no account and no sign-up.

Can it handle a field that spans two lines?

No — not reliably. A quoted field containing a line break is split into a bogus extra object. Keep every record on a single line before pasting.