The HTML itemscope attribute
The HTML itemscope attribute marks an element as a microdata item: a group of related name-value pairs. It is a boolean global attribute, almost always paired with itemtype to declare what kind of thing the item is (for example a Product or Person from schema.org).
Overview
Microdata lets you embed machine-readable structured data in ordinary HTML. The itemscope attribute is where an item begins: it declares that the element and its descendants describe a single thing.
On its own itemscope just opens an item; you pair it with itemtype to say what the thing is, add itemprop attributes for each property, and may give it a global id with itemid. Search engines read this data to build rich results. Today many developers prefer JSON-LD for the same job, but microdata remains valid and useful when the data lives in your visible markup.
Syntax
<div itemscope itemtype="https://schema.org/Person">
<span itemprop="name">Ada Lovelace</span>
</div>
Values
| Value |
|---|
| itemscope (boolean) |
Example
<div itemscope itemtype="https://schema.org/Person">
<span itemprop="name">Ada Lovelace</span> — <span itemprop="jobTitle">Mathematician</span>
</div>
Best practices
- Pair
itemscopewith an itemtype so the item has a defined vocabulary. - Nest
itemscopeitems to describe complex, related data. - Validate your markup with Google's Rich Results Test.
- Consider JSON-LD as an alternative when the data is not part of the visible content.
Accessibility
Microdata attributes are metadata for machines — they do not change how an element looks or how it is announced by assistive technology. Adding itemscope has no effect on the user-facing experience.
Frequently asked questions
What is the itemscope attribute?
What is the difference between itemscope and itemtype?
itemscope starts the item; itemtype says what type of thing it is, using a vocabulary URL such as https://schema.org/Product.