CSV to JSON

Convert CSV data to JSON format (array of objects).

About CSV to JSON

Front-end mocks, configuration files and API tests usually want JSON, while the data you have sits in a CSV export. This converter reads the header row as the list of keys and turns every following line into a JSON object, producing a pretty-printed array you can paste directly into code or a request body.

Paste the CSV, click Convert and the JSON appears on the right, ready to copy or download as data.json. The conversion runs in the browser: no upload, no account and no size limit beyond your device's memory.

How to use CSV to JSON step by step

  1. Paste the CSV into the left text area. The first line must contain the column names.
  2. Click "Convert to JSON". The result appears in the right box, indented with two spaces.
  3. Use "Copy" to put the JSON on the clipboard or "Download" to save it as data.json.

Input and output example

Input

id,name,city
1,Ana,Madrid
2,Luis,Sevilla

Output

[
  {
    "id": "1",
    "name": "Ana",
    "city": "Madrid"
  },
  {
    "id": "2",
    "name": "Luis",
    "city": "Sevilla"
  }
]

Why use our CSV to JSON?

Common use cases

Limits and tips

Frequently asked questions

Why are my numbers wrapped in quotes in the JSON?

CSV has no data types, so every cell is text. This tool keeps that behaviour and writes each value as a JSON string. If your consumer needs numbers or booleans, convert them after loading the JSON, for example with Number() in JavaScript or int() in Python.

What format does the output have?

A JSON array where each element is an object. The object keys are the header names from the first CSV line and the values are the cells of that row, in the same order. The output is indented with two spaces so it is easy to read and to diff.

Can I convert a CSV that uses semicolons?

Not directly: the parser only splits on commas. Convert the file to comma-separated values first with the CSV to Delimited tool, or use the CSV Viewer and Editor to paste the data and download it with commas.

What is the difference between CSV and JSON?

CSV is a plain table: rows of values separated by a delimiter, no types and no nesting, ideal for spreadsheets. JSON represents objects and arrays with typed values and can be nested, which is why APIs and JavaScript applications prefer it. CSV is smaller; JSON is self-describing.

Is my data sent to a server?

No. The text you paste is parsed by JavaScript in your browser and never leaves the page. You can even use the tool offline once the page has loaded.

Related guides

Related tools

Other free utilities you may find useful

Available languages