Illustration of curly braces representing JSON, aligned indented lines for formatting, a checkmark for validation, and compressed arrows for minifying

JSON Formatter / Validator / Minifier

Paste JSON below. Everything happens in your browser — nothing is ever uploaded, which matters since pasted JSON is often an API response, a config file, or something with tokens in it.


ℹ️ What each button does
  • Format — re-indents valid JSON using the chosen indent (2 spaces, 4 spaces, or a tab), optionally sorting object keys alphabetically.
  • Minify — strips all whitespace down to the smallest valid representation, same content.
  • Validate only — checks the JSON without changing it, reporting the exact line and column of the first problem found, when the browser's error message includes a position.
  • Uses the browser's native JSON.parse/JSON.stringify on this page — no server call, no upload, no logging of what you paste. The JSON API below is a separate, opt-in endpoint for scripts.
💻 Show API usage examples (cURL)
curl -sS "https://devops.majbase.com/json-tool/api" \
    --data-urlencode 'json={"b":1,"a":2}' \
    --data-urlencode 'action=format' \
    --data-urlencode 'indent=2' \
    --data-urlencode 'sort_keys=true'

Returns {"valid": true, "result": "{\n \"a\": 2,\n \"b\": 1\n}"}. Use action=minify for compact output, or action=validate to just check it — either returns {"valid": false, "error": "..."} on invalid JSON instead.

🤖 Use this API as a Claude Skill

Want an AI agent (Claude Code, claude.ai, or anything else that supports the Agent Skills format) to use this tool for you on request? Download the skill below and add it:

⬇️ Download SKILL.md · View raw