HTML FORMAT

Microdata

HTML Microdata

Microdata is a syntax for embedding machine-readable structured data directly inside ordinary HTML markup. It is defined as part of the WHATWG HTML Living Standard (having earlier been a separate W3C draft that was nearly discontinued in 2013 before new editors revived it). Rather than a standalone file format, Microdata is a set of global HTML attributes that annotate existing visible content, so the same DOM elements serve both human readers and automated consumers such as search-engine crawlers.

The data model expresses a set of items, each a group of name/value pairs called properties. Five attributes drive it: itemscope declares a new item on any element; itemtype gives the item a vocabulary type as an absolute URL; itemprop names a property; itemid supplies a global identifier when the vocabulary allows one; and itemref pulls in properties from non-descendant elements referenced by id. Property values are usually the element's text, but URL-bearing elements contribute their href, src, or data attribute, and meta, data, meter, and time elements expose machine-readable values via content, value, or datetime. An itemprop element that also carries itemscope nests one item inside another, producing a tree of typed entities. The specification defines an algorithm for extracting these items into a JSON structure, making Microdata straightforward to harvest programmatically.

In practice Microdata is almost always paired with schema.org vocabularies (Person, Product, Event, Organization, Recipe, and so on), the shared type system that Google, Microsoft, Yahoo, and Yandex created for rich results. Because those same vocabularies also back RDFa and JSON-LD, the three formats are largely interchangeable at the semantic level and can be transcoded between one another; conceptually the extracted graph maps onto RDF triples and can be lifted into formats such as Turtle, JSON-LD, or N-Triples.

Its strengths are simplicity relative to RDFa and the fact that the markup lives on the visible content it describes, reducing drift between page and metadata. The limitations are notable: no major browser implements the Microdata DOM API, the format is more verbose and error-prone to hand-author than a separate block, and Google now recommends JSON-LD as the default because it keeps structured data in one script element decoupled from presentational HTML. Microdata remains widely deployed and fully supported by crawlers, but new projects increasingly choose JSON-LD.

Alternative Names: Microdata

Tools(Read & Write)

Frequently Asked Questions

What is a HTML Microdata file?

A HTML Microdata file stores a graph — its nodes, edges and attributes — in the HTML Microdata format (also: Microdata). See the feature table above for what it supports.

How do I open a HTML Microdata file?

Open it in a graph tool that supports HTML Microdata, or convert it to a format your tool reads. With GraphInOut you can convert HTML Microdata to GraphML, DOT, Connected JSON and more, right in your browser.

How do I convert a HTML Microdata file to another format?

Use the Convert from HTML Microdata link above: upload or paste your HTML Microdata file (input preset to HTML Microdata), choose a target format and download the result — free, no install.