Currently no standard has been established for physical measurements such as dimensions, volume, mass, speed, temperature, etc.
This image shows a sample UI that will be made possible if such a standard existed:
The Problem
The measuring systems in modern use are the metric, imperial, and US customary systems and web users are forced to interrupt their browsing journey to convert units that are not native to them.
Google Search has been answering conversion queries for at least 16 years so we can infer that the demand for unit conversion is indeed huge.
A standard like that would provide hooks for measurements, which would make client-side conversion of units between measurement systems much easier to accomplish. Any site would then be able write a script to convert it, browsers extensions could be easily created to convert units across the web, and browsers themselves could offer it as built-in function similar to page translation (available in Chrome and Safari).
Idea with a new HTML element
I’ve written a short essay proposing a <m>
element, but the same applies to also using <data>
or something else. A basic structure would look like this:
<m unit="mi" value="20">twenty miles</m>
Challenges
The main problem that needs solving is establishing a standard for the markup:
- which semantic element(s) to use
- what unit code standard to use in attributes
All these have to make physical measurements machine-readable and easy to implement at the same time.