HTML Entity for Subscript Two (₂)

Beginner
6 min read
Updated: Sep 2026
1 example
Unicode U+2082

What Is the Subscript Two Entity?

Subscript Two (₂) is the Unicode character at U+2082 in the Subscripts and Superscripts block. It looks like a small lowered 2 and is common in math and science text such as x₂ or H₂O.

Remember
Character     ₂
Unicode       U+2082
Hex entity    ₂
Decimal       ₂
CSS escape    \2082
Named entity  (none)

All of these produce the same glyph: ₂. Prefer the Unicode character (or its entities) when you need that exact glyph; use <sub>2</sub> when you want semantic subscript formatting instead.

Quick Reference

One table for every form you will actually use.

FormCodeWhere it goes
Direct character₂HTML text (UTF-8)
Hex entity&#x2082;HTML markup
Decimal entity&#8322;HTML markup
CSS escape\2082Stylesheet content
Named entity—Not defined in HTML5
Semantic tag<sub>2</sub>HTML (formatting, not the ₂ glyph)

When to use which

SituationUse
Need the Unicode glyph ₂Type ₂, or &#x2082; / &#8322;
Generated text via ::before / ::aftercontent: "\2082"
Semantic subscript for any text<sub>2</sub>
Plain digit two (not subscript)Type 2 (U+0032)
Looking for &sub2; or similarDoes not exist — use numeric form

Live Preview

Subscript Two rendered in common writing contexts.

Inline text Second term: x₂ = 2
Large glyph ₂
In a formula H₂O   CO₂   a₁ + a₂
Monospace x₂ → second element
With entities Hex: ₂ | Decimal: ₂
Semantic <sub> x2 (tag styles digit 2)

Complete HTML Example

One page that shows Subscript Two with the hex entity, decimal entity, CSS escape, and the semantic <sub> option. Use View Output or open the live editor.

Hex + Decimal + CSS + <sub>

Four ways to show a lowered two in a single document.

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Subscript Two (₂) in HTML</title>
  <style>
    #point::after {
      content: "\2082";
    }
  </style>
</head>
<body>
  <p>Subscript Two using Hex Code: &#x2082;</p>
  <p>Subscript Two using HTML Code: &#8322;</p>
  <p id="point">Subscript Two using CSS Entity: </p>
  <p>Semantic alternative: x<sub>2</sub></p>
</body>
</html>
Try It Yourself

How It Works

1. Hex: U+2082 → &#x2082; in HTML. The browser turns it into ₂.

2. Decimal: same code point as 8322 → &#8322;. Same result as hex.

3. CSS: use \2082 in content (not an HTML entity). #point::after appends that ₂ after the paragraph text.

4. Semantic <sub>: x<sub>2</sub> styles digit two as a subscript. Prefer this when you need meaning, not a specific Unicode glyph.

Pitfalls & Tips

Common mistakes when working with Subscript Two entities.

Named?

No named entity

HTML5 does not define &sub2; or similar. Use numeric forms.

CSS vs HTML

Do not mix escapes

\2082 belongs in CSS. &#x2082; / &#8322; belong in HTML.

₂ vs 2 vs ²

Different characters

₂ is U+2082; digit 2 is U+0032; superscript ² is U+00B2.

Glyph vs tag

Choose intentionally

Use the Unicode glyph for exact look; use <sub> for semantic subscript on any text.

Semicolon

End references

Always finish with ; — write &#8322;, not &#8322.

Fonts

Check the glyph

Some fonts draw ₂ weakly. If appearance matters, test the font or prefer <sub>.

Browser Support

Subscript Two (U+2082) and its numeric entity forms (&#x2082;, &#8322;, CSS \\2082) are supported in all mainstream browsers. Glyph shape depends on the font.

✓ Universal support

Subscript Two (₂)

Encode with hex, decimal, or CSS escape — or use <sub> for semantic formatting.

100% Browser coverage
Google Chrome Supported
Yes
Microsoft Edge Supported
Yes
Mozilla Firefox Supported
Yes
Apple Safari Supported
Yes
Opera Supported
Yes
Internet Explorer All versions
Yes
U+2082 / entities Full support

Bottom line: Use &#x2082; or &#8322; for the Unicode glyph, \\2082 only inside CSS content, and <sub>2</sub> when you want semantic subscript.

Key Takeaways

  • Unicode: Subscript Two is U+2082 (decimal 8322).
  • HTML: use &#x2082; or &#8322; when you need an entity.
  • CSS: use \2082 inside content for generated text.
  • Alternative: use <sub>2</sub> for semantic subscript formatting.

One line: U+2082 → &#x2082; / &#8322; / CSS \2082, or semantic <sub>2</sub>.

Frequently Asked Questions

Use &#x2082; (hex), &#8322; (decimal), or the CSS escape \2082 in the content property. All render ₂. You can also paste the character ₂ directly when your file is UTF-8.
U+2082 (hex 2082, decimal 8322). It belongs to the Subscripts and Superscripts Unicode block.
No. HTML5 does not define a named entity for ₂. Use numeric references like &#x2082; or &#8322;.
Use ₂ (or its entities) when you need the exact Unicode subscript glyph. Use <sub>2</sub> when you want semantic subscript formatting for arbitrary text.
No. Digit two is U+0032. Superscript two is U+00B2 (²). Subscript Two is U+2082 (₂) — a different character.
HTML entities (&#8322; or &#x2082;) go in markup. The CSS escape \2082 is used in stylesheets (usually in the content property of ::before/::after). Both render ₂.

Did you know?

Subscript two is Unicode U+2082 (decimal 8322). HTML5 has no named entity for it — use &#x2082; or &#8322;. It is a different character from digit two (U+0032) and from superscript two ² (U+00B2).

Next: 2 Superscript

Learn the HTML entity for superscript two (²) — a different Unicode character from ₂.

2 Superscript tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful