HTML Entity for Diamond Operator (⋄)

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

What You'll Learn

How to display the diamond operator (⋄) in HTML using named, hexadecimal, decimal, and CSS entity methods. This symbol is U+22C4 (DIAMOND OPERATOR) in the Mathematical Operators block (U+2200–U+22FF), used in logic, set theory, number theory, and programming notation.

You can render it with the named entity ⋄, hexadecimal ⋄, decimal ⋄, or CSS escape \22C4. Do not confuse with geometric diamonds (U+25C6) or (U+25C7). See also XOR (⊻) for another math operator.

⚡ Quick Reference — Diamond Operator

Unicode U+22C4

Mathematical Operators block

Hex Code ⋄

Hexadecimal reference

HTML Code ⋄

Decimal reference

Named Entity ⋄

Most readable in HTML source

Reference Table
Name           Value
────────────   ──────────
Unicode        U+22C4
Hex code       ⋄
HTML code      ⋄
Named entity   ⋄
CSS code       \22C4
1

Complete HTML Example

This example demonstrates the diamond operator (⋄) using hexadecimal code, decimal HTML code, the named entity, and a CSS content escape:

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point:after{
   content: "\22C4";
  }
 </style>
</head>
<body>
<p>Diamond Operator using Hexadecimal: &#x22C4;</p>
<p>Diamond Operator using HTML Code: &#8900;</p>
<p>Diamond Operator using HTML Entity: &diamond;</p>
<p id="point">Diamond Operator using CSS Entity: </p>
</body>
</html>
Try it Yourself

🌐 Browser Support

The diamond operator entity is supported in all modern browsers; use a font with Mathematical Operators coverage for best display:

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

👀 Live Preview

See the diamond operator (⋄) in mathematical and logical contexts:

Operator
Logic p   □ p (diamond vs box)
vs shapes ⋄ operator   ◆ filled   ◇ outline
Large glyph
Monospace refs &diamond; &#x22C4; &#8900; \22C4

🧠 How It Works

1

Named HTML Entity

&diamond; is the semantic named entity for the diamond operator—the easiest to read in source HTML.

HTML markup
2

Hexadecimal Code

&#x22C4; uses the Unicode hexadecimal value 22C4. The x prefix indicates hexadecimal format.

HTML markup
3

Decimal HTML Code

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

HTML markup
4

CSS Entity

\22C4 is used in CSS stylesheets, particularly in the content property of ::before and ::after.

CSS stylesheet
=

Same visual result

All four methods produce the diamond operator: . Unicode U+22C4 is in Mathematical Operators (U+2200–U+22FF).

Use Cases

The diamond operator (⋄) is commonly used in:

📐 Mathematics

Diamond operators in modular forms and related number-theory notation.

∨ Logic

Modal or formal operators (e.g. diamond for “possibility” alongside box □).

📊 Set theory & algebra

Notation for operations or relations in set theory, lattices, and abstract algebra.

💻 Programming docs

Technical documentation describing algorithms or formal notation.

🎓 Education

Math tutorials, logic courses, and textbooks with diamond symbols.

🔤 Entity references

Unicode tables and HTML entity guides for math operators.

💡 Best Practices

Do

  • Use &diamond; for readable math-heavy markup
  • Choose math-friendly fonts (Cambria Math, STIX Two Math)
  • Add context or aria-label when meaning is non-obvious
  • Use \22C4 only inside CSS content
  • Pick one entity style per project

Don’t

  • Confuse ⋄ (operator U+22C4) with ◆ (U+25C6) or ◇ (U+25C7)
  • Use geometric diamond codes for mathematical operator notation
  • Rely on fonts that omit Mathematical Operators
  • Put CSS escape \22C4 in HTML text nodes
  • Mix entity styles randomly in one file

Key Takeaways

1

Four ways to render ⋄ in HTML

&diamond; &#x22C4; &#8900;
2

For CSS stylesheets, use the escape in the content property

\22C4
3

U+22C4 DIAMOND OPERATOR—not a shape glyph

4

Prefer &diamond; for readability in HTML source

5

Mathematical Operators block—widely supported in modern browsers

❓ Frequently Asked Questions

Use &diamond; (named), &#x22C4; (hex), &#8900; (decimal), or \22C4 in CSS content. All produce ⋄.
U+22C4 (DIAMOND OPERATOR). Mathematical Operators block (U+2200–U+22FF). Hex 22C4, decimal 8900.
In mathematical content, logic notation, set theory, programming documentation, technical papers, and any context requiring the diamond symbol (e.g. modal logic, modular forms, diagram notation).
&diamond; is easier to read and remember in HTML. Numeric codes (&#8900; or &#x22C4;) work in all contexts including when named entities are escaped. CSS \22C4 is for stylesheets. Same character ⋄.
No. The diamond operator (⋄, U+22C4) is a math/operator symbol. Filled diamond (◆) is U+25C6; white diamond (◇) is U+25C7. Use &diamond; or &#8900; for the operator.

Explore More HTML Entities!

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