More
More
Superscript Two HTML entity ²
² is the HTML entity for Superscript Two ² (U+00B2). Copy the decimal ² and hex ² codes plus CSS, JavaScript, Python and URL escapes.
- Entity
²- Legacy form
²(no semicolon)- Code point
- U+00B2
- Unicode name
- SUPERSCRIPT TWO
- Block
- Latin-1 Supplement
- Category
- Other number (No)
- Since
- Unicode 1.1
- Defined in
- HTML 4.01 and HTML5
Codes to copy
| HTML named | ²Works in HTML; in XML only & < > " ' are predefined. | |
|---|---|---|
| HTML decimal | ²Works in HTML and XML. | |
| HTML hex | ²Works in HTML and XML. | |
| CSS | content: "\B2";In a stylesheet, for ::before and ::after. | |
| JavaScript | "\u00B2"Also valid in JSON. | |
| Python | "\u00b2"Python 3 string literal. | |
| Python by name | "\N{SUPERSCRIPT TWO}"Readable alternative using the Unicode name. | |
| URL | %C2%B2Percent-encoded UTF-8 bytes, for a path or query value. | |
| UTF-8 bytes | C2 B22 bytes. | |
| UTF-16 | 00B21 code unit, which is what JavaScript length counts. |
When to use it
Superscript two for squares: m², km². Only 1, 2 and 3 are in Latin-1 with names; for other exponents, <sup> gives consistent results.
The name dates from HTML 4, so it works in every browser and in old email clients.
Browsers also accept the legacy form ² without a semicolon, for compatibility with old pages; new HTML should always end the reference with a semicolon.
More letterlike symbols, numbers and fractions
¹Superscript One¼One Quarter Fraction½One Half Fraction¾Three Quarters FractionℂDouble-Struck Capital C℅Care ofℋScript Capital HℌBlack-Letter Capital H
All letterlike symbols, numbers and fractions · Every HTML entity · Encode or decode text
Source: the WHATWG HTML Standard list of named character references and the Unicode Character Database (Unicode 18.0).