JSON Formatter & Validator
Format, beautify, minify and validate JSON with instant error reporting.
Runs entirely in your browser — your input never leaves your deviceAbout this tool
Paste any JSON and this tool re-parses it with the browser's native engine to pretty-print it with two-space indentation, minify it to a single line, or surface the exact syntax error when something is off. Because it uses a real parser rather than a regex, the “valid” badge means the JSON is genuinely well-formed.
It is handy for inspecting API responses, cleaning up config files, and shrinking JSON before embedding it. Everything runs locally — your payload is never sent to a server, so it is safe for tokens, internal responses and sensitive data.
Format vs minify
Format (beautify) adds line breaks and two-space indentation so a payload is easy to read and diff. Minify strips every optional character to produce the smallest valid JSON — useful for embedding a config in code or reducing what you send over the wire. Both produce identical data; only the whitespace differs.
Common errors it catches
- Trailing commas — valid in JavaScript objects, but not in JSON.
- Single quotes — JSON strings and keys must use double quotes.
- Unquoted keys —
{name: "x"}is invalid; it must be{"name": "x"}. - Stray comments — standard JSON does not allow
//or/* */.
Worked example
Paste {"id":1,"tags":["a","b"],"ok":true} and Format returns it across multiple indented lines; Minify collapses an indented file back to a single compact line. If you change true to True, the validator immediately flags it, because JSON booleans are lowercase.
Once your JSON is valid, turn it into types with JSON to TypeScript.
Why use it
Real parser, real validation
Uses the native JSON engine, so the valid badge means genuinely well-formed JSON, with the exact error otherwise.
Format or minify
Pretty-print with two-space indentation or strip to a single compact line.
Private
Runs entirely in your browser — safe for tokens and internal API payloads.
Common use cases
- Inspect and tidy an API response
- Validate JSON before pasting it into code
- Minify JSON for storage or transport
- Spot a stray comma breaking a config file
Frequently asked questions
Is my JSON uploaded anywhere?
No. Parsing and formatting happen entirely in your browser with the native JSON engine. Nothing you paste is sent to a server.
Why does it say my JSON is invalid?
The error message comes straight from the JSON parser and usually points at the problem — a trailing comma, a single quote instead of double quotes, or an unquoted key are the most common causes.
What is the difference between format and minify?
Format adds line breaks and two-space indentation for readability; minify strips all whitespace to produce the smallest valid JSON for storage or transport.
Is there a size limit?
There is no server limit since nothing is uploaded. Very large documents depend only on your device's available memory.