Skip to content
jsonblocks

What is JSON?

JSON (JavaScript Object Notation) is a lightweight text format for storing and exchanging structured data. It uses human-readable objects and arrays, which is why APIs, config files, and logs overwhelmingly prefer it.

A JSON document is plain text built from two structures - objects (key-value pairs in braces) and arrays (ordered lists in brackets) - plus four primitive value types. Almost every language ships a JSON parser, so data written once can be read anywhere.

A minimal example

json
{
  "name": "Ada Lovelace",
  "id": 1024,
  "verified": true,
  "nickname": null,
  "roles": ["admin", "editor"],
  "address": {
    "city": "London",
    "zip": "E1 6AN"
  }
}

This one object shows everything: a string, a number, a boolean, a null, an array of strings, and a nested object. Real API responses are the same shapes at larger scale.

The rules in 30 seconds

  • Object keys must be double-quoted strings: {"name": "Ada"} is valid, {name: "Ada"} is not.
  • Strings use double quotes only. Single quotes are a syntax error.
  • No trailing commas after the last item in an object or array.
  • No comments. Use a _comment key if a human note must live in the file.
  • One top-level value per document: usually an object or array.

JSON vs XML vs YAML

JSON won over XML for APIs because it maps directly onto the data structures programming languages already have - no schemas, namespaces, or closing-tag ceremony. Against YAML, JSON trades writability for predictability: no indentation traps, no surprising type coercions, and parsers that behave identically everywhere.

Format comparison at a glance.
JSONXMLYAML
VerbosityLowHighLowest
CommentsNoYesYes
Schema toolingJSON SchemaXSDJSON Schema
Best fitAPIs, configs, logsDocuments, legacy SOAPHand-written configs

Working with JSON in jsonblocks

  1. Paste any JSON into the visualizer to read it as inline blocks with visible data types.

  2. Run suspicious input through the validator to pinpoint syntax errors.

  3. Use the formatter to pretty-print minified payloads before reading them.

Frequently asked questions

What does JSON stand for?

JavaScript Object Notation. Despite the name, it is language-independent: Python, Go, Rust, Java, and every other mainstream language parse and generate JSON natively.

Is JSON a programming language?

No. JSON is a data format with no logic, functions, or comments. It describes values only, which is what makes it safe to exchange between systems.

What is valid top-level JSON?

Any single JSON value: usually an object or array, but a bare string, number, boolean, or null is also technically valid. Most APIs return an object envelope.