JSON-LD (JavaScript Object Notation for Linked Data) is a way to write structured data as a small block of JSON inside a web page. It tells search engines what the page is about in a labelled, machine-readable form, using the shared vocabulary from schema.org. Google says it prefers this format over the alternatives.
Why it matters
Search engines read the visible text of a page, but they have to guess what each piece means. Structured data states it directly: this is an organization, this is an article, these are questions and answers. JSON-LD keeps that data in one separate block instead of weaving it through your HTML, so it is easier to add, review and remove without breaking the layout.
How to add it
- Choose the schema.org type that matches the page, for example Organization, Article or FAQPage.
- Write the properties for that type, using only facts that are visible on the page.
- Place the block in a script tag with the type
application/ld+json, in the head or the body:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Example Co",
"url": "https://www.example.com/"
}
</script>
- Publish the page and test it with the Rich Results Test and the Schema Markup Validator.
- Re-test after any template change, because a broken comma or quote makes the whole block unreadable.
The block does not display anything to visitors. It is only for machines, so it must match what visitors can actually see.
Common mistakes
- Marking up content that is not on the page, which can lead to a manual action.
- Using straight quotes inside values without escaping them, or leaving a trailing comma.
- Writing
http://schema.orgin one place andhttps://schema.orgin another without a reason. - Adding several blocks that contradict each other, such as two different business names.
- Treating valid markup as a promise of a rich result. Google decides whether to show one.
Frequently asked questions
Is JSON-LD better than Microdata?
It is easier to maintain because it sits in one block, and Google recommends it. Microdata still works, and both describe the same vocabulary.
Does JSON-LD improve my rankings?
Google does not say it is a ranking factor. It helps search engines understand a page and can make a page eligible for some rich results.
Can I have more than one JSON-LD block on a page?
Yes. Use a separate block for each item, or one block with a list, as long as the facts agree with each other and with the page.
Related guides
- JSON-LD testing and validation
- JSON-LD vs Microdata
- JSON-LD testing tool
- How to use the Rich Results Test
To see what your pages already declare, Try the free website sample.