When you actually need this
You pasted a webhook payload into a config file and now your editor’s auto-format is silently broken. You’re debugging an API that returns Content-Type: application/json but the body looks like a 4KB string with no line breaks. You need to drop a JSON value into a database column where minified JSON saves you 30% on storage. You want to compare two API responses but they came back in different key orders, so a textual diff is useless.
Browser console + JSON.parse works for tiny things. For real work — pasting from logs, cleaning before commit, sorting before diff — you want a single page that does it without asking you to sign up, without uploading your data, and without 14MB of JavaScript on first paint.
Gotchas we keep hitting
The single biggest source of false alarms is trailing commas. JSON5 allows them; JSON does not. If you copy a JavaScript object literal into a JSON parser, that last comma will fail validation in a way the error message rarely names directly. The hint here calls it out explicitly.
Single quotes are the second biggest. {'name': 'Tinker'} is valid JavaScript and invalid JSON. The error position usually points at the second character, which is unhelpful. The hint here recognizes the pattern and tells you what’s wrong.
Comments: // this is a config and /* block */ are not allowed in JSON. Configuration formats like JSON5, JSONC (VS Code), and HJSON do allow them, but if you’re feeding the result to anything that calls JSON.parse directly, the comments must come out.
Date objects don’t survive JSON. They go in as Date and come out as ISO strings. If you JSON.parse then JSON.stringify on something that was a Date, the round-trip loses the type. Same for RegExp, Map, Set, BigInt, and undefined values (which silently disappear).
NaN and Infinity are not valid JSON. JavaScript will accept them in object literals but JSON.stringify({x: NaN}) returns {"x":null} — silent data loss. Watch for this in test fixtures and serialized model output.
Sort keys is non-destructive but recursive. If you have arrays of objects, the array order is preserved (arrays in JSON are positional, not sets) but object keys inside each element are sorted. This matters when you’re trying to make a stable diff between two semantically-equal but textually-different JSON files.
With AI in the loop
LLMs returning JSON with explanatory text wrapped around it (Here's your JSON: { ... }) is a daily occurrence. Validate mode flags the surrounding text as a parse error and the position usually pinpoints where the JSON actually starts. Strip the prefix, validate again, you’re done.
When asking the model to return structured data, sort-keys before comparing. Two LLM calls with the same prompt can return semantically identical JSON in different key orders — your diff tool will scream about every line. Sort first, then diff (or use the JSON-aware mode in our /toolbox/diff tool, which compares structurally regardless of key order).
For prompts that include sample JSON, paste it through minify first. Token budget is real, and a pretty-printed 200-line config can become 30 minified lines — same information, often 50%+ fewer tokens. We’ve seen meaningful cost reductions on a few production calls just by minifying examples.