Codectionary / Developer documentation / HTML

<data>

The <data> element links a piece of content with a machine-readable value via its value attribute, similar in spirit to <time> but for values other than dates — like product IDs, prices, or measurements. This lets scripts and other tools programmatically access the underlying value while humans see the friendly, formatted text.

Syntax

<data value="12345">Product #12345</data>

Examples

Product Listing

Attaching a machine-readable product ID to its display name.

<ul>
  <li><data value="SKU-001">Wireless Mouse</data> - $24.99</li>
  <li><data value="SKU-002">Mechanical Keyboard</data> - $89.99</li>
</ul>

Formatted Measurement

Showing a human-friendly value with a precise machine value behind it.

<p>Distance: <data value="42195">26.2 miles</data></p>

Attributes

  • value (string): The machine-readable value associated with the content

Best practices

  • Use <time> instead of <data> specifically for dates and times — data is for everything else
  • Use data when a script elsewhere on the page needs to read the underlying value (e.g., for sorting or filtering)
  • Keep the visible content human-readable while the value attribute holds the precise machine value
  • Do not use data purely as a generic wrapper — only when there is a genuine machine-readable value to attach

Browser compatibility

Support applies to the named feature, not every attribute or behaviour in this article. Versions refer to browsers, not operating systems.

<data>

Desktop

Chrome
Supported
From 62
Firefox
Supported
From 22
Safari
Supported
From 10
Edge
Supported
From 14
Opera
Supported
From 49

Mobile

Safari on iOS
Supported
From 10
Chrome for Android
Supported
From 62
Firefox for Android
Supported
From 22
Samsung Internet
Supported
From 8.0

MDN BCD record for this feature · MDN reference

Support history and limitations

Chrome

  • From 62

Firefox

  • From 22

Safari

  • From 10

Edge

  • From 14

Opera

  • From 49

Safari on iOS

  • From 10

Chrome for Android

  • From 62

Firefox for Android

  • From 22

Samsung Internet

  • From 8.0
<data> value

Desktop

Chrome
Supported
From 62
Firefox
Supported
From 22
Safari
Supported
From 10
Edge
Supported
From 14
Opera
Supported
From 49

Mobile

Safari on iOS
Supported
From 10
Chrome for Android
Supported
From 62
Firefox for Android
Supported
From 22
Samsung Internet
Supported
From 8.0

MDN BCD record for this feature

Support history and limitations

Chrome

  • From 62

Firefox

  • From 22

Safari

  • From 10

Edge

  • From 14

Opera

  • From 49

Safari on iOS

  • From 10

Chrome for Android

  • From 62

Firefox for Android

  • From 22

Samsung Internet

  • From 8.0

MDN BCD 8.1.5 · Dataset built 2026-10-08 · Mapping reviewed 2026-10-21. These dates are not individual browser-test or claim-verification dates. Unknown means the data does not establish support.

HTML Living Standard

Specifications & further reading