hCard is a simple HTML microformat that encodes contact details (the equivalent of a digital business card) inside web pages so they can be extracted by tools and services. It adapts the widely used vCard model into markup: names, organizations, addresses, telephone numbers and URLs are represented with specific class names so machines can parse them while browsers show the same content to users. For a general description of publishing contact information see contact information.
Structure and common properties
hCard is class-based: a block carrying contact data is marked up with a class such as vcard, and individual properties appear as elements with classes like fn (formatted name), org, adr, tel, email and url. Typical parts include:
- fn — full name
- org — employer or organization (used for companies and groups: company info)
- adr — address components such as street-address, locality, region and postal-code
- tel, email, url — contact channels
Because classes are ordinary HTML attributes, hCard works in XHTML and HTML documents and can be embedded inside feeds, directories, user profiles and listings. It is commonly encountered in webpages for people, organizations and places; for examples with organizations see organization entries.
History and formats
hCard originated as part of the microformats movement that sought to reuse existing HTML semantics rather than inventing new syntaxes. It mirrors the vCard concept used for exchanging contact cards, but maps vCard fields to HTML classes so the same visible content remains readable to humans. Implementations have used hCard in older XHTML pages as well as in feed formats such as Atom and RSS; it can also be represented in raw XML for specialized processing. See mentions of usage in XHTML, Atom and raw XML.
Uses, tools and compatibility
Practical uses of hCard include automated importing of contact details into address books, aggregating directories, improving search engine understanding of contact data, and enabling browser extensions or scripts to offer one‑click actions (call, email, map). Parsers and libraries exist in many programming languages; some platforms also support later conventions such as microformats2 (h-card) which updated naming and parsing rules while preserving compatibility with the original idea.
When publishing hCard, best practices are to use semantic class names accurately, include explicit components for addresses and names, and validate with available microformat validators or tools. While other standards (for example native vCard files or schema.org markup) can also convey contact information, hCard remains a lightweight way to keep human-readable HTML and machine-readable data in the same source.