formatting

JSON Formatter API Reference

Paste raw or minified JSON and format it with configurable indentation, or minify it by removing all whitespace. Validates syntax, reports parse errors with line/column, and optionally sorts keys or repairs malformed JSON.

Endpoint

POST/api/json-formatter

Full URL: https://quickhelp.dev/api/json-formatter

Request

Content-Type: application/json. No authentication required for the anonymous free tier (30 req/min per IP).

FieldTypeRequiredDescription
jsonstringYesThe JSON string to format or minify
modedefaultNoOutput mode: pretty-print or minify
indentdefaultNoIndentation: 2 spaces, 4 spaces, or tab
sort_keysdefaultNoSort object keys alphabetically
repairdefaultNoAttempt to repair malformed JSON (trailing commas, single quotes, comments)

Response

Returns application/json. On error, returns a JSON object with an error string field and an appropriate HTTP status code.

FieldTypeDescription
outputstring
validboolean
erroroptional
error_lineoptional
error_columnoptional

Example

Pretty-print JSON

curl

curl -X POST https://quickhelp.dev/api/json-formatter \
  -H 'Content-Type: application/json' \
  -d '{"json":"{\"name\":\"Alice\",\"age\":30}","mode":"pretty","indent":2,"sort_keys":false,"repair":false}'

Request body

{
  "json": "{\"name\":\"Alice\",\"age\":30}",
  "mode": "pretty",
  "indent": 2,
  "sort_keys": false,
  "repair": false
}

Response

{
  "output": "{\n  \"name\": \"Alice\",\n  \"age\": 30\n}",
  "valid": true
}

Error codes

StatusMeaning
200Success — result in response body
400Bad request — invalid input; error field describes the problem
404Tool not found
429Rate limit exceeded (30 req/min anonymous, 300 req/min free key)
500Internal server error — transient; retry with exponential back-off

OpenAPI spec

The full OpenAPI 3.1 specification for all tools is available at /openapi.json. Import it into Postman, Insomnia, or any OpenAPI-compatible client to get all endpoints with schema validation automatically.

We use cookies to serve ads and measure traffic. Cookie policy · Privacy policy