JSON Formatter, Validator & Beautifier

Paste any JSON to pretty-print, minify or validate it. Errors are highlighted with the position of the problem. Indent with 2 or 4 spaces or tabs. Runs entirely in your browser.

JSON is parsed in your browser. Nothing uploaded.

What does a JSON formatter do?

JSON (JavaScript Object Notation) is the de facto data-exchange format of the modern web. Every REST API, every config file, every webhook payload, every npm package manifest — all JSON. But raw JSON, especially when minified by an API for transmission speed, is unreadable: one long line of nested braces and quotes. A formatter "pretty-prints" it: each property on its own line, nested objects indented, easy to scan with the eye.

This tool does three things: format (turn ugly JSON into pretty JSON), minify (turn pretty JSON into compact one-line JSON — useful for embedding in code, copy-pasting into config files, or reducing payload size), and validate (check that the input is valid JSON and report exactly where any error is).

Why validation matters

JSON is strict: missing comma, trailing comma, single quotes instead of double quotes, comments, or any of a dozen other mistakes will break parsing. Worse, native parsers (in JavaScript, Python, every language) often give terse error messages — "Unexpected token at position 247" — that don't show you the offending line. This validator gives you the parser's verbatim error message along with a copy of the input so you can scan for the problem.

Common JSON mistakes and how to spot them

Format vs. minify — when to use each

Format (beautify) when you're reading JSON yourself — debugging an API response, inspecting a config, exploring data. The extra whitespace makes the structure obvious at a glance.

Minify when JSON is going over a network, into a database, or pasted into code as a literal. Minified JSON is the same data with all unnecessary whitespace removed; it's smaller (sometimes 30–50% smaller for nested data) and faster to transmit. Production API responses are almost always minified.

Indent levels

Whichever you pick, be consistent within a project. Mixed indentation makes diffs noisy and reviews painful.

Privacy — why browser-side matters for JSON

JSON often contains sensitive data: API tokens, OAuth refresh tokens, customer PII, healthcare records, internal IDs. Pasting that into a server-based formatter hands it to a third party with whatever data-retention practices they may or may not honour. Browser-side parsing — what this tool does — means the JSON never leaves your machine. You can verify with DevTools → Network: no upload request is made.

Tips and best practice

FAQs about JSON formatting

Is anything uploaded to a server?

No. The JSON is parsed in your browser using JSON.parse and re-serialised with JSON.stringify.

Does it support JSON5 (with comments)?

No — standard JSON only. Remove comments and trailing commas first.

Why does minified JSON look slightly different from the source?

The parser canonicalises whitespace, escape sequences and number formatting. The data is identical; the bytes change.

Can I get sorted keys?

Not in this tool — sort keys with a script before formatting if you need it.

What's the maximum JSON size?

Practical limit ~10 MB. Beyond that, browser memory becomes the constraint.

Related JSON tools