Not equal to sign (≠) in HTML
The not equal to sign is an equals sign with a stroke through it. Its named reference is ≠ and its code point is U+2260.
At a glance
- Character
- ≠
- Named entity
- ≠
- Decimal reference
- ≠
- Hex reference
- ≠
- Unicode code point
- U+2260
- Unicode name
- NOT EQUAL TO
- In the entity reference
- Math, and pinned in quick access
In detail
Unicode gives this character a canonical decomposition: an equals sign followed by the combining long solidus overlay at U+0338. That means a normalising process can turn one character into two, or two into one, depending on which normalisation form it applies. Both render as a struck through equals in a competent font, and both are correct, but they are different byte sequences and a naive comparison will call them unequal.
The same overlay mechanism produces the whole family of negated relations. A less than sign followed by the overlay gives the not less than relation, and so on through the set. Where a precomposed character exists it is almost always the better choice, because font support for the combining overlay is uneven and a font that lacks it draws the stroke in the wrong place or not at all.
The sign is a mathematical relation, not a programming operator. Source code uses the ASCII sequences that its language defines, and a page showing code should reproduce those exactly. Rendering an inequality operator as this character in a code sample makes the sample look elegant and stops it from running when someone copies it.
In prose it is announced as not equal to by most screen readers, which is the outcome you want and a reason to prefer it over spelling the relation out in a formula. In a table header or a filter label, though, plain words are still clearer than a symbol most readers meet only in a maths class.
Examples
<p>For all n where n ≠ 0, the value is defined.</p>
<pre><code>if (n !== 0) {
// the code keeps the ASCII operator
}</code></pre>const composed = "\u2260"; // one character
const combining = "=\u0338"; // two characters, same appearance
composed === combining; // false
composed === combining.normalize("NFC"); // trueThings that catch people out
- Rendering a code sample with this character instead of the language operator produces a snippet that cannot be copied and run.
- The combining overlay renders badly in fonts that do not position it, giving a stroke that misses the equals sign or floats beside it.
- Comparing two strings that look identical can fail when one is precomposed and the other combining. Normalise before comparing.
Try it: HTML Entity Reference
Search 152 entities across 9 categories, switch the copy format between the character, the name, the decimal form and the hex form, and copy in one click.
HTML Entity Reference
LOCAL · Browser-OnlySearchable reference of 150+ HTML entities with one-click copy in any format
152 entities across 9 categories
Commonly Used
→Arrows(13)
±Math(35)
$Currency(8)
…Punctuation(21)
©Symbols(24)
πGreek(30)
½Fractions(6)
●Geometric(7)
æLatin Special(8)
Click any entity card to copy it in your chosen format. All data is embedded in the page and works offline.
Related HTML entities
All html entities →Less than or equal (≤) and greater than or equal (≥)
The inequality signs at U+2264 and U+2265, their entity forms, the slanted variants used in some traditions, and when to keep the ASCII operators instead.
Approximately equal to (≈) in HTML
The almost equal to sign at U+2248 with its entity forms, and how it differs from the congruent, asymptotic and identical to signs it is confused with.
Mathematical operator entities: sets, logic and calculus
Named entities for summation, integral, partial differential, set membership, union, intersection and the logical connectives, with their code points.
Infinity symbol (∞) in HTML
The infinity sign at U+221E, its entity forms, how it differs from the permanent paper and infinity emoji characters, and its use in pricing and limits.
Per mille sign (‰) in HTML
The per mille sign at U+2030, its entity forms, where parts per thousand are the natural unit, and the per ten thousand character used for basis points.
Square root symbol (√) in HTML
The radical sign at U+221A, its entity forms, why it has no overbar, when parentheses are compulsory, and the cube and fourth root characters.
Tools for this
- HTML Entity Reference Free online HTML entity reference - search and copy HTML entities with live preview
- HTML Entity Encoder Free online HTML entity encoder - encode or decode HTML entities to prevent XSS and display issues