Validation, formatting and these structure counts are computed entirely in your browser — your JSON never leaves the page, so it is safe to paste config, API responses or anything sensitive.
How to format and validate JSON
Paste your JSON on the left. Choose Beautify to indent it (2 spaces, 4 spaces or a tab) or Minify to collapse it to one line. The result and a validity check update as you type; if there is a mistake, you get the message plus the exact line and column so you can jump straight to it. Tick Sort keys to order object keys alphabetically — handy for diffing two payloads.
Why valid JSON matters
JSON drives almost every modern API, infrastructure-as-code template and app config. A single trailing comma or unquoted key breaks a deploy or a webhook. The structure panel shows nesting depth and object/array/key counts so you can sanity-check that a response really contains what you expect before wiring it into code.
🔐 Safe for sensitive payloads: formatting runs entirely in your browser. Building APIs, integrations or automation? Servnet has helped UK businesses since 2001.
JSON formatting — common questions
What does a JSON formatter do?
It re-indents (“beautifies”) JSON so nested objects and arrays are readable, or minifies it to a single line to save bytes. It also validates the JSON as you type and points to the first syntax error, so you can fix malformed API responses or config quickly.
How do I fix a JSON syntax error?
When the input is invalid, this tool shows the error message plus the line and column of the first problem. The usual culprits are trailing commas, missing quotes around keys, single quotes instead of double quotes, and unclosed brackets or braces.
What is the difference between beautify and minify?
Beautify adds indentation and line breaks for humans (choose 2 spaces, 4 spaces or a tab). Minify strips every optional space and newline for machines and transport. Both produce identical data — only the whitespace differs.
Does "sort keys" change my data?
No. Sorting only reorders object keys alphabetically for easier diffing and comparison; values, arrays (which stay ordered) and the data itself are unchanged.
Is there a size limit?
Processing happens in your browser, so very large documents depend on your device’s memory. Typical API responses and config files of a few megabytes format instantly.
Is my JSON sent to a server?
No. Validation and formatting run entirely client-side in JavaScript, so you can safely paste configuration, tokens or API payloads — nothing leaves the page.