HTML Entity for Digit One (1)

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

What Is the Digit One Entity?

Digit one (1) is the Basic Latin character at Unicode U+0031. You can type 1 directly in HTML, or write it with a numeric character reference when you need an explicit entity form.

Remember
Character     1
Unicode       U+0031
Hex entity    1
Decimal       1
CSS escape    \0031
Named entity  (none)

All of these produce the same glyph: 1. Prefer typing 1 in normal page text; use entities for CSS content, generated markup, or when encoding must be explicit.

Quick Reference

One table for every form you will actually use.

FormCodeWhere it goes
Direct character1HTML text (default choice)
Hex entity1HTML markup
Decimal entity1HTML markup
CSS escape\0031Stylesheet content
Named entity—Not defined in HTML5

When to use which

SituationUse
Normal paragraphs, headings, labelsType 1
Need an entity in HTML source1 or 1
Generated text via ::before / ::aftercontent: "\0031"
Looking for &one; or similarDoes not exist — use numeric form

Live Preview

Digit one rendered in common UI contexts.

Inline text You have 1 new notification.
Large glyph 1
Date / time 2026-09-22 10:01
Monospace index 1, value 1
With entities Hex: 1 | Decimal: 1

Complete HTML Example

One page that shows digit one with the hex entity, decimal entity, CSS escape, and a typed character. Use View Output or open the live editor.

Hex + Decimal + CSS + Typed

All four ways to produce 1 in a single document.

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Digit One (1) in HTML</title>
  <style>
    #point::after {
      content: "\0031";
    }
  </style>
</head>
<body>
  <p>Digit One using Hex Code: &#x31;</p>
  <p>Digit One using HTML Code: &#49;</p>
  <p id="point">Digit One using CSS Entity: </p>
  <p>Typed directly: 1</p>
</body>
</html>
Try It Yourself

How It Works

1. Hex: U+0031 → &#x31; in HTML. The browser turns it into 1.

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

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

4. Typed 1: best for normal text. All four lines show the same digit.

Pitfalls & Tips

Common mistakes when working with digit one entities.

Named?

No &one;

HTML5 does not define a named entity for ASCII digits. Use numeric forms.

CSS vs HTML

Do not mix escapes

\0031 belongs in CSS. &#x31; / &#49; belong in HTML.

1 vs l vs I

Avoid ambiguity

In monospace or codes, digit 1 can look like lowercase l or capital I. Add labels when precision matters.

Default

Type 1 when you can

Entities are for encoding needs — not required for ordinary body text.

Semicolon

End references

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

Related

Sub / super one

₁ and ¹ are different Unicode characters — not the same as U+0031.

Browser Support

Digit one (U+0031) and its numeric entity forms (&#x31;, &#49;, CSS \\0031) are supported in all mainstream browsers.

✓ Universal support

Digit One (1)

Type 1, or encode with hex, decimal, or CSS escape — same glyph everywhere.

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+0031 / entities Full support

Bottom line: Use a typed 1 for normal text. Prefer &#x31; or &#49; in HTML when encoding must be explicit, and \\0031 only inside CSS content.

Key Takeaways

  • Unicode: digit one is U+0031 (decimal 49).
  • HTML: use &#x31; or &#49; when you need an entity.
  • CSS: use \0031 inside content for generated text.
  • Default: type 1 directly unless encoding requires an entity.

One line: U+0031 → type 1, or encode as &#x31; / &#49; / CSS \0031.

Frequently Asked Questions

Use &#x31; (hex), &#49; (decimal), or the CSS escape \0031 in the content property. All render the digit one (1). In most cases you can also type 1 directly.
U+0031 (hex 0031, decimal 49). It belongs to the Basic Latin (ASCII) block.
No. ASCII digits like 1 do not have named HTML entities in HTML5, so you should use numeric references like &#49; or &#x31; when you need an entity form.
Use entities when generating content in CSS, when you want explicit encoding, or when outputting into contexts where escaping is required. For normal body text, typing 1 directly is usually best.
HTML entities (&#49; or &#x31;) go in markup. The CSS escape \0031 is used in stylesheets (usually in the content property of ::before/::after). Both render 1.
Use UI or monospace fonts for codes and counts, and add labels like Step 1 or Count: 1 so context is clear.

Did you know?

Digit one is Unicode U+0031 (decimal 49). HTML5 has no named entity for it — use &#x31; or &#49; when you need an entity form.

Next: 1 Subscript

Learn the HTML entity for subscript one (₁) — a different Unicode character from digit one.

1 Subscript 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