PrettifyJson
JSON Guide

JSON explained in the same visual language as the formatter

JSON is the default transport format for APIs because it maps cleanly to native data structures, stays compact on the wire, and is easy to validate.

Why teams use JSON

JSON became the standard because it is simple enough to author by hand and structured enough for machines to parse reliably.

Readable structure

Objects, arrays, strings, numbers, booleans, and null cover most application payloads without extra syntax overhead.

Broad interoperability

Every mainstream language can parse and generate JSON, so it fits browser apps, APIs, automation scripts, and config flows.

Fast in practice

Native parsers and direct mapping to dictionaries and arrays make JSON efficient for everyday request and response handling.

API-friendly by design

Compared with older interchange formats, JSON stays smaller on the wire and easier to inspect during debugging.

Core JSON data types

The format is intentionally small. That limited vocabulary is part of why tooling around JSON is predictable.

String

Text wrapped in double quotes, such as "hello".

Number

Integers and decimals share one numeric type in the format.

Boolean

The literal values true and false.

Null

An explicit empty value represented as null.

Array

An ordered list such as [1, 2, 3] or mixed values.

Object

A set of key/value pairs such as {"name": "Ana"}.

JSON vs XML

Both formats can represent structured data, but they optimize for different workflows.

FeatureJSONXML
ReadabilityCompact and less noisyMore verbose because of opening and closing tags
ParsingUsually simpler in web stacksOften requires a richer parser model
MetadataKeeps payloads minimalSupports attributes and richer document markup
Common useREST APIs, app state, configDocuments, feeds, enterprise integrations

Example payload

This sample shows the primitives you will see most often in real API responses.

sample.json
{
  "project": "JSON Formatter",
  "version": 1.0,
  "features": ["validation", "minify", "tree-view"],
  "active": true,
  "author": {
    "name": "Dev Team",
    "contact": null
  }
}

Formatting rules worth remembering

  • Keys must always be quoted strings, for example "name".
  • Use double quotes for string values. Single quotes are valid in JavaScript, but not in strict JSON.
  • Do not leave trailing commas after the last item in an object or array.
  • If you need dates, store them as strings such as "2026-04-21T12:00:00Z".
  • Pick a stable indentation style like 2 or 4 spaces so diffs stay readable.

External references

Explore More

Keep moving through the docs

Jump between reference pages without leaving the product’s main visual system.