JSON-LD (JSON for Linked Data) is a way of writing data in ordinary JSON so that each label has a shared, unambiguous meaning. It's a W3C standard; the current version, JSON-LD 1.1, became a Recommendation on 16 July 2020. On websites, people use it to add structured data: a description of the page's content that search engines can read without guessing.
Here is a small JSON-LD block for a recipe page:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Recipe",
"name": "Classic tomato soup",
"author": {
"@type": "Person",
"name": "Marco Rossi"
},
"prepTime": "PT15M",
"cookTime": "PT30M"
}
</script>
Readers never see this block. It sits in the HTML next to the visible recipe and tells machines what the page already says: this is a recipe, this is its name, this person wrote it, and it takes 45 minutes.
The parts of a JSON-LD block
Most SEO markup uses just a few pieces:
| Part | What it does | In the example |
|---|---|---|
@context |
Says which vocabulary the labels come from | https://schema.org |
@type |
Says what kind of thing this is | Recipe, Person |
| Properties | The facts, as label-value pairs | name, prepTime |
| Nested objects | A property whose value is another thing | the author object |
@id |
An optional URL that identifies the thing, so other blocks can refer to it | not used here |
The vocabulary is almost always Schema.org. Google's own documentation decides which types and properties matter for Google Search, so read Google's guide for your type, not only the Schema.org page.
Where to put JSON-LD
Put the block in a <script type="application/ld+json"> tag, in the <head> or the <body>. Google reads both. It can also read JSON-LD that JavaScript or a tag manager adds after the page loads, though markup in the original HTML is the safer choice and works for more crawlers. Google Search Central
If you fill the block from a database, escape the text. A product description that contains </script> would end the script tag early: the markup breaks, and the rest of the JSON shows up as text on the page.
Many content management systems add JSON-LD for you through a setting or a plugin. Check what yours already outputs before you add a second block that says something different.
The rules Google applies
Valid JSON-LD isn't enough on its own. Google's structured data guidelines add rules about content: Google Search Central
- Describe what's visible. Don't mark up anything readers can't see on the page, even if it's true.
- Include the required properties. Each rich result type lists them. Without them, the page isn't eligible.
- Prefer complete over long. A few accurate recommended properties beat many sloppy ones.
- Keep it current. Google won't show a rich result for an event that's over.
- Let Google in. Pages blocked by robots.txt or
noindexcan't show rich results.
Even perfect markup doesn't guarantee a rich result. Google decides per search, and it retires types: FAQ rich results stopped appearing on May 7, 2026. Misleading markup can lead to a manual action, which removes the page's rich result eligibility but, Google says, doesn't change its ranking.
JSON-LD, microdata or RDFa?
Google accepts all three formats and treats them as equally good when they're valid. It recommends JSON-LD because, for most sites, it's the easiest to implement and maintain.
| JSON-LD | Microdata and RDFa | |
|---|---|---|
| Where it lives | One script block | Attributes on the visible HTML elements |
| Effect of a redesign | Usually none | Markup can break when templates change |
| Nested data | Plain nested objects | Nested elements, which can get awkward |
| Ties to visible text | You keep them in sync yourself | Built in: the label sits on the text |
The last row is the one trade-off. With JSON-LD, nothing forces the block to match the page, so check that they agree. See microdata and RDFa for the other two formats.
Test it and watch it
Before you publish, paste the URL or code into the Rich Results Test. It shows which items Google found and which required properties are missing.
After you publish, use the rich result reports in Google Search Console. Template changes break markup quietly, and these reports are where you'll notice. To judge whether the markup was worth it, Google suggests a before-and-after comparison: pick stable pages with a few months of data, add the markup, and compare their performance over the following months.