x402AgentTools

{ }JSON Formatter / Validator

Validate JSON with precise error messages, pretty-print it with any indent, and inspect its top-level type and element counts.

Worked examples

Compact object → pretty

GET /api/v1/dev/json-formatter?json=%7B%22name%22%3A%22Ada%22%2C%22langs%22%3A%5B%22ts%22%2C%22py%22%5D%2C%22active%22%3Atrue%7D&indent=2

Result: { "name": "Ada", "langs": [ "ts", "py" ], "active": true }

Array of numbers

GET /api/v1/dev/json-formatter?json=%5B1%2C2%2C3%5D&indent=2

Result: [ 1, 2, 3 ]

Nested structure

GET /api/v1/dev/json-formatter?json=%7B%22user%22%3A%7B%22id%22%3A7%2C%22tags%22%3A%5B%22a%22%2C%22b%22%5D%7D%7D&indent=4

Result: { "user": { "id": 7, "tags": [ "a", "b" ] } }

Machine API (x402)

$0.001 / call

This tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol — no accounts, no API keys.

GET /api/v1/dev/json-formatter?json=%7B%22name%22%3A%22Ada%22%2C%22langs%22%3A%5B%22ts%22%2C%22py%22%5D%2C%22active%22%3Atrue%7D&indent=2 HTTP/1.1
Host: agenttools-hub.vercel.app

→ 402 (payment required, instructions in headers)
→ 200 (after X-PAYMENT header; JSON body below)

{
  "tool": "dev/json-formatter",
  "input": {"json":"{\"name\":\"Ada\",\"langs\":[\"ts\",\"py\"],\"active\":true}","indent":2},
  "result": { "value": null, "answer": "{
  "name": "Ada",
  "langs": [
    "ts",
    "py"
  ],
  "active": true
}" }
}

Agent docs: /llms.txt · OpenAPI spec · integration guide

About this tool

Paste JSON to validate it, pretty-print it with your preferred indent, and see its shape — top-level type, key counts and size before and after formatting. Parse errors are surfaced with their position so you can fix them fast.

JSON.parse(text) → value · JSON.stringify(value, null, indent) → formatted text

Frequently asked questions

What are the most common JSON errors?

Trailing commas, single quotes instead of double quotes, unquoted keys, and comments (JSON has none). The error message pinpoints the position.

Is my data stored anywhere?

No. Formatting is a pure function executed in the request; nothing is logged or persisted.

Related tools