HTML Entity for Number Sign (#)

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 1 Code Example
Unicode U+0023

What You'll Learn

How to display the Number Sign (#) in HTML using named, hexadecimal, decimal, and CSS escape methods. Also known as the hash, pound, or octothorpe symbol.

This character is U+0023 (NUMBER SIGN) in the Basic Latin block (U+0020–U+007F). Render it with the named entity #, #, #, or CSS escape \23. Compare with Numero Sign (№, №) and Music Sharp Sign (♯, ♯)—a distinct character used in formal music notation.

⚡ Quick Reference — Number Sign

Unicode U+0023

Basic Latin

Hex Code #

Hexadecimal reference

HTML Code #

Decimal reference

Named Entity #

HTML5 named entity for U+0023

Reference Table
Name           Value
────────────   ──────────
Unicode        U+0023
Hex code       #
HTML code      #
Named entity   #
CSS code       \23
Meaning        Number Sign (hash, pound)
Related        U+2116 = numero sign (№, №)
               U+266F = music sharp (♯, ♯)
               U+0025 = percent sign (%, %)
Block          Basic Latin (U+0020–U+007F)
1

Complete HTML Example

A simple example showing # using hexadecimal code, decimal HTML code, the named entity, and a CSS content escape:

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point::after{
   content: "\23";
  }
 </style>
</head>
<body>
<p>Symbol (hex): &#x23;</p>
<p>Symbol (decimal): &#35;</p>
<p>Symbol (named): &num;</p>
<p id="point">Symbol (CSS): </p>
</body>
</html>
Try it Yourself

🌐 Browser Support

U+0023 is universally supported in all modern browsers and has been part of HTML since early versions:

Chrome1+
Firefox1+
Safari1+
Edge12+
Opera4+
Android4.4+
iOS Safari1+

👀 Live Preview

See # in common web and coding contexts:

Hashtag #HTML #WebDev #Coding
Large glyph #
Numbering Item #1 • Issue #42
CSS docs #header { color: blue; }
Entity refs &num; &#x23; &#35; \23

🧠 How It Works

1

Named Entity

&num; is the HTML named entity for U+0023—readable and widely supported in HTML5 documents.

HTML markup
2

Hexadecimal Code

&#x23; uses the Unicode hexadecimal value 23 to display the number sign.

HTML markup
3

Decimal HTML Code

&#35; uses the decimal Unicode value 35 to display the same character.

HTML markup
4

CSS Entity

\23 is used in CSS stylesheets, particularly in the content property of pseudo-elements like ::before and ::after.

CSS stylesheet
=

Same visual result

All four methods produce: #. Unicode U+0023 in Basic Latin (U+0020–U+007F).

Use Cases

The # symbol (&num;) is commonly used in:

📱 Social media

Hashtags and topic tags in posts and marketing copy.

💻 Programming docs

Code comments, preprocessor directives, and syntax examples.

🎨 CSS tutorials

Documenting id selectors and fragment identifiers.

📋 Numbering

Issue numbers, ticket IDs, and ordered item labels.

📚 Reference guides

Unicode charts and HTML entity documentation.

🌐 Web content

Any page that needs the hash symbol without ambiguity in source.

💡 Best Practices

Do

  • Use &num; for readable hash and numbering markup
  • Type # directly in UTF-8 source when it does not conflict with syntax
  • Distinguish # (number sign) from ♯ (music sharp, &sharp;)
  • Use numeric references in generated or XML-first workflows
  • Serve pages with UTF-8 (<meta charset="utf-8">)

Don’t

  • Confuse # (&num;) with № (&numero;, numero sign)
  • Use # as a substitute for ♯ in formal music notation
  • Use padded Unicode notation like U+000023—the correct value is U+0023
  • Put CSS escape \23 in HTML text nodes
  • Use \00023 in CSS—the correct escape is \23

Key Takeaways

1

Three HTML references plus CSS all render #

&#x23; &#35; &num;
2

For CSS stylesheets, use the escape in the content property

\23
3

Unicode U+0023 — NUMBER SIGN

4

Basic Latin block (U+0020–U+007F)

5

&num; is the preferred named entity for readable source markup

❓ Frequently Asked Questions

Use &num; (named), &#x23; (hex), &#35; (decimal), or \23 in CSS content. All produce #.
U+0023 (NUMBER SIGN). Basic Latin block (U+0020–U+007F). Hex 23, decimal 35. Named entity: &num;.
No. # (U+0023, number sign) is different from ♯ (U+266F, music sharp sign, &sharp;). Use the correct symbol for music notation.
HTML references (&#35;, &#x23;, or &num;) go directly in markup. The CSS escape \23 is used in stylesheets, typically in the content property of pseudo-elements. Same visual result, different layers of the stack.
Yes. &num; is the named HTML entity for U+0023 and is one of the most common HTML character references.

Explore More HTML Entities!

Discover 1500+ HTML character references — arrows, symbols, 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