Skip to content

About JSON

What is JSON?

JSON (JavaScript Object Notation) is a lightweight, text-based format for storing and exchanging data. Despite the name, it is language-independent — practically every programming language can read and write it, which is why it became the default format for web APIs, configuration files, and data interchange.

A JSON document is built from just six value types: objects (key–value pairs in { }), arrays (ordered lists in [ ]), strings, numbers, booleans (true/false), and null.

Example

{
  "name": "Ada Lovelace",
  "born": 1815,
  "fields": ["mathematics", "computing"],
  "knownFor": {
    "analyticalEngine": true,
    "firstProgram": "Note G"
  }
}

Want to explore this interactively? Paste it into the JSON viewer to see it as a tree or table.

Syntax rules to remember

  • Keys and strings must use double quotes — single quotes are invalid.
  • No trailing commas after the last item in an object or array.
  • No comments — JSON is data only.
  • Numbers can’t start with a leading zero or use NaN/Infinity.
  • The top level can be any JSON value — not just an object.

Authoritative references

  • json.org

    The official JSON specification site by Douglas Crockford — grammar diagrams and the full standard.

  • Wikipedia: JSON

    History, design goals, comparisons with XML/YAML, and the standardization story (ECMA-404, RFC 8259).

  • MDN Web Docs: JSON

    Practical developer reference for working with JSON in JavaScript — JSON.parse, JSON.stringify, and gotchas.