Data tool

CSV to JSON Converter

Paste CSV data with a header row and turn it into a JSON array.

Runs in your browser. No upload.

The first row becomes the JSON keys.

About this tool

CSV to JSON Converter made simple.

Quoted commas, line breaks and escaped quotes are handled locally for common spreadsheet exports.

Guide

Using CSV to JSON Converter

This page turns pasted CSV text into a JSON list. The first row is used as the names of the fields, and every other row becomes one object in the list. It reads commas as separators and understands double-quoted cells that contain commas, line breaks or quotes. It does not open files, guess numbers or dates, or accept semicolon or tab separators, so every value in the result is a text string.

How to use it

  1. Paste your CSV into the CSV data box. Put the column names in the first row and at least one row of data under it.
  2. Press Convert to JSON. The JSON appears in the result box, with two spaces of indent, and a message says how many rows were converted.
  3. Press Copy result to copy the JSON. If you see an error, read the message and fix the CSV. Press Clear to empty both boxes.

Worked examples

A plain table

You enter
Csv
name,age,city Ada,36,London Bob,41,Paris
You get
Json
Name: Ada; Age: 36; City: London; Name: Bob; Age: 41; City: Paris

Two data rows give two objects. The age is written as the text "36" inside quotes, not as the number 36, because the tool never changes a value's type.

Run through the tool’s own code.

Quotes, a comma and a line break inside cells

You enter
Csv
name,note "Smith, Jo","said ""hi""" Lee,"line one line two"
You get
Json
Name: Smith, Jo; Note: said "hi"; Name: Lee; Note: line one line two

A cell wrapped in double quotes may hold a comma, and a pair of double quotes inside it stands for one quote mark. A line break inside quotes stays in the value and shows as \n in the JSON.

Run through the tool’s own code.

Repeated and missing headings

You enter
Csv
a,a, 1,2,3
You get
Json
A: 1; A 2: 2; Column 3: 3

The second a is renamed a_2 so no value is lost, and the empty third heading is named column_3. A row shorter than the heading row would fill the missing fields with empty text.

Run through the tool’s own code.

When it helps

  • Turn a small spreadsheet export into JSON to use in a script or a mock API.
  • Prepare test data for a web page from a list typed in a spreadsheet.
  • Check how quoted cells and embedded commas are read before sending data to another system.
  • Convert a short list of settings kept as CSV into a JSON file for an app.

Limits to keep in mind

  • Only the comma is read as a separator. A semicolon file such as 'name;age' produces a single field with the whole line as its name.
  • Every value stays text. Numbers, true, false and empty cells are not converted, and text like 007 keeps its leading zeros.
  • Extra cells in a row that has more cells than the heading row are dropped without a warning, and blank lines are skipped.
  • The code sets no size limit for pasted text. A very large paste can make the page slow, so use another tool for large files.

Tips

  • If your file uses semicolons or tabs, change the separators to commas in a text editor before pasting.
  • Keep your original CSV, because the tool only shows the JSON and does not change what you pasted.
  • Scan the JSON for a field named with a column_ prefix, since that means a heading was empty.

Sources

Common questions

About CSV to JSON Converter.

How do I convert CSV to JSON?

Paste the CSV with column names in its first row, then press Convert to JSON. Each following row becomes one object whose keys are the column names, and all the objects are collected into one list.

Are commas inside quoted cells supported?

Yes. A cell in double quotes can contain commas, line breaks and doubled quote marks. The tool treats a quote as the start of a quoted cell only when it is the first character of that cell; a quote in the middle of plain text is kept as ordinary text.

Why are my numbers shown in quotes?

The tool keeps every value as the exact text from the CSV. It does not decide whether something is a number, a date or a yes or no. If you need numbers, change the types in a script after copying the JSON.

What happens if a quote is not closed?

The tool stops and shows an error that a quoted field was not closed, and the result box stays empty. Fix the quotes in the CSV, for example by adding the missing closing quote, and press Convert to JSON again.

Can I upload a CSV file?

This page has a text box only, so you paste the CSV rather than choose a file. For files, use a tool that has a file picker. Pasted text is converted in your browser and is not sent to a server.

What if two columns have the same name?

The tool keeps both by renaming the later ones with a number, for example a and a_2. Empty headings get names like column_3. This avoids losing data, but you may want to rename the keys afterwards.

Are commas inside quoted CSV fields supported?

Yes. Common quoted commas, line breaks and escaped quotes are handled in the browser.