Number Sign #
The number sign (hash, pound sign, octothorpe) has many roles in computing and daily life. In HTML, it begins numeric character references and fragment identifiers in URLs. In CSS and design, it prefixes hexadecimal color codes. In social media, it creates hashtags. In programming, it denotes comments, preprocessor directives, and more.
All Representations
###U+0023Rendered Output
# renders as the character shown above
When to Use Number Sign
Use the number sign entity when the # character might be interpreted as the start of an HTML character reference, URL fragment, or CSS color code. It is essential for technical documentation that discusses these syntaxes and needs to show a literal # without it being parsed.
Try It — HTML Examples
<p>Symbol: #</p><p>Symbol: #</p><p>Symbol: #</p><div title="The Number Sign: #">Hover to see</div>About the Number Sign Entity
The Number Sign character (#) is a standard HTML entity defined in the HTML specification. In HTML source code, it can be written using the named entity reference #, the decimal numeric character reference #, or the hexadecimal numeric reference #. The character is assigned Unicode code point U+0023 in the Universal Character Set.
The number sign (hash, pound sign, octothorpe) has many roles in computing and daily life. In HTML, it begins numeric character references and fragment identifiers in URLs. In CSS and design, it prefixes hexadecimal color codes. In social media, it creates hashtags. In programming, it denotes comments, preprocessor directives, and more.
Technical character entities represent brackets, delimiters, and punctuation marks that frequently require escaping in HTML source code and programming contexts. Characters like curly braces, square brackets, pipes, and backslashes often carry special meaning in templating engines, regular expressions, or markup parsers, making their explicit HTML entity encoding important for preventing unintended interpretation by the browser or build tools.
When deciding how to encode the Number Sign character in your HTML documents, the named entity # is generally the most readable choice for developers reviewing or maintaining source code. The decimal form # and hexadecimal form # are equally valid alternatives that work in contexts where named entities may not be supported, or when generating HTML output programmatically from server-side code. All three representations produce identical visual output in every modern web browser.
Use the number sign entity when the # character might be interpreted as the start of an HTML character reference, URL fragment, or CSS color code. It is essential for technical documentation that discusses these syntaxes and needs to show a literal # without it being parsed.
Related Entities
Explore More HTML Entities
Browse our complete reference of 262 HTML entities with codes, examples, and usage tips.