RFC 8259 · strict parse · live errors

Validate JSON with precise error locations

Strict RFC 8259 parsing with line / column hints, structural stats, and pretty-print fallback for valid inputs.

JSON Validator Workspace
Input size
105 B
6 lines
Keys
5
leaf+nested
Nesting
2
depth
Status
Valid
RFC 8259
input · raw json
output · parsed
{
  "user": "ada",
  "active": true,
  "roles": [
    "admin",
    "founder"
  ],
  "address": {
    "city": "London"
  }
}
Step-by-step Tutorial

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.

  1. 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.parse reviver chain — strict RFC 8259. Any syntax error returns line and column for the exact offending byte.

    liveRFC 8259JSON.parsestrict
    input · raw.json · RFC 8259
    {"name": "Ada"}
    loaded · parsed RFC 8259RFC 8259 · ready
  2. 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.stringifylive
    structure · optionsstats · live
    Keys: 4
    Depth: 2
    options applied · livelive
  3. 03

    Fix errors with hints

    Common mistakes (trailing commas, single quotes, unquoted keys, comments) get specific guidance — not just generic error text.

    trailing commasingle quotescomments
    errorline · col
    SyntaxError
    Hint: Remove trailing commas
    fix → retryRFC 8259 § 4
  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 Blob with application/json; copy uses the Async Clipboard API. Both round-trip identically to what the page rendered.

    prettycanonicalclipboardblob.json
    output · copiedparsed · done
    {
      "name": "Ada",
      "age": 36
    }
    ready · ready to shipsuccess
Pro tips

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.

Use Cases

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 errors

Config files

Validate package.json, tsconfig.json, or IAM policies before committing.

cleaner PR diffs

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 valid

LLM 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 safe

Logs & 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-friendly

Test 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-ready
FAQ

Frequently asked questions

Bracket matching, proper string quoting, valid numeric formats, no trailing commas, no comments — strict RFC 8259.
No — strict JSON only. Strip comments and use a JSON5 preprocessor first, or run JSON Repair.
Not part of JSON. Use null or stringified sentinels, or replace them in JSON Repair.
No. All parsing runs locally.
Yes — the output panel shows the canonical pretty-printed parse.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!