HTML Entity for Mars (♂)

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

What You'll Learn

How to display the Mars symbol (♂) in HTML using hexadecimal, decimal, and CSS escape methods. The symbol denotes the planet Mars in astronomy and astrology.

It is U+2642 (JUPITER) in the Miscellaneous Symbols block (U+2600–U+26FF). Use ♂, ♂, or CSS \2642. There is no named HTML entity for this character.

⚡ Quick Reference — Mars Symbol

Unicode U+2642

Miscellaneous Symbols

Hex Code ♂

Hexadecimal reference

HTML Code ♂

Decimal reference

Named Entity

Use numeric codes only

Reference Table
Name           Value
────────────   ──────────
Unicode        U+2642
Hex code       ♂
HTML code      ♂
Named entity   (none)
CSS code       \2642
Meaning        Planet Mars (♂)
Glyph          ♂
Example        Planets: ♂ Mars
1

Complete HTML Example

This example shows the Mars symbol (U+2642) using hexadecimal code, decimal HTML code, and a CSS content escape. This character has no named HTML entity:

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point:after{
   content: "\2642";
  }
 </style>
</head>
<body>
<p>Mars using Hexadecimal: &#x2642;</p>
<p>Mars using Decimal: &#9794;</p>
<p id="point">Mars using CSS Entity: </p>
</body>
</html>
Try it Yourself

🌐 Browser Support

The Mars symbol (♂) is widely supported when fonts include Miscellaneous Symbols (U+2600–U+26FF):

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

👀 Live Preview

See the Mars symbol (♂) in astronomy and astrology contexts:

Planet ♂ Mars
Solar system ♄ Mars ♂ Mars ♂ Saturn
Large glyph
Named entity (none) — use numeric codes
Numeric refs &#x2642; &#9794; \2642

🧠 How It Works

1

Hexadecimal Code

&#x2642; uses the Unicode hexadecimal value 2642 to display the Mars symbol (♂).

HTML markup
2

Decimal HTML Code

&#9794; uses the decimal Unicode value 9794 for the same character.

HTML markup
3

CSS Entity

\2642 is used in CSS stylesheets in the content property, often on ::after following a base character in markup.

CSS stylesheet
4

No Named Entity

U+2642 has no standard &...; named form. Use hex, decimal, or CSS escape only.

HTML markup
=

Same visual result

All three methods produce (♂). Unicode U+2642 is in Miscellaneous Symbols. Next: Kelvin Sign.

Use Cases

The Mars symbol (♂) is commonly used in:

🌌 Astronomy

Planet lists, solar system content, and space education with ♂.

✨ Astrology

Horoscopes, birth charts, and zodiac content using the Mars symbol.

📚 Education

STEM textbooks and tutorials covering planets and symbols.

📋 Reference

Planet tables, infographics, and encyclopedic content.

🎨 Design

Logos, icons, and UI that need the Mars (♂) character.

📊 Symbol maps

Character pickers and Unicode reference for planet symbols.

💡 Best Practices

Do

  • Use &#x2642; or &#9794; in HTML content
  • Use fonts that support Miscellaneous Symbols (U+2642)
  • Set <meta charset="utf-8">
  • Pick one numeric style per project
  • Add aria-label or nearby text (e.g. “Mars”) for accessibility

Don’t

  • Expect a named HTML entity for U+2642
  • Use CSS \2642 inside HTML text nodes
  • Use fonts without Miscellaneous Symbols support
  • Mix entity styles randomly in one file

Key Takeaways

1

Two HTML numeric references plus CSS for U+2642

&#x2642; &#9794;
2

For CSS, use \2642 in the content property

3

Unicode U+2642 — JUPITER

4

Miscellaneous Symbols block; glyph (♂)

❓ Frequently Asked Questions

Use &#x2642; (hex), &#9794; (decimal), or \2642 in CSS content. There is no named entity. All methods render ♂ (♂) when the font supports U+2642.
U+2642 (JUPITER). Miscellaneous Symbols block (U+2600–U+26FF). Hex 2642, decimal 9794. Used in astronomy and astrology for the planet Mars.
In astronomy and space content, astrology and horoscope sites, educational material about planets, planet reference lists, and any design or copy that requires the Mars symbol (♂).
HTML references (&#9794; or &#x2642;) go in markup. The CSS escape \2642 is used in stylesheets, typically on ::before or ::after. Both render ♂ (♂).
Named entities cover common characters; Miscellaneous Symbols like U+2642 use numeric hex or decimal codes or CSS escapes. That is standard for planet and zodiac symbols.

Explore More HTML Entities!

Discover 1500+ HTML character references — planet symbols, math, science, 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