Superscript one, two and three in HTML
Three superscript digits have their own Latin-1 characters and named entities: one, two and three, written ¹, ² and ³.
At a glance
- Character
- ¹ ² ³
- Named entity
- ¹ ² ³
- Decimal reference
- ¹ ² ³
- Hex reference
- ¹ ² ³
- Unicode code point
- U+00B9, U+00B2, U+00B3
- Unicode name
- SUPERSCRIPT ONE, TWO, THREE
- In the entity reference
- Fractions
In detail
The reason only three digits have Latin-1 characters is historical: they were the ones needed for square metres, cubic metres and footnote markers in western European typesetting, so they went into the single byte encodings and the rest did not. The complete set of superscript digits, along with a superscript plus, minus, equals and brackets, lives in the Superscripts and Subscripts block from U+2070 and has no named entities.
That split leaves an awkward gap. Zero, and four through nine, are at U+2070 and U+2074 onward, so a superscript ten needs one character from Latin-1 and one from the newer block, drawn by whatever fonts the browser picks. In practice they usually match, but a mixed exponent is exactly the sort of thing that breaks in a fallback font.
The alternative is the sup element, which raises ordinary digits with CSS and therefore handles any exponent consistently, in one font, at a size you control. Its disadvantage is that copying the text loses the raising: an area written as square metres with the element copies as m2, which is fine, while the character copies as the superscript glyph, which is more faithful and less parseable.
That gives a usable rule. Use the characters for units and short exponents inside running prose, where the value is being read rather than reused. Use the element inside anything structured, tables of exponents or generated formulas, where the digits need to be consistent and the exponent might be any number.
Examples
<p>The plot is 240 m² over two floors.</p>
<p>Volume in cm³, mass in g.</p><p>character based: 2⁶ (U+2076)</p>
<p>element based: 2<sup>6</sup></p>Only the element approach scales to arbitrary exponents in a single consistent font.
Things that catch people out
- Superscript digits beyond three come from a different Unicode block and can be drawn by a different fallback font, giving an exponent whose digits do not match each other.
- Search engines and site search treat the superscript character and the plain digit as different characters, so a page about square metres may not match a query typed with a plain 2.
- Using the sup element for a unit exponent makes the unit selectable as two separate looking pieces, which matters if users copy values into a spreadsheet.
Try it: HTML Entity Reference
Search 152 entities across 9 categories, switch the copy format between the character, the name, the decimal form and the hex form, and copy in one click.
HTML Entity Reference
LOCAL · Browser-OnlySearchable reference of 150+ HTML entities with one-click copy in any format
152 entities across 9 categories
Commonly Used
→Arrows(13)
±Math(35)
$Currency(8)
…Punctuation(21)
©Symbols(24)
πGreek(30)
½Fractions(6)
●Geometric(7)
æLatin Special(8)
Click any entity card to copy it in your chosen format. All data is embedded in the page and works offline.
Related HTML entities
All html entities →Fraction characters: one half, one quarter, three quarters
The vulgar fraction characters at U+00BC, U+00BD and U+00BE, their entity forms, the wider fraction block, and when a fraction slash is the better answer.
Degree sign (°) in HTML
The degree sign at U+00B0, its entity forms, the spacing rule that differs between temperatures and angles, and the three characters it gets confused with.
Dagger (†) and double dagger (‡)
The dagger at U+2020 and double dagger at U+2021, the traditional footnote symbol order, the case sensitive entity names, and the date convention.
Mathematical operator entities: sets, logic and calculus
Named entities for summation, integral, partial differential, set membership, union, intersection and the logical connectives, with their code points.
Right arrow (→) in HTML
The rightwards arrow at U+2192, its entity forms, using it in a call to action without confusing a screen reader, and how it behaves in right to left text.
Left arrow (←) in HTML
The leftwards arrow at U+2190, its entity forms, why a back link needs a real destination, and the direction problem in right to left interfaces.
Tools for this
- HTML Entity Reference Free online HTML entity reference - search and copy HTML entities with live preview
- Unicode Character Finder Free online unicode character finder - search and copy special Unicode characters and symbols