Sub topic 1
Why pages need structured data
Prerequisites
This chapter assumes you know basic HTML, including the script element. You should also read JSON comfortably: objects, arrays, strings, numbers, and booleans. Finally, you should know what a URL is and how a web page gets published. No prior knowledge of schema.org or JSON-LD is needed.
The problem: pages are written for people
A web page is written for human readers. A person looking at a recipe page sees a title, a photo, a cooking time, and a star rating. They infer which number is the cooking time because of its position, its label, and the layout around it.
A program has none of that context. A crawler (software that downloads pages automatically) receives HTML. The HTML says how to display things, such as headings, paragraphs, and bold text. It does not say what the content means.
Consider this fragment:
<h1>Stainless Steel Pour-Over Kettle</h1>
<p>39.90 EUR</p>
<p>In stock</p>A person reads this as a product with a price and an availability. A program sees a heading and two paragraphs. It can guess, and guessing works for common layouts. It fails often enough on the long tail of real sites that guessing is a poor foundation.
Structured data fixes this by adding a second, machine-readable description of the same content. The description states explicitly that this page is about a product, that the product has this name, and that it costs 39.90 in euros.
What structured data is
Structured data is information that follows an agreed format, so a program can read each piece without interpreting layout or prose. A database table is structured data. A paragraph of text is not.
For web pages, structured data has two parts that solve different problems:
- A syntax decides how the data is written down. It answers the question "how do I express a name and a value in a file?"
- A vocabulary decides what the words mean. It answers the question "what does the word
pricerefer to, and what kind of value goes there?"
This tutorial uses one choice for each:
| Part | Choice | What it provides |
|---|---|---|
| Syntax | JSON-LD | A way to write data as JSON, with a few extra keywords that attach meaning |
| Vocabulary | schema.org | A shared list of types (such as `Product`) and properties (such as `price`) |
Keeping the two apart is useful. You could write schema.org terms in another syntax, and you could use JSON-LD with a vocabulary other than schema.org. The next chapters cover each part in turn.
JSON-LD in one example
JSON-LD stands for JSON for Linked Data. It is valid JSON with a small set of reserved keywords that start with @. Here is the kettle from above, described for a machine:
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Stainless Steel Pour-Over Kettle",
"offers": {
"@type": "Offer",
"price": "39.90",
"priceCurrency": "EUR",
"availability": "https://schema.org/InStock"
}
}Each line has a job:
@contextsays which vocabulary the terms come from. Here it is schema.org.@typesays what kind of thing the object describes: aProduct, then anOffer.- The remaining keys, such as
nameandprice, are properties of that thing. - The
offersproperty holds another object, so the price belongs to the product through an explicit relationship, not through proximity on the page.
You do not need to remember these details yet. The point is that every fact now has a label that any program can look up.
Why it matters in practice
Search engines can understand and present your content
Search engines read structured data to learn what a page is about. Google, for example, uses it to decide whether a page is eligible for enhanced search listings, called rich results. Examples include star ratings under a recipe, a price and stock status under a product, or a breadcrumb trail in place of a raw URL.
Structured data does not guarantee a rich result, and it is not a ranking switch. It makes your content easier to interpret, and it may make the page eligible for richer display. Chapter "How search engines use structured data" covers the limits in detail.
One description serves many consumers
Search engines are the best-known consumer, but not the only one. Social platforms, assistants, shopping aggregators, and internal tools can all read the same markup. If you describe the page once, in a standard way, each of them can use it without a custom integration.
The data is separate from the layout
With JSON-LD, the description lives in its own block, apart from the visible HTML. A redesign that moves the price from the sidebar to the header does not touch the markup. Your template code can also build the block from the same data that fills the page, which keeps the two consistent.
Where the markup lives
JSON-LD is placed in a script element whose type is application/ld+json. Browsers do not run it as code, and they do not display it. The element only carries data.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "How to Brew Cold Coffee",
"datePublished": "2026-03-14T08:00:00+00:00",
"image": "https://example.com/images/cold-coffee.jpg",
"author": {
"@type": "Person",
"name": "Ana Torres",
"url": "https://example.com/authors/ana"
}
}
</script>This block describes an article and its author. A person reading the page sees the same headline and author name in the visible text. The markup repeats those facts in a form a program can read directly.
The diagram below shows the flow from page to consumer.
Alternatives, briefly
JSON-LD is not the only way to add structured data. Two older syntaxes, Microdata and RDFa, attach the same vocabulary directly to HTML elements through attributes. They work, but they mix the description into the page markup. Changing the layout can break the description, and the HTML becomes harder to read.
JSON-LD keeps the description in one block. Google states a preference for JSON-LD for this reason. A later chapter compares the three syntaxes in detail.
Common misconceptions
- "Structured data makes a page rank higher." It helps machines understand the page. It does not boost rankings by itself.
- "I can describe things that are not on the page." Markup should match what visitors can see. Describing content that is hidden or absent can violate search engine guidelines and may cost you rich result eligibility.
- "Valid JSON is enough." The JSON must also use real schema.org types and properties, with the value types they expect. A file can parse as JSON and still say nothing a consumer can use.
- "It replaces good HTML." Structured data adds to semantic HTML. It does not substitute for headings, text, and links.
What you will build in this tutorial
The chapters that follow take you through the pieces in order:
- The JSON-LD syntax and the schema.org vocabulary.
@context,@type, properties, and the value types they expect.- Relating entities by nesting, by
@id, and by@graph. - Embedding the markup in HTML.
- Common types:
Article,Organization,ProductwithOffer, andBreadcrumbList. - Validation with the Schema Markup Validator and Google's Rich Results Test.
- Generating markup safely from application data, and keeping it correct over time.
Check your understanding
Exercise
A colleague says, "Our product page already shows the price clearly, so structured data adds nothing." Give two reasons this is incomplete.
Show answer
First, a program cannot reliably tell which number on the page is the price, which currency it uses, or whether the item is in stock, because HTML describes presentation and not meaning. Structured data states these facts explicitly using shared vocabulary terms such as price, priceCurrency, and availability. Second, the same markup can make the page eligible for rich results in search and can be read by other tools without custom parsing. The visible price stays useful for people, and the markup must match it.
Exercise
Name the two parts of a structured data approach and say which one JSON-LD and which one schema.org provides.
Show answer
The two parts are a syntax and a vocabulary. JSON-LD is the syntax: it defines how the data is written, as JSON with keywords such as @context and @type. schema.org is the vocabulary: it defines the shared types and properties, such as Product and price, and what they mean.
Exercise
A page's JSON-LD says a product costs "29.00", but the visible page shows 39.90. The JSON parses without errors. Is the markup acceptable? Explain.
Show answer
No. Valid JSON syntax does not make the markup correct. Structured data must match the content visitors can see. A price mismatch misleads consumers and can violate search engine guidelines, which may remove the page's eligibility for rich results. Fix the markup, or better, generate both from the same data source.