JSON Formatter & Validator
Paste or drop JSON to validate, format, beautify or minify it — with line-numbered errors and one-click copy.
Your data stays in your browser. Nothing is uploaded or sent to a server.
How it works
This tool parses your input with the same JSON parser your browser uses. If the document is valid it is re-serialised with your chosen indentation; if it is invalid the parser's error is shown with the offending line highlighted so you can fix it quickly. Format beautifies, Minify removes all whitespace for compact transport, and Validate checks without reformatting.
What is valid JSON?
JSON is a strict subset of JavaScript object notation: keys must be double-quoted strings, strings cannot contain raw newlines, trailing commas are not allowed, and the only scalar values are strings, numbers, true, false and null. Comments are not permitted in JSON (use JSONC or JSON5 if you need them).
Common errors
- Trailing commas —
{"a": 1,}fails; remove the last comma. - Single quotes —
{'a': 1}is invalid; use double quotes. - Unquoted keys —
{a: 1}works in JS but not in JSON. - Undefined / functions — not representable; use
nullor strings.
FAQ
Is my JSON uploaded anywhere?
No. Formatting and validation run entirely in your browser with JavaScript. You can disconnect from the network and the tool still works.
Can I format large files?
Yes, within reason — everything is in-memory, so very large files (tens of MB) depend on your device. For most API responses and config files it is instant.
Does minifying change my data?
No. Minification only removes insignificant whitespace; keys, values and ordering are preserved.