HTML Entity for Dollar Sign ($)

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

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

Unicode U+0024

Basic Latin block

Hex Code $

Hexadecimal reference

HTML Code $

Decimal reference

Named Entity $

Most readable option

Reference Table
Name           Value
────────────   ──────────
Unicode        U+0024
Hex code       $
HTML code      $
Named entity   $
CSS code       \24
1

Complete 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:

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point:after{
   content: "\24";
  }
 </style>
</head>
<body>
<p>Using Hexadecimal: &#x24;</p>
<p>Using HTML Code: &#36;</p>
<p>Using Named Entity: &dollar;</p>
<p id="point">Using CSS Entity: </p>
</body>
</html>
Try it Yourself

🌐 Browser Support

U+0024 is supported in all modern browsers; Basic Latin glyphs render with standard system fonts:

Chrome 1+
Firefox 1+
Safari 1+
Edge 12+
Opera 4+
Android 4.4+
iOS Safari 1+

👀 Live Preview

See the Dollar Sign symbol ($) in currency and pricing:

Price display $99.00  •  $1,250.00
Forms and inputs Currency label: Price $49.99
Large glyph $
Entity refs $ = &dollar; = &#36;
Monospace refs &dollar; &#x24; &#36; \24

🧠 How It Works

1

Named Entity

&dollar; is the HTML named entity for the dollar sign ($). It is easy to read and remember in source code.

HTML markup
2

Hexadecimal Code

&#x24; uses the Unicode hexadecimal value 24. The x prefix indicates hexadecimal format.

HTML markup
3

Decimal HTML Code

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

HTML markup
4

CSS Entity

\24 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+0024 is the dollar sign. Use &dollar; or numeric codes when you need to escape $ in templates.

Use Cases

The symbol ($) commonly appears in the following scenarios:

🔢 E-commerce

Product prices, sale tags, and checkout totals (e.g. $99.00).

📐 Forms and inputs

Currency fields and price labels that show the dollar symbol consistently.

📚 Documentation

Tutorials showing $ in shell prompts, PHP, JavaScript, or template examples.

📝 Escaping in templates

When $ has special meaning in server-side or JS templates, use &dollar; or $.

📝 Character references

HTML entity lists for Basic Latin and currency symbols.

📑 Entity guides

HTML entity references for education and research.

💡 Best Practices

Do

  • Use &dollar; for readable HTML source
  • Use &dollar; or &#36; 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 &dollar; is always required (raw $ is usually fine in HTML)
  • Confuse &dollar; with &cent; or &euro;
  • Use CSS escape \24 inside HTML markup
  • Mix hex, decimal, and named styles randomly in one file
  • Rely on the symbol alone without accessible description

Key Takeaways

1

Four methods all render $

&#x24; &#36; &dollar;
2

For CSS stylesheets, use the escape in the content property

\24
3

Unicode U+0024 is DOLLAR SIGN

4

Safe as raw $ in most HTML; entities help when escaping

5

Next: Dong Sign

❓ Frequently Asked Questions

Use &dollar; (named), &#x24; (hex), &#36; (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.
For prices, currency amounts, invoices, and when you need to escape $ in templates or tools where the raw character has special meaning.
Both render as $. The raw character is valid in HTML; &dollar; or &#36; helps when escaping $ in templates or for consistency in entity-based content.
No. &dollar; is U+0024 ($). &cent; is U+00A2 (¢). &euro; is U+20AC (€). Each maps to a different currency symbol.

Explore More HTML Entities!

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