JSON Formatter & Validator

Beautify, minify, and validate JSON - runs entirely in your browser.

Stays in your browser · Always free

This free JSON formatter and validator lets you beautify minified JSON, minify large JSON for production, and validate JSON syntax to catch errors before they reach your app. Everything runs in the browser - nothing leaves your machine.

Common uses:

Output

JSON is the lingua franca of modern APIs and config files - but it arrives, more often than not, as one long unindented line that's impossible to scan. This tool beautifies, minifies, or validates JSON entirely in your browser. Paste in a payload, click Beautify, and read it like a normal nested structure. If the JSON is invalid, the validator points at the exact location of the syntax error.

What "format JSON" actually means

JSON is a strict text format, but the spec is silent on whitespace inside the document - {"a":1,"b":2} and the same object spread across 5 indented lines are identical to a parser. The reason "format" matters is purely human readability.

Beautify re-emits the JSON with consistent indentation (2 spaces, line breaks after each comma at depth) so a long nested object becomes scannable.

Minify does the opposite - strips every byte of optional whitespace so the JSON is as small as possible. Useful for production payloads where bandwidth matters or for embedding JSON inside other formats.

Validate just runs the JSON through a strict parser and reports either "valid" or the location of the first parse error. Useful when an API call is failing for unknown reasons or when you've hand-edited a config file.

Common JSON gotchas

Trailing commas are not allowed. [1, 2, 3,] and {"a": 1,} are valid in JavaScript and most modern languages, but JSON requires no trailing comma. This is the single most common parse error.

Strings must use double quotes. {'name': 'value'} is invalid JSON - single quotes won't parse. Same applies to keys.

Keys must be quoted. {name: "value"} is JavaScript object literal syntax, not JSON. The key needs double quotes too.

No comments. Strict JSON has no comment syntax. // and /* */ will both fail. JSON5 and JSONC support comments but most tooling doesn't accept them by default.

Numbers can't have leading zeros (other than 0 itself), and NaN and Infinity are not valid JSON values.

Encoding matters. JSON is officially UTF-8. If you're getting weird characters when parsing, check the encoding of the source file - Windows tools sometimes save as UTF-16 with a BOM.

Frequently asked questions
How do I format JSON?
Paste your JSON into the input box and click Beautify. The tool re-formats it with 2-space indentation and line breaks, making it scannable.
What does the JSON validator check?
It runs the input through the browser's strict JSON parser. If parsing succeeds, the JSON is valid. If it fails, the parser's error message - typically including the character position of the problem - is shown.
Can I minify JSON?
Yes. Click Minify to strip all optional whitespace. The resulting string is byte-equivalent for all parsers but as small as possible - useful for production payloads.
What is the difference between beautify and minify?
Beautify adds consistent indentation and line breaks so the JSON is human-readable. Minify removes all whitespace to produce the smallest possible string for transmission or storage.
Why does my JSON show a parse error?
Most common causes: trailing commas, single quotes instead of double, unquoted keys, missing commas between items, or stray characters before the first { or [ (BOM bytes, JSONP padding). The error message indicates roughly where the parser gave up.
Does this support JSON5 or JSONC (JSON with Comments)?
No. The validator follows strict RFC 8259 JSON. If you're authoring config files in JSON5/JSONC syntax (with comments and trailing commas), you'll need a JSON5-aware parser instead.
Does this tool send my JSON anywhere?
No. All formatting and validation runs in your browser via JSON.parse and JSON.stringify. Open DevTools → Network and confirm: nothing is transmitted. Safe for inspecting responses that contain real customer data.
What's the maximum size of JSON I can paste?
Browser-bound. Modern browsers comfortably handle a few MB of JSON in a textarea. For multi-megabyte payloads consider a desktop tool or a CLI like jq - the browser becomes sluggish well before it crashes.
Why does my pretty-printed JSON look different from another tool's?
Most tools use 2-space or 4-space indentation; some use tabs. The output is semantically equivalent - any JSON parser produces the same in-memory object regardless of formatting.