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
| Field | Type | Required | Description |
|---|---|---|---|
mode | "csv-to-json" | "json-to-csv" | required | Conversion direction: CSV to JSON, or JSON to CSV. |
input | string | required | The CSV or JSON text to convert (max 1 MB). |
delimiter | "," | ";" | "tab" | "auto" | required | Field delimiter. "auto" sniffs the first 10 records when converting CSV to JSON, and resolves to a comma when converting JSON to CSV. |
hasHeader | boolean | required | CSV → JSON only: treat the first row as object keys. When false, rows convert to arrays of strings. |
indent | "2" | "4" | required | CSV → JSON only: number of spaces per indentation level in the JSON output. |
Response
| Field | Type | Required | Description |
|---|---|---|---|
output | string | required | The converted document. Empty when the input is empty or invalid. |
valid | boolean | required | Whether the input parsed successfully. |
error | unknown | required | Parse error message when invalid. |
errorLine | unknown | required | 1-based physical line of the parse error when invalid. |
errorColumn | unknown | required | 1-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.