HTML Entity for Digit One (1)

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

What You'll Learn

How to display the digit one (1) using HTML numeric entities and a CSS escape. While you can type 1 directly in most content, entity forms help when you need explicit encoding (like CSS content or generated markup).

Digit one is in the Basic Latin (ASCII) block and is referenced as Unicode U+0031.

⚡ Quick Reference — Digit One Entity

Unicode U+0031

Basic Latin (ASCII) block

Hex Code 1

Hexadecimal reference

HTML Code 1

Decimal reference

Named Entity

No named entity available

Reference Table
Name           Value
────────────   ──────────
Unicode        U+0031
Hex code       1
HTML code      1
Named entity   —
CSS code       \0031
1

Complete HTML Example

This example renders digit one using the hex entity, decimal entity, and a CSS escape on a pseudo-element:

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

<p>Digit One using Hexa Decimal: &#x31;</p>
<p>Digit One using HTML Code: &#49;</p>
<p id="point">Digit One using CSS Entity: </p>

</body>
</html>
Try It Yourself

🌐 Browser Support

Digit one (1) and its numeric entity forms are supported in all browsers:

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

👀 Live Preview

See digit one rendered in a few common contexts:

Inline text You have 1 new notification.
Large glyph 1
In a list Step 1 → Step 2 → Step 3
Monospace index 1, value 1
With entities Hex: 1 | Decimal: 1

🧠 How It Works

1

Hexadecimal Code

&#x31; uses the Unicode hexadecimal value 31 to render digit one.

HTML markup
2

Decimal HTML Code

&#49; uses the decimal Unicode value 49 for the same character.

HTML markup
3

CSS Entity

\0031 is a CSS escape used in stylesheets (typically inside content for ::before/::after).

CSS stylesheet
=

Same visual result

All methods display 1. Unicode U+0031 is a Basic Latin (ASCII) character.

Use Cases

Digit one (1) is used in everyday web content such as:

🔢 Numbers & Counters

Counts like “1 item”, pagination, and status badges.

✍️ Forms

Quantities, defaults, and validation boundaries.

📝 Lists & Rankings

Step numbers, priority, and “rank 1” displays.

💻 Technical Docs

Version numbers (v1.0), indices, and references.

📅 Dates & Ordinals

Date parts, “day 1”, and ordinal-style content.

💡 Best Practices

Do

  • Type 1 directly in normal body content
  • Use entities when you need explicit encoding (CSS content, generated output, or special contexts)
  • Use monospace or tabular figures for aligned numeric UI
  • Include context for readability (e.g. “Step 1”, “Rank 1”)

Don’t

  • Assume there is a named entity for 1 (there isn’t)
  • Mix CSS escapes into HTML markup (use them in stylesheets only)
  • Overuse entities where a direct character is clearer
  • Use ambiguous fonts in UI where digits are hard to scan

Key Takeaways

1

Digit one is Unicode U+0031

U+0031 &#x31; &#49;
2

For CSS stylesheets, use the escape in the content property

\0031
3

There is no named HTML entity for 1

4

Prefer typing 1 directly unless you need an entity form

❓ Frequently Asked Questions

Use &#x31; (hex), &#49; (decimal), or \0031 in CSS content. In most cases you can also type 1 directly.
U+0031 (hex 0031, decimal 49) in the Basic Latin (ASCII) block.
No. HTML doesn’t define a named entity for ASCII digits like 1, so use numeric references when needed.
Use entities in CSS generated content, when constructing HTML strings safely, or when you want explicit encoding. For regular text, typing 1 is simplest.
Yes. It’s an ASCII character (Basic Latin), so it renders reliably across browsers and fonts.

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