HTML Entity for Digit Nine (9)

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

What You'll Learn

How to display the digit nine (9) in HTML using numeric character references. The digit 9 is part of Basic Latin (Unicode U+0039).

In most cases you can type 9 directly, but entity forms are useful for generated HTML, templating, and CSS content.

⚡ Quick Reference — 9 Entity

Unicode U+0039

Basic Latin (ASCII digit)

Hex Code 9

Hexadecimal reference

HTML Code 9

Decimal reference

CSS Code \0039

Use in CSS content

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

Complete HTML Example

This example demonstrates 9 using hexadecimal code, decimal HTML code, and a CSS content escape on a pseudo-element:

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

<p>Digit Nine using Hexa Decimal: &#x39;</p>
<p>Digit Nine using HTML Code: &#57;</p>
<p id="point">Digit Nine using CSS Entity: </p>

</body>
</html>
Try It Yourself

🌐 Browser Support

The digit 9 (U+0039) is universally supported in all browsers and fonts:

Chrome 1+
Firefox 1+
Safari 1+
Edge 12+
Opera 4+
Android 1+
iOS Safari 1+

👀 Live Preview

See the digit 9 rendered in different contexts:

Inline Version 9.0
Large glyph 9
Monospace 9
As a label Step 9

🧠 How It Works

1

Hexadecimal Code

&#x39; references Unicode 0039 (hex 39) to render the digit 9 in HTML.

HTML markup
2

Decimal HTML Code

&#57; uses the decimal code point value 57 to render the same character.

HTML markup
3

CSS Entity (Escape)

\0039 is used in CSS (often in content) to generate 9 in pseudo-elements. The 4-digit hex escape is a common style for ASCII code points.

CSS stylesheet
=

Same visual result

All methods render 9. Unicode is U+0039 (Basic Latin). There is no named HTML entity for digits.

Use Cases

Using the digit 9 via character reference is useful in these scenarios:

💻 Generated HTML

Templates/CMS output where you want explicit numeric references.

🎨 CSS Content

Use \0039 for pseudo-elements and badges.

📅 Dates

Generating date strings like 2026-09-09 safely.

📝 Teaching Entities

Simple example of how numeric references work.

🔒 Escaping

Part of a consistent HTML escaping/encoding strategy.

📊 Labels

Counters and fixed labels in generated UI strings.

💡 Best Practices

Do

  • Type 9 directly in normal prose when you can
  • Use numeric references in generated HTML output
  • Use \0039 in CSS content when needed
  • Keep encoding consistent across templates
  • Prefer semantic markup for lists (<ol>)

Don’t

  • Over-escape digits in static content without need
  • Use CSS escapes inside HTML text nodes
  • Assume entities improve accessibility (rendered output is identical)
  • Mix reference styles randomly (hex vs decimal) in one section
  • Use entities in JSON/JS strings (use the literal character)

Key Takeaways

1

Digit 9 is Unicode U+0039

2

Hex and decimal references

&#x39;&#57;
3

CSS escape for generated content

\0039
4

There is no named HTML entity for digits

5

Typing 9 directly is usually best

❓ Frequently Asked Questions

Use &#x39; (hex) or &#57; (decimal) in HTML. In CSS, use \0039 in the content property. All render 9.
U+0039 (hex 39, decimal 57). It’s part of the Basic Latin (ASCII) range.
When generating HTML via scripts/templates, in CSS generated content, or when you need consistent character-reference output.
HTML numeric references go in markup; CSS escapes like \0039 go in stylesheets (usually content on pseudo-elements).
Digits are safe to type directly. Numeric references exist when you need them; named entities are reserved for other characters.

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.

9 people found this page helpful