HTML Microdata: Items, Properties, Vocabularies and Machine-Readable Markup
How HTML microdata models items and properties, pairs them with vocabularies like schema.org, and what parsers and crawlers expect.
This page summarises the WHATWG HTML microdata specification and how authors typically apply it with shared vocabularies. Schema.org’s microdata guide and Bing Webmaster structured-data documentation describe the same attribute pattern from a publisher perspective: annotate visible content so scripts and crawlers can read types and properties without changing what visitors see.
Microdata: what machine-readable labels add to HTML
Section titled “Microdata: what machine-readable labels add to HTML”Microdata adds nested groups of name–value pairs beside normal page content.
For this purpose, authors can use the microdata features described in this section. Microdata allows nested groups of name-value pairs to be added to documents, in parallel with the existing content.
— WHATWG, 5 Microdata — Overview
Schema.org states the practical motivation plainly:
By adding additional tags to the HTML of your web pages—tags that say, “Hey search engine, this information describes this specific movie, or place, or person, or video”—you can help search engines and other applications better understand your content and display it in a useful, relevant way. Microdata is a set of tags, introduced with HTML5, that allows you to do this.
— Schema.org, Getting started with schema.org using Microdata — Why use microdata?
Microdata is one supported annotation format among several; Bing accepts Schema.org in microdata, JSON-LD, microformats, RDFa, and Open Graph, without preferring one syntax over another.
itemscope and itemtype: how to start a typed item
Section titled “itemscope and itemtype: how to start a typed item”An item begins on an element that carries itemscope. The type (vocabulary term for that item) is a URL on the same element as itemscope, via itemtype.
The type for an item is given as the value of an itemtype attribute on the same element as the itemscope attribute.
— WHATWG, 5 Microdata — Typed items
Schema.org’s walkthrough uses https://schema.org/Movie on a wrapper div and itemprop on child elements for name, director, genre, and trailer. Types are always URL identifiers; for Schema.org they are URLs under https://schema.org/.
Multiple types on one item
Section titled “Multiple types on one item”Several types that share the same vocabulary may appear as a space-separated list in one itemtype value. An item cannot combine two types whose vocabularies do not match.
Multiple types defined to use the same vocabulary can be given for a single item by listing the URLs as a space-separated list in the attribute’ value. An item cannot be given two types if they do not use the same vocabulary, however.
— WHATWG, 5 Microdata — Typed items
itemprop: properties, nested items, and itemref
Section titled “itemprop: properties, nested items, and itemref”Each property name is declared with itemprop on an element that belongs to an item. One element may expose several property names (space-separated tokens in itemprop).
When a property’s value is another item, the same element has both itemprop and itemscope (and usually itemtype):
Sometimes the value of an item property can itself be another item with its own set of properties. … you begin a new itemscope immediately after the corresponding itemprop.
— Schema.org, Getting started with schema.org using Microdata — Embedded items
Properties can also be gathered from elsewhere in the document using itemref: the attribute lists element IDs whose descendants contribute properties, as in the license example in the WHATWG spec where two figure items share one footer license link.
itemid: global identifiers
Section titled “itemid: global identifiers”Vocabularies may define how an item links to a real-world id (ISBN, etc.) through itemid:
Vocabularies (as identified by the itemtype attribute) can be designed such that items get associated with their global identifier in an unambiguous way by expressing the global identifiers as URLs given in an itemid attribute.
The meaning of each itemid URL is defined by the vocabulary, not by HTML alone.
The microdata model: items, properties, and values
Section titled “The microdata model: items, properties, and values”Normatively, microdata is a tree of items, each with optional types, an optional global id, and unordered property names; each property holds one or more values in order.
The microdata model consists of groups of name-value pairs known as items.
— WHATWG, 5 Microdata — The microdata model
| Concept | HTML signal | Value shape |
|---|---|---|
| Item | itemscope on an element |
String and/or nested items |
| Type | itemtype URL(s) |
Defines vocabulary context |
| Property | itemprop on elements found for the item |
One or more values per name |
| Top-level item | itemscope without itemprop on the same element |
Listed in JSON export as top-level entries |
An element with itemscope and itemprop on the same node yields a property whose value is the nested item (first matching rule in the value algorithm).
How user agents derive a property value from markup
Section titled “How user agents derive a property value from markup”The WHATWG value rules pick the first matching case:
| Element situation | Property value |
|---|---|
Also has itemscope |
The item rooted on that element |
meta |
content, or empty string |
Media/link elements (img, a, video, …) |
Parsed absolute URL from src/href/data, or empty |
data, meter |
value attribute |
time |
datetime value |
| Otherwise | Descendant text content |
URL property elements are a, area, audio, embed, iframe, img, link, object, source, track, and video. If a vocabulary defines a property as an absolute URL, that property must use one of those elements—not merely text that looks like a URL.
These requirements do not apply just because a property value happens to match the syntax for a URL. They only apply if the property is explicitly defined as taking such a value.
— WHATWG, 5 Microdata — Values
For human-visible dates, times, and durations, Schema.org recommends wrapping machine-readable ISO 8601 values in time with datetime, and using meta with content when the fact is not visible on the page (sparingly).
Vocabularies: designing and reusing property names
Section titled “Vocabularies: designing and reusing property names”Using microdata means committing to a vocabulary: property names only make sense relative to an itemtype.
Where possible, authors are encouraged to re-use existing vocabularies, as this makes content re-use easier.
— WHATWG, 5 Microdata — Selecting names when defining vocabularies
| Property name style | Scope |
|---|---|
Plain word (no . or :) |
Intended for specific types; not globally unique alone |
| URL | Reusable across item types; avoids collisions when you control the URL space |
Authors may mix URL-named properties from another vocabulary on a typed item (see the Hedral cat example in Typed items).
Common publisher vocabularies in this cluster include schema.org types (for example Movie, Person, Event, Offer) and the older data-vocabulary.org types still shown in Bing examples (Organization, Person, Event, Recipe, Review, Breadcrumb).
Microdata errors: itemref, orphans, and cycles
Section titled “Microdata errors: itemref, orphans, and cycles”The algorithm that associates names with items flags microdata errors when:
itemrefresolution revisits an element already in memory (cycles or duplicates in the walk),- any item’s property scan reports an error,
itemrefgraphs contain cycles between nested items,- an
itempropelement is not a property of any item in the document.
A top-level microdata item has itemscope but no itemprop on that element. Only top-level items appear in the default JSON extraction list.
application/microdata+json: JSON export of items
Section titled “application/microdata+json: JSON export of items”User agents may serialize microdata to JSON. IANA registers the media type application/microdata+json for JSON whose top-level object has a single items array; each entry has type, optional id, and a properties object whose values are arrays of strings or nested objects.
Labeling a resource with the application/microdata+json type asserts that the resource is a JSON text that consists of an object with a single entry called “items” consisting of an array of entries…
— WHATWG, 17.5 application/microdata+json
The WHATWG JSON algorithm documents nested BlogPosting / UserComments output; cyclic nested items become the string "ERROR" in JSON.
Publisher patterns: breadcrumbs, contacts, and offers
Section titled “Publisher patterns: breadcrumbs, contacts, and offers”Bing’s microdata examples illustrate recurring shapes (vocabulary URLs may differ from modern Schema.org, but the HTML mechanics are the same).
Breadcrumb trails and nested child
Section titled “Breadcrumb trails and nested child”For one trail, each crumb is its own itemscope with itemtype http://data-vocabulary.org/Breadcrumb, plus url and title. For multiple trails, nested itemprop="child" links crumbs into a tree.
Organizations, people, and events
Section titled “Organizations, people, and events”Organization markup nests Address and optional Geo via meta for latitude and longitude. People add title, affiliation, and address sub-properties. Events combine startDate / endDate with ISO 8601 in datetime and embed location as another item.
Products, recipes, and reviews
Section titled “Products, recipes, and reviews”Product and offer blocks nest offerDetails with price, availability, and hidden meta for currency. Recipes chain Recipe, Review-aggregate, Nutrition, and RecipeIngredient items; durations use time with values like PT30M. Reviews and aggregated ratings embed a Rating item; star images can be backed by meta or alt numeric values per Bing’s notes.
What crawlers expect: validation and rich results
Section titled “What crawlers expect: validation and rich results”Annotations do not change visible layout; they supply typed fields for extraction.
Annotating your data doesn’t actually change the visible content, but gives Bing valuable information on the type of content you’re hosting on your site.
— Bing, Marking up your site: Overview
Bing states that rich snippets are not guaranteed: annotations must match on-page content, validate against the chosen schema and data types, and include enough required fields (for example an event without a date may be ignored). The same overview notes that visually rich snippets are not available in every market even when data validates.
Schema.org adds editorial rules: mark up content people can see, prefer complete types, and use meta/link only when visible markup cannot carry the machine value.
Common mistakes
Section titled “Common mistakes”- Using plain text for URL-valued properties when the vocabulary requires a URL property element.
itempropon nodes that no item owns (invalid in the spec’s property algorithm).- Cycles or broken
itemrefID references. - Putting
itemscopeon SVG, expecting a second item. - Mixing two
itemtypeURLs that do not share one vocabulary. - Hiding main facts only in markup while contradicting visible text (crawlers relate annotations to surrounding content).
How to check this on your site
Section titled “How to check this on your site”- View source on a page with structured data and confirm each logical entity has
itemscope, a vocabulary URL initemtype, anditempropon elements that belong to that item (including nested items and anyitemreftargets). - Check URL properties (
url,img, …) on appropriate elements (a,img,link, …) and dates ontimewith validdatetimeper Schema.org’s date guidance. - Re-read Bing’s validation notes: required fields present, types match values (price not a date), and annotated text aligns with what users see.
- For complex pages, compare your markup mentally to the WHATWG JSON extraction example to ensure top-level items and nested
itemscope/itempropstructure match what a parser would emit. - You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact sentence you are asking about.