Validate JSON with precise error locations
Strict RFC 8259 parsing with line / column hints, structural stats, and pretty-print fallback for valid inputs.
{
"user": "ada",
"active": true,
"roles": [
"admin",
"founder"
],
"address": {
"city": "London"
}
}How to validate JSON against RFC 8259
Paste any JSON and the validator confirms it parses cleanly under the browser's strict JSON.parse. Errors show position-aware hints (trailing comma, single quote, missing brace) so you can fix and re-run in seconds.
- 01
Paste JSON
Drop raw, minified, or pretty-printed JSON into the input panel. Validation runs as you type.
Inputs parse through the native
JSON.parsereviver chain — strict RFC 8259. Any syntax error returns line and column for the exact offending byte.liveRFC 8259JSON.parsestrictinput · raw.json · RFC 8259{"name": "Ada"}loaded · parsed RFC 8259RFC 8259 · ready - 02
Read structural stats
The stats row shows key count and nesting depth so you can spot anomalies (deeply nested API responses, missing keys, etc.) at a glance.
Indent options run through
JSON.stringify(value, null, n); the second argument lets you sort, transform, or omit keys via a replacer if you ever wire one in.depthkeysindentJSON.stringifylivestructure · optionsstats · liveKeys: 4 Depth: 2
options applied · livelive - 03
Fix errors with hints
Common mistakes (trailing commas, single quotes, unquoted keys, comments) get specific guidance — not just generic error text.
trailing commasingle quotescommentserrorline · colSyntaxError Hint: Remove trailing commas
fix → retryRFC 8259 § 4 - 04
Use the parsed value
For valid input the output panel shows the canonically parsed, pretty-printed value — handy for confirming type coercion (string vs number, true vs "true").
Download is a
Blobwithapplication/json; copy uses the Async Clipboard API. Both round-trip identically to what the page rendered.prettycanonicalclipboardblob.jsonoutput · copiedparsed · done{ "name": "Ada", "age": 36 }ready · ready to shipsuccess
Production-grade JSON, the right way
Stick to RFC 8259
Strict JSON has no NaN, Infinity, comments, or trailing commas. If you need those, look at JSON5 or JSON Repair.
Preserve key order for diffs
JavaScript preserves insertion order, but two parsers shouldn’t be assumed equal. Use Sort JSON Keys before diffing or hashing.
Big integers lose precision
JS numbers lose precision past 2^53−1. Transport large IDs as strings or use BigInt.
Escape inside HTML
When inlining JSON inside <script>, escape </ to <\/ so HTML parsing doesn’t close your tag early.
Validate at boundaries
Trust the wire as little as possible. Run incoming JSON through a schema (Zod / Pydantic) before it touches business logic.
Minify in production
Minify removes whitespace; gzip removes redundancy. Together they typically shrink JSON payloads 70–85% over the wire.
When to validate JSON
Anywhere the cost of a bad parse is high — request bodies, config files, webhook payloads.
Before sending requests
Catch malformed bodies before POSTing. Strict parse beats curl's generic error. Output round-trips losslessly through JSON.parse + JSON.stringify, so the file you save is byte-identical to what you see. Streaming parsers, jq pipelines, and Postgres jsonb columns all accept the result without complaint.
fewer 400 errorsConfig files
Validate package.json, tsconfig.json, or IAM policies before committing.
Webhook debugging
Paste a captured payload from Stripe/Slack/GitHub to confirm the shape before writing a handler. Handles emoji and non-ASCII via UTF-8 throughout — your data survives copy-paste between editors, terminals, and IDEs. Combining marks and ZWJ sequences come out the other side intact.
RFC 8259 validLLM output checking
Tools that emit JSON sometimes produce broken output. Validate first to catch the failure cleanly. Re-parses on every keystroke so syntax errors are caught at the exact character. Strict RFC 8259 — no trailing commas, no comments, no unquoted keys — keeps downstream parsers happy.
round-trip safeLogs & analytics
Validate event payloads before shipping to your analytics warehouse. Streams large documents without a server round-trip — privacy stays in the tab. Heavy parsing runs through useMemo so even 5 MB payloads keep the editor responsive.
schema-friendlyTest fixtures
Quick check that your test JSON fixtures haven't drifted into invalid territory. Output is byte-stable: same input plus same options always produces identical bytes, ideal for content-addressed caches and snapshot tests. Downloads ship with the application/json MIME so editors apply syntax highlighting.
production-readyFrequently asked questions
Something missing?
Tell us what you need. We ship the top requests every two weeks.