Strict RFC 8259 JSON Validation Without Server Uploads
RFC 8259 forbids comments, single-quoted strings, trailing commas, unquoted object keys, NaN/Infinity literals, and unescaped control characters (U+0000 through U+001F). While JavaScript engines silently accept duplicate object keys by retaining only the last value, RFC 7493 (I-JSON) warns that duplicate members create security vulnerabilities across polyglot parsers—such as Go or Java reading the first key while Node.js reads the last.
Standard browser JSON.parse() also silently rounds 64-bit integers such as Twitter/Discord Snowflake IDs or database BIGSERIAL keys above 9,007,199,254,740,991 (2^53 - 1). This validator scans the raw token stream before parsing to surface exact line/column offsets, duplicate keys, and unsafe numeric literals completely inside your browser tab.
- Grammar StandardStrict RFC 8259 (I-JSON / RFC 7493 duplicate-key and IEEE 754 precision checks enabled)
- Precision BoundaryFlags integers outside -(2^53 - 1) to (2^53 - 1) (9007199254740991) that truncate in JS/JSON.parse
- Data Privacy100% browser-local execution with zero network payload transmission
Why does RFC 8259 reject trailing commas that work in JavaScript?
JSON is a language-independent data interchange format defined by RFC 8259, not a superset of ES6 object literals. Strict parsers in Python, Go, Rust, and PostgreSQL throw syntax errors on trailing commas.
Why are duplicate JSON keys a security risk?
RFC 8259 leaves duplicate key precedence undefined. If an API gateway validates the first 'role' key while a downstream microservice consumes the last 'role' key, attackers can bypass authorization checks.
How should I represent 64-bit integers in JSON APIs?
Serialize int64 or uint64 identifiers as quoted strings (for example, "7248192048192048129") so JavaScript, jq, and browser clients never silently corrupt the least-significant digits.