HTML Entity for Superscript Digit Two (²)

What You'll Learn
How to display the superscript digit two (²) in HTML using hex, decimal, the named entity ², and a CSS escape. It is commonly used for exponents (x²) and square units (m², km², ft²).
Superscript Two belongs to the Latin‑1 Supplement Unicode block and is referenced as Unicode U+00B2.
⚡ Quick Reference — Superscript Two (²)
U+00B2Latin-1 Supplement block
²Hexadecimal reference
²Decimal reference
²Readable and widely supported
Name Value
──────────── ──────────
Unicode U+00B2
Hex code ²
HTML code ²
Named entity ²
CSS code \00B2Complete HTML Example
This example renders ² using the hex entity, decimal entity, the named entity, and a CSS escape on a pseudo-element:
<!DOCTYPE html>
<html>
<head>
<style>
#point:after{
content: "\00B2";
}
</style>
</head>
<body>
<p>Superscript 2 using Hexa Decimal: ²</p>
<p>Superscript 2 using HTML Code: ²</p>
<p>Superscript 2 using HTML Entity: ²</p>
<p id="point">Superscript 2 using CSS Entity: </p>
</body>
</html>🌐 Browser Support
Superscript Two (²), its numeric entities, and the named entity ² are supported across all modern browsers:
👀 Live Preview
See ² used in a few common contexts:
<sup> tag)🧠 How It Works
Hexadecimal Code
² references Unicode 00B2 in hexadecimal and renders the glyph ² in your HTML.
Decimal HTML Code
² references the same Unicode code point using the decimal value 178.
Named Entity
² is the named entity for ²—easy to read and widely supported.
CSS Entity
\00B2 is a CSS escape sequence used in stylesheets (typically in content on ::before/::after).
Semantic Option
If your goal is semantic superscript formatting (not a specific glyph), use <sup>2</sup> to render 2 as a superscript.
Same visual result
All four entity methods display ². Unicode U+00B2 is part of the Latin‑1 Supplement block.
Use Cases
Superscript Two (²) is commonly used in:
Math notation such as x², n², and a² + b².
Area units like m², km², cm², and ft².
Textbooks and tutorials that need true superscript digits.
Property listings and floor areas such as 120 m².
Formulas, units, and technical writing where squared terms appear.
Consistent “squared” glyphs without relying on styling alone.
💡 Best Practices
Do
- Use
²when you want readable source HTML - Keep one style (named / hex / decimal) consistent within a page
- Use
<sup>when semantic superscript formatting matters - Use CSS escapes only in stylesheets (for generated content)
- Add context like “square meters” when accessibility requires it
Don’t
- Mix entity styles randomly across the same document
- Use CSS escapes inside HTML markup (use them in CSS only)
- Confuse ² (superscript) with ₂ (subscript) or the regular digit 2
- Rely on superscripts alone to communicate meaning without words
Key Takeaways
² is Unicode U+00B2 (Latin‑1 Supplement)
U+00B2 ² ² ²For CSS stylesheets, use the escape in content
\00B2² is a named entity and is widely supported
Use <sup>2</sup> when semantic superscript formatting matters
❓ Frequently Asked Questions
² (hex), ² (decimal), ² (named), or \00B2 in CSS content. All render ².U+00B2 (hex 00B2, decimal 178) in Latin‑1 Supplement.² is part of the HTML standard and works across modern browsers.<sup> when you want semantic superscript formatting that can apply to any text.\00B2 in the content property for ::before/::after to generate the symbol without extra markup.Explore More HTML Entities!
Discover 1500+ HTML character references — currency symbols, arrows, math operators, emojis, and more.
8 people found this page helpful
