NordVPN
SponsoredStrict no-logs VPN with 6,400+ servers in 111 countries. Threat Protection blocks ads, trackers, and malware while you work online.
Get NordVPN →Paste any JSON to format with 2/4/8 spaces of indentation, or minify to a single line. Invalid JSON shows a parse error so you can find the issue quickly.
{
"hello": "world",
"items": [
1,
2,
3
]
}JSON is a strict format — every quote, comma, and bracket has to be in the right place. Browsers and APIs return cryptic 'Unexpected token' messages when something is off, and the issue is often invisible at a glance. This formatter parses the input with the browser's native JSON parser, then re-serializes it pretty (with indent) or minified (no whitespace).
If parsing fails, you get the underlying error directly — usually with the position of the bad character. From there, you can find the missing comma, unescaped quote, or trailing comma quickly.
Format with indent: the standard way to read JSON. 2 spaces is conventional in JavaScript-land; 4 spaces is common in Python and Java contexts. Pick whichever your project uses.
Minify: collapse to a single line with no whitespace. Useful when embedding JSON in URLs, environment variables, or anywhere whitespace matters. The size difference is meaningful: a typical pretty-printed config file shrinks 20-40% when minified.
Trailing commas. Allowed in JavaScript, not in JSON. {a:1, b:2,} parses in your code editor but fails when sent over the wire.
Single quotes. JSON requires double quotes for both keys and string values. {'a': 1} is invalid JSON. {"a": 1} is correct.
Comments. JSON has no comments. // or /* */ inside JSON breaks parsing. JSONC (used by VS Code config) supports comments but isn't standard JSON.
Numbers. JSON doesn't support NaN or Infinity. Use null, or wrap in a string, depending on your downstream consumer.
Not yet. Strip comments first or use a tool that supports JSONC.
Modern browsers handle multi-megabyte JSON, though the textarea may slow down past ~1 MB. For huge files, use a desktop tool.
Most often: a trailing comma, single quotes, or an unescaped quote inside a string. The parser error points at the column where the issue is detected.
Not in this version. Pasting into a sort-aware tool (like jq with --sort-keys) is the cleanest path; we may add the option later.
Yes. The browser's JSON parser handles any practical depth.
Minify only removes whitespace. The actual data is still there. For real size reduction, gzip or use a binary format like MessagePack.
No. All parsing and formatting happens in your browser.
This tool validates syntax only. For schema validation, use a JSON Schema validator with your schema file.
Strict no-logs VPN with 6,400+ servers in 111 countries. Threat Protection blocks ads, trackers, and malware while you work online.
Get NordVPN →Managed cloud hosting for WordPress and web apps on DigitalOcean, Vultr, and AWS. Fast setup, no server headaches.
Try Cloudways →Hire freelancers for design, writing, dev, and marketing — or sell your own services. Millions of gigs at every budget.
Browse Fiverr →