HTML Entity for Dollar Sign ($)

What You'll Learn
How to display the dollar sign ($) in HTML using named, hexadecimal, decimal, and CSS entity methods. This character is U+0024 (DOLLAR SIGN) in the Basic Latin block and is the familiar symbol for the US dollar, prices, and programming contexts (for example PHP variables or shell prompts).
Render it with the named entity $, $, $, or CSS escape \24 in the content property. The raw $ character is usually fine in HTML; entities help when you need to escape $ in templates or tooling.
⚡ Quick Reference — Dollar Sign
U+0024Basic Latin block
$Hexadecimal reference
$Decimal reference
$Most readable option
Name Value
──────────── ──────────
Unicode U+0024
Hex code $
HTML code $
Named entity $
CSS code \24Complete HTML Example
This example demonstrates the dollar sign ($) using hexadecimal code, decimal HTML code, the named entity, and a CSS content escape on a pseudo-element:
<!DOCTYPE html>
<html>
<head>
<style>
#point:after{
content: "\24";
}
</style>
</head>
<body>
<p>Using Hexadecimal: $</p>
<p>Using HTML Code: $</p>
<p>Using Named Entity: $</p>
<p id="point">Using CSS Entity: </p>
</body>
</html>🌐 Browser Support
U+0024 is supported in all modern browsers; Basic Latin glyphs render with standard system fonts:
👀 Live Preview
See the Dollar Sign symbol ($) in currency and pricing:
🧠 How It Works
Named Entity
$ is the HTML named entity for the dollar sign ($). It is easy to read and remember in source code.
Hexadecimal Code
$ uses the Unicode hexadecimal value 24. The x prefix indicates hexadecimal format.
Decimal HTML Code
$ uses the decimal Unicode value 36 to display the same character.
CSS Entity
\24 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+0024 is the dollar sign. Use $ or numeric codes when you need to escape $ in templates.
Use Cases
The symbol ($) commonly appears in the following scenarios:
Product prices, sale tags, and checkout totals (e.g. $99.00).
Currency fields and price labels that show the dollar symbol consistently.
Tutorials showing $ in shell prompts, PHP, JavaScript, or template examples.
When $ has special meaning in server-side or JS templates, use $ or $.
HTML entity lists for Basic Latin and currency symbols.
HTML entity references for education and research.
💡 Best Practices
Do
- Use
$for readable HTML source - Use
$or$when $ must be escaped in templates - Use fonts that cover Basic Latin (U+0000–U+007F)
- Pair with text or ARIA (“dollar sign”)
- Pick one entity style per project for consistency
Don’t
- Assume
$is always required (raw $ is usually fine in HTML) - Confuse
$with¢or€ - Use CSS escape
\24inside HTML markup - Mix hex, decimal, and named styles randomly in one file
- Rely on the symbol alone without accessible description
Key Takeaways
Four methods all render $
$ $ $For CSS stylesheets, use the escape in the content property
\24Unicode U+0024 is DOLLAR SIGN
Safe as raw $ in most HTML; entities help when escaping
Next: Dong Sign
❓ Frequently Asked Questions
$ (named), $ (hex), $ (decimal), or \24 in CSS content. All produce $.U+0024 (hex 24, decimal 36) in the Basic Latin block. It is the dollar sign used for US currency and in programming notation.$ in templates or tools where the raw character has special meaning.$. The raw character is valid in HTML; $ or $ helps when escaping $ in templates or for consistency in entity-based content.$ is U+0024 ($). ¢ is U+00A2 (¢). € is U+20AC (€). Each maps to a different currency symbol.Explore More HTML Entities!
Discover 1500+ HTML character references — currency symbols, operators, and more.
8 people found this page helpful
