API & Data Interchange Standard.jsonMIME: application/json

JSON Specification: The Global Lingua Franca of APIs & Microservices

Understand RFC 8259 strict syntax rules, primitive data types, JSON Schema validation, and client-side formatting.

JavaScript Object Notation (JSON) is a lightweight, text-based, language-independent data interchange format created by Douglas Crockford in 2001. Standardized under RFC 8259 and ECMA-404, JSON has completely replaced XML as the dominant format for web APIs, configuration files, and NoSQL document databases due to its human readability and effortless native parsing in every modern programming language.

Format Specification & Header Signature

Core file signatures, developer metadata, and standard RFC specifications:

Magic Bytes (Hex Signature)7B ({) or 5B ([)
MIME Media Typeapplication/json
Standard / SpecificationECMA-404 / RFC 8259 / ISO/IEC 21778
Initial Developer / OrganizationDouglas Crockford (2001)
RFC SpecificationRFC 8259 & ECMA-404
Character EncodingUTF-8 (Mandatory for open exchange)
Supported Primitivesstring, number, boolean, null, array, object
Disallowed Typesundefined, functions, NaN, Infinity, comments
Key DelimiterDouble quotes ("key") strictly required

Operating System & Browser Compatibility Matrix

Where .json is natively supported without third-party codecs:

Platform / EnvironmentNative SupportImplementation Notes
All Platforms, Browsers & LanguagesSupportedBuilt-in native parsers (e.g. JSON.parse() in JS, json module in Python, encoding/json in Go).

Advantages of JavaScript Object Notation

  • •Universal compatibility: supported natively across 100% of programming environments
  • •Clean, intuitive syntax that is easy for humans to read and machines to parse
  • •Significantly more compact and faster to parse than verbose XML schemas
  • •Supported as first-class citizens in databases like PostgreSQL, MongoDB, and MySQL

Limitations & Trade-Offs

  • •No native support for comments (disallowing inline configuration annotations)
  • •Strict syntax: a single trailing comma or unescaped quote breaks the entire parser
  • •Does not natively distinguish integers from floating-point decimals

The Strictness of RFC 8259 Syntax

Many developers accidentally confuse JavaScript object literals with valid JSON. In JSON, object keys MUST be enclosed in double quotes. Single quotes ('key') or unquoted keys throw immediate syntax errors.

Additionally, trailing commas after the last element in an array or object are strictly prohibited by the grammar: `{"a": 1,}` is invalid. Using DocSwift's JSON Formatter automatically catches and repairs these structural mistakes client-side.

Frequently Asked Questions about JavaScript Object Notation

Can I add comments to a JSON file?

Standard JSON (RFC 8259) prohibits comments. For configuration files needing comments, developers often use JSONC (JSON with Comments) or convert to YAML.

How can I safely format large confidential JSON logs?

Use DocSwift's in-browser JSON Formatter. Because it executes via local JavaScript memory, your sensitive data is never uploaded to remote servers.