What Is JSON? A Practical Introduction

Updated · 6 min read · MetaSol Technologies

JSON (JavaScript Object Notation) is a plain-text format for structured data. It began as a subset of JavaScript literal syntax, but today almost every language reads and writes it: web APIs, configuration files, log pipelines, databases and message queues all use it.

Its popularity comes down to two things: it is easy for people to read, and it is easy for programs to parse. A JSON document is just text, so it can be stored in a file, sent over HTTP, or pasted into a chat.

A first example

{
  "name": "Lena Fischer",
  "age": 34,
  "member": true,
  "languages": ["German", "English"],
  "manager": null
}

This one document contains all six JSON value types.

The six value types

Type Example Notes
Object {"a": 1} Unordered set of name: value pairs. Names are always strings.
Array [1, 2, 3] Ordered list. Items can be any type, even mixed.
String "hello" Double quotes only. Special characters are escaped with \.
Number 42, -3.5, 1e9 No leading zeros, no NaN or Infinity, no hexadecimal.
Boolean true, false Lower case.
Null null Lower case. Means "no value".

Objects and arrays can be nested to any depth, which is how JSON represents trees of data such as an order with customer details and a list of line items.

Rules that catch people out

Most invalid JSON comes from habits carried over from JavaScript or Python:

  • Single quotes are not allowed. {'name': 'x'} is invalid; use {"name": "x"}.
  • Keys must be quoted. {name: "x"} works in JavaScript but not in JSON.
  • No trailing commas. [1, 2, 3,] is an error.
  • No comments. Neither // nor /* */ is part of JSON.
  • Booleans and null are lower case. Python's True and None are not JSON.

When you hit one of these, the JSON Validator names the rule and the exact line and column.

Where JSON falls short

JSON deliberately keeps things simple, and that has costs:

  • No date type. Dates are usually ISO 8601 strings such as "2026-11-17T09:30:00Z".
  • Big integers are risky. The format allows any number of digits, but many parsers (including JavaScript's) store numbers as 64-bit floats and silently round integers above 9,007,199,254,740,991. IDs from databases or social networks are often sent as strings for this reason.
  • Duplicate keys are ambiguous. The standard discourages them but does not forbid them, and parsers disagree on which value wins.
  • No comments. For hand-edited config, formats such as YAML or JSONC are sometimes preferred.

JSON in practice

  • APIs: most REST and many GraphQL APIs send JSON responses.
  • Configuration: package.json, tsconfig.json, appsettings.json and many more.
  • Logs: structured logging writes one JSON object per line (JSON Lines), which makes logs searchable.
  • Databases: PostgreSQL, MySQL and SQL Server can store and query JSON columns, and document databases are built around it.

Next steps

Paste any JSON into the formatter to see its structure, or open it in the tree viewer to explore it node by node.