JSON (JavaScript Object Notation) is governed by IETF RFC 8259 and ECMA-404. It is a lightweight, text-based, language-independent data interchange format.
1. Core Data Types in RFC 8259
RFC 8259 defines six fundamental primitive and structural data types:
- Objects (
{ }): Unordered collections of zero or more key-value pairs. Keys MUST be double-quoted strings. - Arrays (
[ ]): Ordered sequences of zero or more values of any type. - Strings (
"..."): Sequences of Unicode code points enclosed in double quotes ("...). - Numbers: Signed decimal numbers in standard or scientific exponential notation.
- Booleans: Keyword literals
trueorfalse(strictly lowercase). - Null: The keyword literal
null.
{
"name": "JSON2X Enterprise API",
"version": 2.4,
"isActive": true,
"metadata": null,
"tags": ["developer", "tools", "privacy-first"]
}2. String Escaping & Special Characters
RFC 8259 mandates backslash (\) escaping for special control characters:
| Character | Escape Sequence | Description |
|---|---|---|
| Quotation mark | \" | Double quote character |
| Reverse solidus | \\ | Backslash character |
| Solidus | \/ | Forward slash (optional) |
| Backspace | \b | Backspace control code |
| Form feed | \f | Form feed control code |
| Line feed | \n | Standard Unix newline |
| Carriage return | \r | Carriage return |
| Tab | \t | Horizontal tab |
| Unicode code point | \uXXXX | 4-hex digit Unicode hex |
3. Strict RFC 8259 Parsing Rules
- No Single Quotes: Keys and string values must strictly use double quotes (
"key": "value"). - No Trailing Commas: A comma after the final element in an object or array causes a syntax violation.
- No Unquoted Keys: Property names like
{ age: 30 }are valid JavaScript object literals, but invalid JSON. - No Comments: Comments (
//or/ /) are prohibited under standard RFC 8259. - No Leading Zeros: Numbers like
0123or+42are invalid in JSON.
4. Frequently Asked Questions
Why does JSON reject single quotes?
RFC 8259 explicitly standardized on double quotes (") to ensure absolute cross-platform interoperability across all programming language parsers (C, Java, Python, Go, Rust).
How does client-side validation prevent data corruption?
Client-side validation runs in the browser's JavaScript engine before network transmission, preventing invalid payloads from hitting backend databases and APIs.Put this into practice with the JSON Validator
Runs entirely in your browser — no upload, no signup, and your data never leaves your device.
Open JSON Validator →