What is JSON-LD?

JSON-LD is a JSON-based format for embedding structured data in web pages, the format search engines recommend for rich results.

JSON-LD, which stands for JSON for Linking Data, is a lightweight format for expressing structured data using ordinary JSON syntax. On the web it is the preferred way to add machine-readable descriptions of a page's content - such as an article, product, recipe, or business - that search engines use to power rich results like star ratings, FAQs, and event listings.

The key advantage of JSON-LD over older methods like Microdata and RDFa is that it lives in a single script block in the page head or body, separate from the visible HTML. This decoupling means you can add or update structured data without touching your page's markup, making it far easier to implement, maintain, and generate programmatically from a template or CMS.

A JSON-LD block references a vocabulary - almost always schema.org - through a @context, and declares what kind of thing it describes with a @type, followed by properties. For example, a product's JSON-LD includes its name, price, availability, and aggregate rating. Search engines parse this to understand the entity and may display enhanced snippets that stand out in results.

Because JSON-LD is plain JSON, it must be valid: correct quoting, no trailing commas, and properly escaped strings. It should also accurately reflect the page's visible content - search engines penalize structured data that describes content users cannot see. Validating both the JSON syntax and the schema against testing tools before deploying avoids errors that silently disable rich results.

Examples

  • <script type="application/ld+json">{"@context":"https://schema.org","@type":"Organization","name":"Example"}</script>
  • A Product type with offers, price, and aggregateRating for star ratings in search
  • An FAQPage type that can produce expandable Q&A directly in results

Common questions

Is JSON-LD better than Microdata?
For most cases, yes. Search engines recommend JSON-LD because it sits in a single script block separate from your HTML, making it cleaner to implement and maintain than inline Microdata or RDFa attributes.
Does JSON-LD guarantee rich results?
No. Valid structured data makes a page eligible for rich results, but search engines decide whether and when to show them based on quality, relevance, and their own policies.
What happens if my JSON-LD has a syntax error?
Search engines will typically ignore the entire block, so no rich results appear. Because it is standard JSON, validate it with a JSON validator and a structured-data testing tool before publishing.

Related tools

Related terms for JSON-LD