JSON
JSON Guides
JSON is the format almost every API, config file and log line arrives in, which is why so much of the day is spent staring at a parse error on line 1, column 1. These guides cover the format from the specification outwards: the six value types RFC 8259 actually defines, why trailing commas and single quotes are rejected everywhere except JSON5, what makes duplicate keys legal but dangerous, and how numbers lose precision the moment they exceed what a double can hold. Alongside the reference material there are working guides for the jobs that bring people here — validating a document against a schema, flattening or querying deeply nested structures, comparing two payloads to find the field that changed, and converting to and from CSV, XML or YAML without losing type information. Every example is run before it is published, so the error messages quoted are the ones you will actually see.
11 guides in this topic · All posts
How to Validate JSON Against a Schema in Python and JavaScript
Validate JSON against a schema with Ajv in Node and jsonschema in Python: install, compile, read the error objects, and wire validation into CI.
9 min read · Updated 2026-09-11JSON Minify vs Gzip: What Actually Shrinks a Payload
Measured bytes for three JSON documents raw, minified, gzipped and brotlied: what minification saves once compression is on, and when it still matters.
8 min read · Updated 2026-09-18JSON Schema Tutorial: Contracts for Your JSON
Learn JSON Schema from zero: types, required properties, nested objects, arrays, formats — with a complete example and how to generate schemas from samples.
2 min read · Updated 2026-06-04Pretty Print JSON in JavaScript: stringify and Beyond
Master JSON.stringify's third argument: indentation, the replacer, console tricks, circular-reference errors, and displaying pretty JSON in HTML.
2 min read · Updated 2026-06-04Pretty Print JSON in Python: Every Method That Matters
All the ways to pretty print JSON in Python: json.dumps with indent, sort_keys, the python -m json.tool one-liner, files, and Unicode gotchas.
2 min read · Updated 2026-06-04Comments in JSON: Why They're Forbidden and What To Do Instead
JSON has no comments — by deliberate design. Here's why, which workarounds are safe (JSON5, JSONC, _comment keys), and how each ecosystem handles it.
2 min read · Updated 2026-06-04“Unexpected end of JSON input”: What It Means and How to Fix It
The real causes of 'Unexpected end of JSON input': empty responses, truncated payloads, and unclosed brackets — with the steps that find each one.
2 min read · Updated 2026-06-04How to Open a JSON File (and Actually Read It)
Three ways to open a .json file: instantly in your browser, in a proper editor, or in Excel/Sheets — plus why double-clicking shows you a wall of text.
2 min read · Updated 2026-09-18How to Fix Invalid JSON: Every Common Error, Decoded
Unexpected token? Unexpected end of input? Decode every common JSON parse error, find the exact broken line, and fix it — or auto-repair it in one click.
2 min read · Updated 2026-06-04JSON Examples: From Hello World to Real API Payloads
Copy-ready JSON examples: basic objects, arrays, nested structures, API responses, configuration files — each explained line by line.
2 min read · Updated 2026-06-04What is JSON? A Practical Introduction
JSON explained simply: what it is, its exact syntax rules, real examples, how it compares to XML, and how to read, write, validate and format it.
2 min read · Updated 2026-06-04