HTML Entity for Digit Zero (0)

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

What Is the Digit Zero Entity?

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

Remember
Character     0
Unicode       U+0030
Hex entity    0
Decimal       0
CSS escape    \0030
Named entity  (none)

All of these produce the same glyph: 0. Prefer typing 0 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 character0HTML text (default choice)
Hex entity0HTML markup
Decimal entity0HTML markup
CSS escape\0030Stylesheet content
Named entity—Not defined in HTML5

When to use which

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

Live Preview

Digit zero rendered in common UI contexts.

Inline text You have 0 new notifications.
Large glyph 0
Date / time 2026-05-01 09:05
Monospace index 0, value 0
With entities Hex: 0 | Decimal: 0

Complete HTML Example

One page that shows digit zero 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 0 in a single document.

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

How It Works

1. Hex: U+0030 → &#x30; in HTML. The browser turns it into 0.

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

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

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

Pitfalls & Tips

Common mistakes when working with digit zero entities.

Named?

No &zero;

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

CSS vs HTML

Do not mix escapes

\0030 belongs in CSS. &#x30; / &#48; belong in HTML.

0 vs O

Avoid ambiguity

Use UI/code fonts or labels so zero is not read as the letter O.

Default

Type 0 when you can

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

Semicolon

End references

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

Related

Sub / super zero

₀ and ⁰ are different Unicode characters — not the same as U+0030.

Browser Support

Digit zero (U+0030) and its numeric entity forms (&#x30;, &#48;, CSS \\0030) are supported in all mainstream browsers.

✓ Universal support

Digit Zero (0)

Type 0, 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+0030 / entities Full support

Bottom line: Use a typed 0 for normal text. Prefer &#x30; or &#48; in HTML when encoding must be explicit, and \\0030 only inside CSS content.

Key Takeaways

  • Unicode: digit zero is U+0030 (decimal 48).
  • HTML: use &#x30; or &#48; when you need an entity.
  • CSS: use \0030 inside content for generated text.
  • Default: type 0 directly unless encoding requires an entity.

One line: U+0030 → type 0, or encode as &#x30; / &#48; / CSS \0030.

Frequently Asked Questions

Use &#x30; (hex), &#48; (decimal), or the CSS escape \0030 in the content property. All render the digit zero (0). In most cases you can also type 0 directly.
U+0030 (hex 0030, decimal 48). It belongs to the Basic Latin (ASCII) block.
No. ASCII digits like 0 do not have named HTML entities in HTML5, so you should use numeric references like &#48; or &#x30; 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 0 directly is usually best.
HTML entities (&#48; or &#x30;) go in markup. The CSS escape \0030 is used in stylesheets (usually in the content property of ::before/::after). Both render 0.
Use fonts designed for UI or code (often with a slashed or dotted zero), and add context labels like Count: 0.

Did you know?

Digit zero is Unicode U+0030 (decimal 48). HTML5 has no named entity for it — use &#x30; or &#48; when you need an entity form.

Next: 0 Subscript

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

0 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