HTML Entity for Number Sign (#)

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
U+0023Basic Latin
#Hexadecimal reference
#Decimal reference
#HTML5 named entity for U+0023
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)Complete HTML Example
A simple example showing # using hexadecimal code, decimal HTML code, the named entity, and a CSS content escape:
<!DOCTYPE html>
<html>
<head>
<style>
#point::after{
content: "\23";
}
</style>
</head>
<body>
<p>Symbol (hex): #</p>
<p>Symbol (decimal): #</p>
<p>Symbol (named): #</p>
<p id="point">Symbol (CSS): </p>
</body>
</html>🌐 Browser Support
U+0023 is universally supported in all modern browsers and has been part of HTML since early versions:
👀 Live Preview
See # in common web and coding contexts:
🧠 How It Works
Named Entity
# is the HTML named entity for U+0023—readable and widely supported in HTML5 documents.
Hexadecimal Code
# uses the Unicode hexadecimal value 23 to display the number sign.
Decimal HTML Code
# uses the decimal Unicode value 35 to display the same character.
CSS Entity
\23 is used in CSS stylesheets, particularly in the content property of pseudo-elements like ::before and ::after.
Same visual result
All four methods produce: #. Unicode U+0023 in Basic Latin (U+0020–U+007F).
Use Cases
The # symbol (#) is commonly used in:
Hashtags and topic tags in posts and marketing copy.
Code comments, preprocessor directives, and syntax examples.
Documenting id selectors and fragment identifiers.
Issue numbers, ticket IDs, and ordered item labels.
Unicode charts and HTML entity documentation.
Any page that needs the hash symbol without ambiguity in source.
💡 Best Practices
Do
- Use
#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,
♯) - Use numeric references in generated or XML-first workflows
- Serve pages with UTF-8 (
<meta charset="utf-8">)
Don’t
- Confuse # (
#) with № (№, 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
\23in HTML text nodes - Use
\00023in CSS—the correct escape is\23
Key Takeaways
Three HTML references plus CSS all render #
# # #For CSS stylesheets, use the escape in the content property
\23Unicode U+0023 — NUMBER SIGN
Basic Latin block (U+0020–U+007F)
# is the preferred named entity for readable source markup
❓ Frequently Asked Questions
# (named), # (hex), # (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: #.U+0023, number sign) is different from ♯ (U+266F, music sharp sign, ♯). Use the correct symbol for music notation.#, #, or #) 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.# 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.
8 people found this page helpful
