JSON-LD

Also known as: linked data, application/ld+json

The JSON format used to embed structured data in a page, carried in a script tag with the type application/ld+json.

JSON-LD is the format Google recommends and the one every tool in this portfolio emits. Its advantage over the older inline formats is that the markup lives in one block instead of being scattered through the HTML as attributes, so it can be generated, validated and read independently of the layout.

A well-built block uses an @graph containing several nodes that cross-reference each other by @id, rather than one flat object per page.

A nested @graph is treated the same as a top-level node by any reader worth the name, including this one, which flattens the whole tree before looking at it. If your validator disagrees, the validator is the problem.

One genuine gotcha: minified JSON-LD is valid and readable by machines, and completely unreadable by the human who has to debug it at 2am. Pretty-print it.