Convert CSV to JSON

Paste CSV and get JSON back. Free, no signup, and nothing you paste is stored. The same conversion is available as an API call and to AI agents over MCP.

Input

The CSV to convert.
Column separator. "auto" detects it from the first line.
The first row holds column names.
Turn numbers, true/false and blanks into typed values.
Spaces per level. 0 gives one compact line.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

How to convert CSV to JSON

  1. Paste your CSV into the input box.
  2. Press Run.
  3. Copy the JSON or download it as a file.

This page runs the csv to json tool. Open the tool itself for every option.

What happens in this conversion

What you get
A list with one object per row, using the first row as the keys.
Types
CSV values are all text. Numbers, true and false are recognised and converted, so "42" becomes 42. Values with leading zeros, such as postcodes, stay text. You can switch the conversion off.
Separators
Semicolons and tabs are detected as well as commas, which covers spreadsheets exported in European locales.

CSV and JSON compared

FormatWhat it isBest forWatch out for
CSV
CSV table
CSV is a plain table: one row per line, values separated by commas. Every spreadsheet and database reads and writes it.Tables moved between spreadsheets, databases and scripts.It is flat: one table, no nesting, and every value is text.
JSON
JSON data
JSON is the data format of web APIs: nested objects, lists, text, numbers, true, false and null.Apis and data exchanged between programs.It has no comments and is tiring to write by hand.

Use it from code or an agent

curl -s https://setget.net/v1/tools/csv-to-json \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"name,age\nSam,31\nAlex,27","indent":0}}'
import json, urllib.request

body = {'input': {'text': 'name,age\nSam,31\nAlex,27', 'indent': 0}}
request = urllib.request.Request("https://setget.net/v1/tools/csv-to-json", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/csv-to-json", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"name,age\nSam,31\nAlex,27","indent":0}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "csv-to-json",
  "input": {
    "text": "name,age\nSam,31\nAlex,27",
    "indent": 0
  }
}
{
  "input": {
    "text": "name,age\nSam,31\nAlex,27",
    "indent": 0
  }
}

Endpoint: POST /v1/tools/csv-to-json. Over MCP: run_tool with slug: "csv-to-json". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes The CSV to convert.
delimiter string no Column separator. "auto" detects it from the first line. One of: auto, comma, tab, semicolon, pipe. Default: "auto".
header boolean no The first row holds column names. Default: true.
infer_types boolean no Turn numbers, true/false and blanks into typed values. Default: true.
indent integer no Spaces per level. 0 gives one compact line. Default: 2. From 0 to 8.

Questions

Is my CSV stored anywhere?
No. It is converted in memory and discarded. It is not saved or logged.
How much CSV can I convert at once?
Up to 1 MiB in a single request.
Can a script or an AI agent convert CSV to JSON?
Yes. Call POST https://setget.net/v1/tools/csv-to-json with JSON, or use the run_tool tool of the SetGet MCP server with slug "csv-to-json". The code samples on this page are ready to copy.

More conversions