Microformats ( μF) are predefined HTML markup (like HTML classes) created to serve as descriptive and consistent metadata about HTML element, designating them as representing a certain type of data (such as address book, geographic coordinates, events, products, recipes, etc.). They allow software agent to process the information reliably by having set classes refer to a specific type of data rather than being arbitrary.
Microformats emerged around 2005 and were predominantly designed for use by search engines, web syndication and news aggregator such as RSS. Google confirmed in 2020 that it still parses microformats for use in content indexing. Microformats are referenced in several W3C social web specifications, including IndieAuth and Webmention.
Although the content of web pages has been capable of some "automated processing" since the inception of the web, such processing is difficult because the markup language used to display information on the web do not describe what the information means. Microformats can bridge this gap by attaching semantics, and thereby obviating other, more complicated, methods of automated processing, such as natural language processing or screen scraping. The use, adoption and processing of microformats enables data items to be indexed, searched for, saved or cross-referenced, so that information can be reused or combined.
, microformats allow the encoding and extraction of event details, contact information, social relationships and similar information.
Microformats2, abbreviated as mf2, is the updated version of microformats. Mf2 provides an easier way of interpreting HTML structured syntax and vocabularies than the earlier ways that made use of RDFa and microdata.
CommerceNet, a nonprofit organization that promotes e-commerce on the Internet, has helped sponsor and promote the technology and support the microformats community in various ways. CommerceNet also helped co-found the Microformats.org community site.
Neither CommerceNet nor Microformats.org operates as a standards body. The microformats community functions through an open wiki, a mailing list, and an Internet relay chat (IRC) channel. Most of the existing microformats originated at the Microformats.org wiki and the associated mailing list by a process of gathering examples of web-publishing behaviour, then codifying it. Some other microformats (such as nofollow and unAPI) have been proposed, or developed, elsewhere.
For example, in the text "The birds roosted at 52.48, -1.89" is a pair of numbers which may be understood, from their context, to be a set of geographic coordinates. With wrapping in spans (or other HTML elements) with specific class names (in this case geo, latitude and longitude, all part of the geo microformat specification):
The birds roosted at 52.48, -1.89
Software agents can recognize exactly what each value represents and can then perform a variety of tasks such as indexing, locating it on a map and exporting it to a GPS device.
- Joe Doe
- The Example Company
- 604-555-1234
- http://example.com/
With hCard microformat markup, that becomes:
- Joe Doe
- The Example Company
- 604-555-1234
- http://example.com/
Here, the formatted name (fn), organisation (org), telephone number (tel) and web address (url) have been identified using specific class names and the whole thing is wrapped in class="vcard", which indicates that the other classes form an hCard (short for "HTML vCard") and are not merely coincidentally named. Other, optional, hCard classes also exist. Software, such as browser plug-ins, can now extract the information, and transfer it to other applications, such as an address book.
Several browser extensions, such as Operator for Firefox and Oomph for Internet Explorer, provide the ability to detect microformats within an HTML document. When hCard or hCalendar are involved, such browser extensions allow microformats to be exported into formats compatible with contact management and calendar utilities, such as Microsoft Outlook. When dealing with geographical coordinates, they allow the location to be sent to applications such as Google Maps. Yahoo! Query Language can be used to extract microformats from web pages. On 12 May 2009 Google Search announced that they would be parsing the hCard, hReview and hProduct microformats, and using them to populate search result pages. They subsequently extended this in 2010 to use hCalendar for events and hRecipe for cookery recipes. Similarly, microformats are also processed by Bing and Yahoo!. As of late 2010, these are the world's top three search engines.
Microsoft said in 2006 that they needed to incorporate microformats into upcoming projects, as did other software companies.
Alex Faaborg summarizes the arguments for putting the responsibility for microformat user interfaces in the web browser rather than making more complicated HTML:
One advocate of microformats, Tantek Çelik, characterized a problem with alternative approaches:
For some applications the use of other approaches may be valid. If the type of data to be described does not map to an existing microformat, RDFa can embed arbitrary vocabularies into HTML, such as for example domain-specific scientific data such as zoological or chemical data for which there is no microformat. Standards such as W3C's GRDDL allow microformats to be converted into data compatible with the Semantic Web.
Another advocate of microformats, Ryan King, put the compatibility of microformats with other approaches this way:
Using microformats2, the example above would be marked up as:
52.48,
-1.89
and:
|
|