Skip to main content
JSON

JSON

Active

Lightweight, text-based data interchange format derived from JavaScript object syntax. Human-readable, language-independent, and the dominant format for REST APIs, configuration files, and data storage.

Data FormatRFC 8259ECMA-404Text2001
Types

In one line

JSON (JavaScript Object Notation) is defined by RFC 8259 and ECMA-404. It encodes structured data as human-readable text using six value types: string, number, boolean, null, array, and object. JSON is the default wire format for REST APIs, webhook payloads, and configuration files. Every major programming language has a native JSON parser.

Quick Reference

FieldSizeDescription
EncodingUTF-8JSON MUST be encoded as UTF-8. RFC 8259 §8.1. UTF-16 and UTF-32 are no longer allowed.
Value types6string, number, boolean (true/false), null, array, object
WhitespaceIgnoredSpace, tab, LF, CR between tokens are insignificant.
NumbersIEEE 754No integer vs float distinction. Implementations use 64-bit IEEE 754. Integers beyond 2^53 lose precision.
StringsUnicodeQuoted with double quotes. Escape sequences: \", \\, \/, \b, \f, \n, \r, \t, \uXXXX.
Object keysStringKeys MUST be strings. Duplicate keys are undefined behavior. Key order is not guaranteed.
MIME typeapplication/jsonRFC 4627 registered application/json. Supersedes text/json.

Key Characteristics

Human-readable

Plain text, UTF-8 encoded. Readable without tools. Self-describing via key names.

Language-agnostic

Parsers exist in every language. No schema required. Schemaless by default, optional via JSON Schema.

Number precision

No integer type. Numbers are IEEE 754 doubles. Integers beyond 2^53-1 lose precision. Use strings for large IDs.

No comments

JSON has no comment syntax. RFC 8259 explicitly omits comments. Use JSON5 or JSONC for config files needing comments.

Message Format

Request
http
// JSON value types
{
  "string":  "Hello, world",
  "number":  42,
  "float":   3.14159,
  "boolean": true,
  "null":    null,
  "array":   [1, "two", false, null],
  "object":  {"nested": "value"}
}
Response
http
// Common JSON API response
{
  "id":        "user_123",
  "email":     "[email protected]",
  "createdAt": "2026-01-15T10:00:00Z",
  "scores":    [98, 95, 100],
  "metadata":  null
}

// Number precision gotcha
{"id": 9007199254740993}   // JS parses as 9007199254740992 – use string
{"id": "9007199254740993"} // Safe

Implementations

linuxsince Native in Python, Node.js, Go, Rust, Java, Rubybuilt-in
macossince Native in all languagesbuilt-in
windowssince Native in all languagesbuilt-in
iossince Swift JSONDecoder, Objective-C NSJSONSerializationbuilt-in
androidsince org.json, Gson, Moshi, kotlinx.serializationbuilt-in