HTML Entity for XOR (⊻)

Beginner
⏱️ 5 min read
📚 Updated: Aug 2025
🎯 1 Code Example
Unicode U+22BB

What You'll Learn

How to display the XOR symbol (⊻) in HTML using various entity methods. The XOR symbol (veebar) represents the exclusive OR logical operation and is essential for programming documentation, mathematical expressions, Boolean algebra, and technical content.

This character is part of the Mathematical Operators Unicode block and can be rendered with a hexadecimal reference, a decimal reference, the named entity ⊻, or a CSS escape in the content property.

⚡ Quick Reference — XOR Entity

Unicode U+22BB

Mathematical Operators block

Hex Code ⊻

Hexadecimal reference

HTML Code ⊻

Decimal reference

Named Entity ⊻

Most readable option

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

Complete HTML Example

This example demonstrates the XOR symbol (⊻) using hexadecimal code, decimal HTML code, and a CSS content escape on a pseudo-element:

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

<p>XOR using Hexa Decimal: &#x22BB;</p>
<p>XOR using HTML Code: &#8891;</p>
<p id="point">XOR using CSS Entity: </p>

</body>
</html>
Try It Yourself

🌐 Browser Support

The XOR entity is universally supported in all modern browsers:

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

👀 Live Preview

See the XOR symbol rendered live in different contexts:

Inline text The result of A ⊻ B is true when exactly one operand is true.
Large glyph
In a formula PQ = (PQ) ∧ ¬(PQ)
Monospace a ⊻ b → XOR gate output
Truth table 0 ⊻ 0 = 0 0 ⊻ 1 = 1 1 ⊻ 0 = 1 1 ⊻ 1 = 0

🧠 How It Works

1

Hexadecimal Code

&#x22BB; uses the Unicode hexadecimal value 22BB to display the XOR symbol. The x prefix indicates hexadecimal format.

HTML markup
2

Decimal HTML Code

&#8891; uses the decimal Unicode value 8891 to display the same character. This is one of the most commonly used methods.

HTML markup
3

CSS Entity

\22BB is used in CSS stylesheets, particularly in the content property of pseudo-elements like ::before and ::after.

CSS stylesheet
4

Named Entity

&veebar; is the semantic named entity — the easiest to read in source HTML and the most self-descriptive option.

HTML markup
=

Same visual result

All four methods produce the XOR glyph: . Unicode U+22BB sits in the Mathematical Operators block (U+2200–U+22FF).

Use Cases

The XOR symbol (⊻) commonly appears in the following scenarios:

📄 Programming Docs

Describe XOR in prose next to code (e.g. AB).

📐 Math Expressions

Exclusive OR in formulas where ⊻ is the standard operator.

🌐 Boolean Algebra

Truth tables, lecture notes, and logic simplification examples.

⚡ Logic & Hardware

Logic gate docs and educational content on digital design.

🔒 Cryptography

Explain stream ciphers, one-time pads, and XOR-based patterns.

🧮 Education

CS courses, textbooks, and interactive tutorials.

📝 Technical Articles

Bitwise tricks, hashing, checksums, and algorithms using XOR.

💡 Best Practices

Do

  • Use &veebar; for readable source markup
  • Pick one style (hex / decimal / named) per project
  • Add aria-label for standalone symbols
  • Test the glyph across browsers and devices
  • Pair ⊻ with plain text on first use

Don’t

  • Mix entity styles randomly in one file
  • Assume all fonts render ⊻ correctly
  • Use CSS escape \22BB inside HTML
  • Use HTML entities in JS (use \u22BB)
  • Confuse ⊻ (XOR) with ∧ (AND) or ∨ (OR)

Key Takeaways

1

Three HTML references all render ⊻

&#x22BB; &#8891; &veebar;
2

For CSS stylesheets, use the escape in the content property

\22BB
3

Unicode U+22BB belongs to the Mathematical Operators block (U+2200–U+22FF)

4

Prefer &veebar; for readability—it’s the most self-descriptive named entity

5

Always pair the symbol with explanatory text the first time you use it on a page

❓ Frequently Asked Questions

Use &#x22BB; (hex), &#8891; (decimal), &veebar; (named), or \22BB in CSS content. All produce ⊻.
U+22BB (hex 22BB, decimal 8891). It denotes exclusive OR in the Mathematical Operators block.
In programming documentation, math formulas, Boolean algebra, logic gates, cryptography explainers, CS coursework, and articles about bitwise algorithms.
HTML entities (&#8891; or &veebar;) go directly in markup. The CSS escape \22BB is used in stylesheets, typically in the content property of ::before or ::after. Same visual result, different layers of the stack.
Yes. &veebar;, &#8891;, and &#x22BB; are equivalent in modern browsers and all render ⊻.

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