Skip to content

Library Glossary

JSON-LD (structured data in a script block)

What JSON-LD is, a small Product example, why Google recommends the format, how it differs from Microdata and RDFa, and where the block goes in a page.

By CentralUpdated 23 November 20263 min read7 sources, checked 23 November 2026
On this page
  1. What it means in practice
  2. A small Product example
  3. Why Google recommends it
  4. JSON-LD, Microdata and RDFa
  5. Where it goes in the page

JSON-LD is a W3C standard for writing linked data as JSON; on a web page it is a block inside a script element that states the page's facts, such as a product's name, price and GTIN, for machines.

Product schema checkerFree tool10 free checks a day

What it means in practice#

JSON-LD is the form in which most shops hand product facts to search engines: a block of JSON that sits in the page next to the visible HTML instead of inside it. The W3C standard, JSON-LD 1.1 (a W3C Recommendation of 16 July 2020), describes it as "a lightweight syntax to serialize Linked Data in JSON" and notes that JSON-LD is 100% compatible with JSON. The format says how to write the facts. The words come from a vocabulary, on product pages almost always schema.org.

Three keywords appear in nearly every block:

KeywordWhat the W3C standard says it doesOn a product page
@contextDefines the short names used in the documenthttps://schema.org/
@typeSets the type of a nodeProduct, Offer, Brand
@idUniquely identifies a nodeOptional; links related items on a page

A small Product example#

<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "Product",
  "name": "Northpeak Trail 400 Headlamp, Black",
  "image": "https://www.northpeak.example/images/trail-400-black-1x1.jpg",
  "offers": {
    "@type": "Offer",
    "price": 49.95,
    "priceCurrency": "USD"
  }
}
</script>

This block holds what Google requires for a merchant listing: a name, an image and an offer with a price above zero and a currency. The guide to Product schema markup adds brand, GTIN, shipping details, the return policy and variants.

Why Google recommends it#

Google supports three formats for structured data and recommends JSON-LD "if your site's setup allows it, as it's the easiest solution for website owners to implement and maintain at scale", and less prone to user errors (Google Search Central). It accepts any of the three as long as the markup is valid. Bing lists JSON-LD among the formats it supports for schema.org and says its crawlers do not prefer one specification over another.

JSON-LD, Microdata and RDFa#

FormatHow it is writtenWhere Google says it goes
JSON-LDOne block of JSON in a script element, not interleaved with the user-visible textIn the head or the body
MicrodataAttributes on the HTML tags that hold the contentTypically the body, possible in the head
RDFaAttributes on the HTML tags that correspond to the visible contentCommonly both head and body

The practical difference: Microdata and RDFa label the text a visitor reads, while JSON-LD repeats the facts in a second place. A template can print JSON-LD without touching the layout, but the block and the page can drift apart, and Google's guidelines say not to mark up content that is not visible to readers.

Where it goes in the page#

  • Element. The W3C standard embeds JSON-LD in HTML with a script element whose type is application/ld+json. A page may hold several such blocks.
  • Position. Google reads the block in the head or the body, and can read JSON-LD that is injected dynamically.
  • Product pages. Google still asks merchants for Product markup in the initial HTML, because markup generated with JavaScript can make Shopping crawls less frequent and less reliable. Merchant Center requires the markup in the HTML returned from the web server.
  • Syntax. The W3C standard tells authors to avoid or escape character sequences that HTML could confuse with the start or end of a script or a comment. Google's Rich Results Test ignores comments in JSON-LD but warns that they might cause errors in actual use.
  • Context. Google reports an invalid or unsupported @context value as an error and does not support custom remote contexts; use schema.org.

To check a live product page, use the product schema checker at the top of this page: it reads the page's JSON-LD and checks it against what Google needs for product results and merchant listings.

Questions

Where does JSON-LD go on a product page?

In a script element of type application/ld+json. Google reads it in the head or the body. For product pages, Google and Merchant Center ask for it in the HTML the server returns, not added later with JavaScript.

Is JSON-LD required, or can I use Microdata?

Google supports JSON-LD, Microdata and RDFa and accepts any of them when the markup is valid. It recommends JSON-LD where your site's setup allows it. Bing says its crawlers do not prefer one specification over another.

Does JSON-LD have to match what the page shows?

Yes. Google's guidelines say not to mark up content that is not visible to readers, and Merchant Center requires structured data to match the values shown to the user.

Sources

  1. JSON-LD 1.1: A JSON-based Serialization for Linked DataW3Cchecked 23 November 2026
  2. Introduction to structured data markup in Google SearchGoogle Search Centralchecked 23 November 2026
  3. Merchant listing (Product, Offer) structured dataGoogle Search Centralchecked 23 November 2026
  4. Set up structured data for Merchant CenterGoogle Merchant Center Helpchecked 23 November 2026
  5. Rich result error messages and solutionsSearch Console Helpchecked 23 November 2026
  6. Rich Results TestSearch Console Helpchecked 23 November 2026
  7. Marking up your site with structured dataBing Webmaster Tools Helpchecked 23 November 2026

More on this topic

Product pages and SEO

You choose what goes in and where it goes out.

Central AI does everything in between. Your first 3 products are free.

  1. Your inputYour shop, your files or your product pages.
  2. Central AIResearches, verifies and writes everything in between. Every value is backed by sources you can check; what the sources do not support is held back.
  3. Your channelsProduct data and listings for the channels you choose.