References

Beginner-friendly references for web development, with live, editable examples.

The HTML itemtype attribute

Global attribute Works on every element All modern browsers Updated
Quick answer

The HTML itemtype attribute specifies the vocabulary URL — usually a schema.org type such as https://schema.org/Product — that defines the available properties of a microdata item. Use it on the same element as itemscope.

Overview

The itemtype attribute names the vocabulary that describes a microdata item. It is set on the element that carries itemscope, and its value is an absolute URL — almost always a schema.org type like https://schema.org/Recipe or https://schema.org/Product.

Once the type is set, the itemprop names you use inside the item should match the properties that type defines, so search engines can interpret them correctly.

Syntax

<div itemscope itemtype="https://schema.org/Product"> … </div>

Values

Value
A valid URL identifying the vocabulary (e.g. https://schema.org/Product).

Example

Live example
<div itemscope itemtype="https://schema.org/Person">
  <span itemprop="name">Ada Lovelace</span>
</div>

Best practices

  • Use a consistent vocabulary (such as schema.org) via itemtype.
  • Start an item with itemscope and describe its fields with itemprop.
  • Consider JSON-LD as an alternative — many teams find it easier to maintain than inline microdata.
  • Validate your structured data with a testing tool.

Frequently asked questions

What does the itemtype attribute do?
Specifies the vocabulary to which the item relates to.
What is HTML microdata?
A way to mark up structured data inline using itemscope, itemprop and related attributes so machines can read it.
Should I use microdata or JSON-LD?
Both work. JSON-LD keeps structured data in one script block and is often easier to maintain; microdata annotates the visible markup directly.
Is itemtype a global attribute?
Yes — it is a global attribute, so it can be set on any HTML element (it is a global attribute).