HTML Entity for Asterisk Math (*)

Beginner
⏱️ 5 min read
📚 Updated: May 2026
🎯 1 Code Example
Unicode U+002A

What You'll Learn

How to render the asterisk (*, Unicode U+002A) in HTML for multiplication-style math, footnotes, wildcards, and labels. This is the same character as the ASCII star on your keyboard; HTML gives you several equivalent escapes so you can avoid ambiguity when * is special in Markdown, templates, or build tools.

Use the named entity *, numeric * / *, or the CSS escape \002A in content. For published equations, you may also prefer dedicated multiplication signs such as × (U+00D7) or the dot operator ⋅ where style guides require it.

⚡ Quick Reference — Asterisk (U+002A)

Unicode U+002A

Basic Latin (ASCII)

Hex Code *

Hexadecimal reference

HTML Code *

Decimal (ASCII 42)

Named Entity *

Readable in source

Reference Table
Name           Value
────────────   ──────────
Unicode        U+002A
Hex code       *
HTML code      *
Named entity   *
CSS code       \002A
1

Complete HTML Example

This example shows the asterisk using hexadecimal, decimal, the named entity *, and a CSS content escape:

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point:after{
   content: "\002A";
  }
 </style>
</head>
<body>

<p>Asterisk Math using Hexa Decimal: &#x2A;</p>
<p>Asterisk Math using HTML Code: &#42;</p>
<p>Asterisk Math using HTML Entity: &ast;</p>
<p id="point">Asterisk Math using CSS Entity: </p>

</body>
</html>
Try it Yourself

🌐 Browser Support

U+002A is universal in browsers and fonts:

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

👀 Live Preview

Typical uses of the asterisk in web content:

Multiplication (informal) 3 * 4 = 12   (same as 3 × 4 in many fonts)
Large glyph *
Required field Email * (pair with “required” in copy)
Monospace / code const *ptr;
Footnote marker See section 2* for details.

🧠 How It Works

1

Hexadecimal Code

&#x2A; encodes U+002A using hex 2A. Leading zeros (e.g. &#x002A;) are optional but valid.

HTML markup
2

Decimal HTML Code

&#42; is the classic ASCII decimal code for the asterisk.

HTML markup
3

CSS Entity

\002A (or \2a followed by a space) appears in CSS content for pseudo-elements.

CSS stylesheet
4

Named Entity

&ast; is the standard named reference—easy to grep and safe when raw * is ambiguous.

HTML markup
=

Same visual result

All four forms render *. Unicode U+002A is ASTERISK in the Basic Latin range.

Use Cases

The asterisk is everywhere in math-flavored and general UI copy:

📐 Arithmetic & code

Informal multiplication, comments, and languages that use * for pointers or splats.

📄 Footnotes

Reference markers in articles, disclaimers, and endnotes.

🔍 Wildcards

Search boxes, glob help text, and SQL LIKE documentation.

💼 Forms

Required-field markers next to labels (always add wording or aria-required).

📚 Education

K–12 and e-learning UIs that mirror textbook multiplication notation.

♿ Accessibility

Pair * with visible “required” text or ARIA so the intent is announced.

🌐 i18n

One stable glyph across locales for the same keyboard symbol.

💡 Best Practices

Do

  • Use &ast; when tooling might treat raw * as markup
  • Pick one style (named vs decimal) per codebase for escaped asterisks
  • Document required fields with words, not only a red star
  • Use \002A only inside CSS content, not pasted into HTML text
  • Follow house style for × vs * in formal math publishing

Don’t

  • Rely on a lone * on a form label without “required” context
  • Confuse ASCII * with other star operators (e.g. U+2217, U+22C6)
  • Double-escape (&amp;ast;) unless you truly need it in nested contexts
  • Use CSS escapes inside HTML text nodes
  • Assume Markdown will leave inline * untouched

Key Takeaways

1

Four common references all render *

&#x2A; &#42; &ast;
2

For CSS, use \002A in content

\002A
3

U+002A is Basic Latin—universal font coverage

4

Prefer &ast; when escaping improves clarity in source

5

For strict math typography, consider × or dot operators per your style guide

❓ Frequently Asked Questions

Use &ast;, &#42;, &#x2A;, or \002A in CSS content. All produce the same * character.
U+002A (ASCII 42). Unicode name: ASTERISK.
When Markdown, MDX, JSX comments, or template engines might interpret *; in generated markup where you want an explicit escape; or in teaching materials that show the literal entity forms.
HTML uses character references in the document; CSS uses \002A (or \2a) inside stylesheets. Same code point, different syntax rules.
Yes: &ast;. It is equivalent to &#42; and &#x2A; in modern browsers.

Explore More HTML Entities!

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