CSV ↔ JSON Converter API

Convert CSV to JSON and JSON to CSV online. Handles quoted fields, Excel semicolon exports and ragged rows. Free, fast, no sign-up.

The CSV ↔ JSON Converter is also available as a free REST API. Send a POST request with a JSON body to https://dot.tools/api/tools/csv-json — no authentication, no API key, CORS enabled. Successful calls return { "ok": true, "result": { … } }; failures return HTTP 400 or 422 with an error body.

Request body

FieldTypeRequiredDescription
mode"csv-to-json" | "json-to-csv"requiredConversion direction: CSV to JSON, or JSON to CSV.
inputstringrequiredThe CSV or JSON text to convert (max 1 MB).
delimiter"," | ";" | "tab" | "auto"requiredField delimiter. "auto" sniffs the first 10 records when converting CSV to JSON, and resolves to a comma when converting JSON to CSV.
hasHeaderbooleanrequiredCSV → JSON only: treat the first row as object keys. When false, rows convert to arrays of strings.
indent"2" | "4"requiredCSV → JSON only: number of spaces per indentation level in the JSON output.

Response

FieldTypeRequiredDescription
outputstringrequiredThe converted document. Empty when the input is empty or invalid.
validbooleanrequiredWhether the input parsed successfully.
errorunknownrequiredParse error message when invalid.
errorLineunknownrequired1-based physical line of the parse error when invalid.
errorColumnunknownrequired1-based column of the parse error when invalid (JSON input only).

Example request

curl -X POST https://dot.tools/api/tools/csv-json \
  -H 'Content-Type: application/json' \
  -d '{
  "mode": "csv-to-json",
  "delimiter": "auto",
  "hasHeader": true,
  "indent": "2",
  "input": "name,role,level\nAda Lovelace,engineer,9\n\"Alan \"\"Al\"\" Turing\",researcher,10\nGrace Hopper,\"rear admiral, compiler pioneer\",10"
}'

Sample response

{
  "ok": true,
  "result": {
    "output": "[\n  {\n    \"name\": \"Ada Lovelace\",\n    \"role\": \"engineer\",\n    \"level\": \"9\"\n  },\n  {\n    \"name\": \"Alan \\\"Al\\\" Turing\",\n    \"role\": \"researcher\",\n    \"level\": \"10\"\n  },\n  {\n    \"name\": \"Grace Hopper\",\n    \"role\": \"rear admiral, compiler pioneer\",\n    \"level\": \"10\"\n  }\n]",
    "valid": true,
    "error": null,
    "errorLine": null,
    "errorColumn": null
  }
}

Use the free CSV ↔ JSON Converter in your browser, read the CSV ↔ JSON Converter guide, or import the full OpenAPI specification.