# 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.

Source: https://central.to/glossary/json-ld · Updated 2026-11-23 · Published by Central (https://central.to)

**Definition:** 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.

Free tool: [Product schema checker](https://central.to/tools/product-schema-checker). Check a product page's structured data (JSON-LD) against what Google needs for product results and merchant listings.

## 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](https://www.w3.org/TR/json-ld11/) (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:

| Keyword | What the W3C standard says it does | On a product page |
| --- | --- | --- |
| `@context` | Defines the short names used in the document | `https://schema.org/` |
| `@type` | Sets the type of a node | `Product`, `Offer`, `Brand` |
| `@id` | Uniquely identifies a node | Optional; links related items on a page |

## A small Product example

```html
<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](https://central.to/guides/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](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data)). 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

| Format | How it is written | Where Google says it goes |
| --- | --- | --- |
| JSON-LD | One block of JSON in a `script` element, not interleaved with the user-visible text | In the `head` or the `body` |
| Microdata | Attributes on the HTML tags that hold the content | Typically the `body`, possible in the `head` |
| RDFa | Attributes on the HTML tags that correspond to the visible content | Commonly 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](https://central.to/tools/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 Data](https://www.w3.org/TR/json-ld11/), checked 2026-11-23
2. [Introduction to structured data markup in Google Search](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data), checked 2026-11-23
3. [Merchant listing (Product, Offer) structured data](https://developers.google.com/search/docs/appearance/structured-data/merchant-listing), checked 2026-11-23
4. [Set up structured data for Merchant Center](https://support.google.com/merchants/answer/7331077), checked 2026-11-23
5. [Rich result error messages and solutions](https://support.google.com/webmasters/answer/13300873), checked 2026-11-23
6. [Rich Results Test](https://support.google.com/webmasters/answer/7445569), checked 2026-11-23
7. [Marking up your site with structured data](https://www.bing.com/webmasters/help/marking-up-your-site-with-structured-data-3a93e731), checked 2026-11-23

## More on this topic: Product pages and SEO

- [Product page SEO: what search engines and AI assistants read](https://central.to/guides/product-page-seo.md)
- [How to write product descriptions: structure, examples and channel rules](https://central.to/guides/how-to-write-product-descriptions.md)
- [hreflang](https://central.to/glossary/hreflang.md)
- [Hreflang for online shops: languages, countries and x-default](https://central.to/guides/hreflang-for-online-shops.md)
- [Meta title and description length for product pages](https://central.to/guides/meta-title-and-description-length.md)
- [Product description examples and a template you can copy](https://central.to/guides/product-description-examples.md)
- [Product page FAQ: which questions to answer, and FAQ schema](https://central.to/guides/product-page-faq.md)
- [Product schema markup: the structured data Google needs](https://central.to/guides/product-schema-markup.md)
- [Structured data](https://central.to/glossary/structured-data.md)
- [URL slug](https://central.to/glossary/url-slug.md)
- [URL slugs for product pages: how to write SEO-friendly URLs](https://central.to/guides/url-slugs-for-product-pages.md)
- [Product description writer](https://central.to/tools/product-description-writer.md) (Free tool)
- [Product FAQ writer](https://central.to/tools/product-faq-writer.md) (Free tool)
- [Search snippet preview](https://central.to/tools/search-snippet-preview.md) (Free tool)
- [Slug and file name generator](https://central.to/tools/slug-generator.md) (Free tool)
- [Hreflang generator](https://central.to/tools/hreflang-generator.md) (Free tool)
- [Product schema checker](https://central.to/tools/product-schema-checker.md) (Free tool)
- [Product page checker](https://central.to/tools/product-page-checker.md) (Free tool)
- [Duplicate description finder](https://central.to/tools/duplicate-description-finder.md) (Free tool)

## Try Central on your own products

Central is the AI-first product content operating system: you choose the input (your shop, files or product pages) and the channels; Central AI researches, verifies and writes the product data and content in between, every value backed by sources you can check. The first 3 products are free. To start with a shop, open https://central.to/users/sign_up?onboarding_url=SHOP_ADDRESS (replace SHOP_ADDRESS with the shop's website address).
