HTML Entity for Subscript Digit Two (₂)

Beginner
⏱️ 5 min read
📚 Updated: Aug 2025
🎯 1 Code Example
Unicode U+2082

What You'll Learn

How to display the subscript digit two (₂) in HTML using hex, decimal, and CSS entity methods. This character belongs to the Superscripts and Subscripts Unicode block and is useful for chemical formulas (H₂O, CO₂), mathematical notation, scientific writing, and technical content.

₂ has no named HTML entity. You’ll typically use numeric references (₂ or ₂) or a CSS escape (\2082 in content).

⚡ Quick Reference — ₂ Entity

Unicode U+2082

Superscripts & Subscripts block

Hex Code ₂

Hexadecimal reference

HTML Code ₂

Decimal reference

CSS Code \2082

Use in CSS content

Reference Table
Name           Value
────────────   ──────────
Unicode        U+2082
Hex code       ₂
HTML code      ₂
Named entity   (none)
CSS code       \2082
1

Complete HTML Example

This example demonstrates the subscript digit two (₂) using hexadecimal code, decimal HTML code, and a CSS content escape on a pseudo-element:

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point:after{
   content: "\2082";
  }
 </style>
</head>
<body>

<p>Subscript 2 using Hexa Decimal: &#x2082;</p>
<p>Subscript 2 using HTML Code: &#8322;</p>
<p id="point">Subscript 2 using CSS Entity: </p>

</body>
</html>
Try It Yourself

🌐 Browser Support

The ₂ character (Unicode U+2082) is supported in all modern browsers. If a font doesn’t include Superscripts and Subscripts, the browser may fall back to another font.

Chrome1+
Firefox1+
Safari1+
Edge12+
Opera4+
Android4.4+
iOS Safari1+

👀 Live Preview

See the subscript digit two rendered live in different contexts:

Chemical formula H₂O • CO₂ • O₂ • N₂
Large glyph
Math notation x₂ + y₂ = z₂
Monospace item₂ → index 2
Font fallback check If a font lacks Superscripts/Subscripts, the browser will use a fallback font to render ₂.

🧠 How It Works

1

Hexadecimal Code

&#x2082; references Unicode 2082 in hexadecimal, producing the glyph in your HTML.

HTML markup
2

Decimal HTML Code

&#8322; references the same Unicode code point using the decimal value 8322.

HTML markup
3

CSS Entity (Escape)

\2082 is used in CSS (most often in the content property) to generate ₂ without adding extra HTML.

CSS stylesheet
=

Same visual result

All methods produce . The Unicode value is U+2082 in the Superscripts and Subscripts block. There is no named HTML entity for this character.

Use Cases

The subscript digit two (₂) commonly appears in the following scenarios:

🧪 Chemical Formulas

Write formulas like H₂O, CO₂, O₂, and N₂ with true subscript numerals.

📏 Mathematical Notation

Use in indices, sequences, and variables like x₂, a₂, or term₂.

🎓 Scientific Content

Present scientific notation and equations with proper typographic subscripts.

✍️ Footnotes

Use subscript-style markers in notes and references when design calls for it.

💻 Technical Docs

Label versions, items, or parameters like item₂ in documentation and examples.

🎯 Education

Teach chemistry, physics, and math with correctly formatted subscripts.

💡 Best Practices

Do

  • Use &#x2082; or &#8322; for reliable HTML rendering in formulas
  • Use the CSS escape \2082 in content for generated labels and markers
  • Consider <sub> for complex formulas when you control styling
  • Provide readable context for screen readers in chemical/math content
  • Test font support and fallback rendering across devices

Don’t

  • Confuse the subscript ₂ with the regular digit 2
  • Use the CSS escape \2082 directly in HTML text
  • Mix hex/decimal references randomly in the same file
  • Assume every font includes Superscripts/Subscripts glyphs
  • Rely on a glyph alone to convey meaning without context

Key Takeaways

1

Two HTML numeric references render ₂

&#x2082; &#8322;
2

For CSS stylesheets, use the escape in the content property

\2082
3

Unicode U+2082 belongs to the Superscripts and Subscripts block

4

There is no named HTML entity for this character

5

Use ₂ for chemical formulas, indices, and scientific notation

❓ Frequently Asked Questions

Use &#x2082; (hex) or &#8322; (decimal) in HTML. For CSS, use \2082 in the content property. All methods render ₂.
U+2082 (hex 2082, decimal 8322). It’s part of the Superscripts and Subscripts block.
Use it in chemical formulas (e.g. H₂O, CO₂), mathematical expressions, scientific notation, footnotes, and variable subscripts.
HTML numeric references (&#8322; or &#x2082;) go directly in markup. The CSS escape \2082 is used in stylesheets (usually in content on ::before/::after). Same visual result, different layers of the stack.
Characters from the Superscripts and Subscripts block typically don’t have named HTML entities and are referenced using numeric codes. For ₂, use hex &#x2082; or decimal &#8322;.

Explore More HTML Entities!

Discover 1500+ HTML character references — currency symbols, arrows, math operators, emojis, and more.

All HTML Entities →

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