HTML Entity for Mars (♂)

Beginner
5 min read
Updated: Sep 2026
1 example
Unicode U+2642

What Is the Mars Entity?

Mars (♂) is the Miscellaneous Symbols character at Unicode U+2642 (MALE SIGN). The same glyph is the traditional planet Mars symbol in astronomy and astrology — and the male gender sign.

Remember
Character     ♂
Unicode       U+2642
Named entity  ♂
Hex entity    ♂
Decimal       ♂
CSS escape    \2642

Named, hex, decimal, CSS, and a typed character all produce the same glyph: ♂. Prefer ♂ in HTML source — there is no separate &mars; name.

Quick Reference

One table for every form you will actually use.

FormCodeWhere it goes
Named entity♂HTML markup (best default)
Hex entity♂HTML markup
Decimal entity♂HTML markup
CSS escape\2642Stylesheet content
Direct character♂UTF-8 HTML text

When to Use Which

SituationUse
Readable HTML source♂
Numeric entity required♂ or ♂
Generated text via ::before / ::aftercontent: "\2642"
Venus / female symbol ♀See Female Sign (♀)
Gender-focused page for the same glyphSee Male Sign

Live Preview

Mars symbol rendered in astronomy and comparison contexts.

Inline text Planet: Mars ♂
Large glyph ♂
Named entity ♂ → ♂
vs Venus ♀ ♂  |  ♀
With entities Named: ♂ | Hex: ♂ | Decimal: ♂

Complete HTML Example

One page that shows the Mars symbol with named, hex, decimal, and CSS forms. Use View Output or open the live editor.

Named + Hex + Decimal + CSS

Four ways to produce ♂ in a single document.

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Mars Symbol (&male;)</title>
  <style>
    #point::after {
      content: "\2642";
    }
  </style>
</head>
<body>
  <p>Using Named Entity: &male;</p>
  <p>Using Hex Code: &#x2642;</p>
  <p>Using HTML Code: &#9794;</p>
  <p id="point">Using CSS Entity: </p>
  <p>Planet: Mars &male;</p>
</body>
</html>
Try It Yourself

How It Works

1. Named: &male; is the clearest HTML form and renders ♂.

2. Hex: U+2642 → &#x2642; in HTML. Same result as the named entity.

3. Decimal: same code point as 9794 → &#9794;. Same result as hex.

4. CSS: use \2642 in content (not an HTML entity). #point::after appends that ♂ after the paragraph text.

Pitfalls & Tips

Common mistakes when working with the Mars symbol.

Named

Use &male;, not &mars;

HTML5 defines &male; for this glyph. There is no &mars; entity.

Same glyph

Same as male sign

U+2642 is one character used for both Mars and male. Context decides the meaning.

Related

Not Venus ♀

Venus / female is &female; (U+2640) — a different character.

CSS vs HTML

Do not mix escapes

\2642 belongs in CSS. &male; / &#x2642; / &#9794; belong in HTML.

Encoding

Declare UTF-8

If you type ♂ directly, keep <meta charset="UTF-8"> so the file is not misread.

Semicolon

End references

Always finish with ; — write &male;, not &male.

Browser Support

Mars / male sign (U+2642) and its entity forms (&male;, &#x2642;, &#9794;, CSS \\2642) are supported in all mainstream browsers.

✓ Universal encoding

Mars (♂)

Encode with named, hex, decimal, or CSS escape — or type ♂ directly in UTF-8 HTML.

100% Browser coverage
Google Chrome Supported
Yes
Microsoft Edge Supported
Yes
Mozilla Firefox Supported
Yes
Apple Safari Supported
Yes
Opera Supported
Yes
Internet Explorer IE 9+
Yes*
U+2642 Full support

Bottom line: Prefer &male; for readable HTML. Use \\2642 only inside CSS content.

Key Takeaways

  • Unicode: Mars is U+2642 (decimal 9794).
  • HTML: prefer &male; — or use &#x2642; / &#9794;.
  • CSS: use \2642 inside content for generated text.
  • Related: Venus is &female; (♀) — a different character.

One line: U+2642 → &male; / &#x2642; / &#9794; / CSS \2642.

Frequently Asked Questions

Use &male; (named), &#x2642; (hex), &#9794; (decimal), or the CSS escape \2642 in the content property. All render ♂. Prefer &male; in HTML source.
U+2642 (MALE SIGN). Hex 2642, decimal 9794. It belongs to the Miscellaneous Symbols block and is also used as the planet Mars symbol.
Yes. &male; is the HTML5 named entity for ♂. There is no separate &mars; name — use &male;.
Use it for astronomy, astrology, planet references, and any content that needs the ♂ Mars symbol. The same entity is also used for the male gender sign.
HTML entities (&male;, &#9794;, or &#x2642;) go in markup. The CSS escape \2642 is used in stylesheets (usually in the content property of ::before/::after). Both render ♂.
No. Mars / male is ♂ (U+2642, &male;). Venus / female is ♀ (U+2640, &female;).

Did you know?

Mars is Unicode U+2642 (decimal 9794) — MALE SIGN in Miscellaneous Symbols. The same glyph is used as the planet Mars and the male gender symbol. HTML5 provides &male;. Related: Venus / female sign &female; (♀, U+2640).

Next: Kelvin Sign

Continue to the next HTML entity in this sequence.

Continue tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

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