JSON guides

The background behind our JSON formatter. Syntax, the mistakes that break parsers, how JSON compares with other formats, and how to validate the shape of a document.

7 articles, newest first

  • · 4 min read

    JSON Schema: How to Validate the Shape of Your JSON

    An introduction to JSON Schema with a complete example. Learn type, required, properties, enum, pattern and $ref, and how to run validation in JavaScript and Python.

    json schema validation

  • · 3 min read

    How to Pretty Print JSON from the Command Line

    Format and query JSON in the terminal with jq, Python, Node and PowerShell. One liners for files, curl output and clipboard contents on macOS, Linux and Windows.

    jq command line python

  • · 3 min read

    JSON.stringify and JSON.parse Explained, Including the Surprises

    How JavaScript converts between objects and JSON text, with the replacer, reviver and indent arguments, and the cases that silently lose data.

    javascript json.parse json.stringify

  • · 3 min read

    JSON vs YAML for Configuration Files

    YAML is easier to write and JSON is harder to get wrong. See the real differences, the famous YAML gotchas, and which format to pick for your config.

    yaml config files comparison

  • · 3 min read

    JSON vs XML: Which Data Format Should You Use?

    A practical comparison of JSON and XML covering size, readability, schemas, tooling and the cases where XML is still the right answer.

    xml data formats comparison

  • · 3 min read

    JSON Syntax Rules and the 10 Most Common Errors

    The complete set of JSON syntax rules, followed by the ten mistakes that cause almost every Unexpected token error, each with a broken and a fixed example.

    json syntax errors debugging

  • · 4 min read

    What Is JSON? A Beginner's Guide with Examples

    JSON explained from scratch: what it looks like, the six value types, where it is used, and how it compares to a JavaScript object.

    basics json syntax

← All articles

↑ Top