HTML Entity for Digit One (1)

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
U+0031Basic Latin (ASCII) block
1Hexadecimal reference
1Decimal reference
—No named entity available
Name Value
──────────── ──────────
Unicode U+0031
Hex code 1
HTML code 1
Named entity —
CSS code \0031Complete HTML Example
This example renders digit one using the hex entity, decimal entity, and a CSS escape on a pseudo-element:
<!DOCTYPE html>
<html>
<head>
<style>
#point:after{
content: "\0031";
}
</style>
</head>
<body>
<p>Digit One using Hexa Decimal: 1</p>
<p>Digit One using HTML Code: 1</p>
<p id="point">Digit One using CSS Entity: </p>
</body>
</html>🌐 Browser Support
Digit one (1) and its numeric entity forms are supported in all browsers:
👀 Live Preview
See digit one rendered in a few common contexts:
🧠 How It Works
Hexadecimal Code
1 uses the Unicode hexadecimal value 31 to render digit one.
Decimal HTML Code
1 uses the decimal Unicode value 49 for the same character.
CSS Entity
\0031 is a CSS escape used in stylesheets (typically inside content for ::before/::after).
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:
Counts like “1 item”, pagination, and status badges.
Quantities, defaults, and validation boundaries.
Step numbers, priority, and “rank 1” displays.
Version numbers (v1.0), indices, and references.
Date parts, “day 1”, and ordinal-style content.
💡 Best Practices
Do
- Type
1directly 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
Digit one is Unicode U+0031
U+0031 1 1For CSS stylesheets, use the escape in the content property
\0031There is no named HTML entity for 1
Prefer typing 1 directly unless you need an entity form
❓ Frequently Asked Questions
1 (hex), 1 (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.1 is simplest.Explore More HTML Entities!
Discover 1500+ HTML character references — currency symbols, arrows, math operators, emojis, and more.
8 people found this page helpful
