>_ MoriDev dev.moritools.com
RFC 8259 100% Client-Side · Zero Upload

JSON Formatter, Validator & Tree Minifier

Validate RFC 8259 JSON with exact line/column diagnostics, recursive key sorting, tree preview, and minification.

Ready (Offline)
Quick Summary

Paste any raw API response or log line to pretty-print with 2 spaces, 4 spaces, or tabs, recursively alphabetize object properties, collapse into single-line minified output, and inspect exact line-and-column parse errors entirely offline.

Strict RFC 8259 JSON syntax rejects trailing commas, single-quoted strings, unquoted object keys, and JavaScript comments. When an edge worker or database JSONB column fails to deserialize a webhook body, finding the stray byte inside a 40 KB minified blob manually wastes minutes.

This formatter parses the document directly inside your V8 or JavaScriptCore tab, maps byte offsets back to one-based line and column coordinates with a caret pointer, reports structural depth and minified byte savings, and renders a quick structural tree preview.

Real-World JSON Parsing Pitfalls

01. Trailing Commas & JS Object Literals

TypeScript and ES modules tolerate a trailing comma after the final element of an array or object, yet JSON.parse throws immediately. Always strip comments and trailing commas before feeding config files to strict parsers.

02. IEEE 754 64-Bit Integer Precision Loss

JavaScript numbers lose integer precision above 2^53 - 1 (9007199254740991). Snowflake IDs from Discord or X should travel as quoted strings. This formatter keeps the original digits instead of rounding them.

03. Duplicate Object Keys Silencing Earlier Values

RFC 8259 advises unique member names, but standard parsers silently overwrite earlier duplicate keys with the last occurrence, creating subtle security mismatches between proxy validators and downstream microservices.

JSON Indentation & Compression Modes

Mode Formatting Behavior Best Use Case
2 Spaces Compact readable nesting aligned with Prettier and npm defaults { "ok": true }
4 Spaces High-contrast indentation matching Python json.dumps conventions { "ok": true }
Tab Indent Single tab character per depth level for custom editor widths { "ok": true }
Minify Strips insignificant whitespace to shrink HTTP payload size {"ok":true}
Sort Keys Recursively orders object keys A-Z while preserving array order {"a":1,"b":2}

Worked Engineering Examples

Spotting a Trailing Comma with Caret Coordinates

Input
{"env": "prod", "retries": 3,}
Output
Syntax error at line 1, column 30 -> trailing comma before closing brace

Removing the comma after 3 restores strict RFC 8259 compliance across Go, Rust, Python, and browsers.

Deterministic Snapshot Canonicalization

Input
{"z":1,"a":{"d":4,"b":2}}
Output
{
  "a": {
    "b": 2,
    "d": 4
  },
  "z": 1
}

Enabling Sort Keys stabilizes Git diffs and golden test fixtures regardless of upstream serializer key ordering.

Frequently Asked Questions

Does pasting production API payloads trigger any network call?

No. Formatting, key sorting, minification, and error offset mapping execute strictly through the browser JavaScript runtime with zero outbound requests.

Why does valid JavaScript fail JSON validation here?

JavaScript permits single quotes, undefined, NaN, comments, and unquoted keys. Strict JSON (RFC 8259) requires double-quoted property names and forbids comments or trailing commas.

Does Sort Keys reorder elements inside JSON arrays?

No. Arrays are ordered sequences in JSON, so recursive key sorting only alphabetizes object keys while leaving every array index untouched.

How much bandwidth does minifying JSON actually save?

Pretty-printed payloads with nested objects typically shrink by 15% to 35% after removing indentation and newlines, before gzip or Brotli compression is even applied.

Continue Your Workflow

24 offline developer utilities