Not Equal Sign (≠): Meaning, Uses, and How to Type It
Date Published

The not equal sign (≠) states that two quantities are different: 3 ≠ 4 reads "three is not equal to four." It is an equals sign with a slash through it, and you can type it with Alt + 8800 in Word, Option + = on a Mac, ≠ in HTML, or \neq in LaTeX.
This guide covers what ≠ means, how it relates to the other inequality symbols, how programming languages spell it (!=, <>, ~=), and how to type it on every platform.
Copy and Paste the Not Equal Sign
- ≠ — not equal to (U+2260)
- ≢ — not identical to (U+2262)
- ≉ — not almost equal to (U+2249)
- ≆ — approximately but not actually equal to (U+2246)
- != — plain-text form used in most programming languages
The Not Equal Symbol Explained
The ≠ sign is built from the equals sign (=) and a diagonal stroke. The stroke is the mathematical convention for negation: it turns = into ≠, ∈ into ∉, and ≡ into ≢. The glyph is often called the "not equals sign," the "inequality sign," or simply "unequal."
Writing a ≠ b makes a weaker claim than any other comparison. It does not say which side is larger, only that the two are not the same. For that reason ≠ is symmetric (a ≠ b means the same as b ≠ a) and does not require the values to be ordered: two sets or two strings can be ≠ even though "greater than" means nothing for them.
Meaning and Uses of ≠
Inequality vs. Not Equal
In mathematics, "inequality" is the umbrella term for any statement comparing two values with <, >, ≤, ≥, or ≠. The first four are order inequalities; ≠ is the strict negation of equality. Every strict order inequality implies ≠ (if a < b, then certainly a ≠ b), but the reverse is false: a ≠ b tells you nothing about which one is bigger.
A simple example: the equation x² = 4 has the solutions x = 2 and x = −2, so the statement x² ≠ 4 holds for every real number except those two.
Common Mathematical Uses
- Excluding values — a fraction 1/(x − 3) is defined for x ≠ 3
- Distinct elements — "for all i ≠ j" means for every pair of different indices
- Hypothesis testing — the two-sided alternative hypothesis is written H₁: μ ≠ μ₀
- Function definitions — a function f is injective if x₁ ≠ x₂ implies f(x₁) ≠ f(x₂)
Not Equal in Programming
Almost every programming language needs a "not equal" operator, but none of them use ≠ because it is not on the keyboard. The spellings vary:
Language | Not equal operator | Notes |
|---|---|---|
Python | | |
JavaScript | | |
Java, C, C++, C#, Go, Rust, Swift | |
|
SQL | | both work in most databases |
Lua, MATLAB | |
|
Excel, Google Sheets | | |
Pascal, Visual Basic | |
|
Haskell, Erlang | |
|
Ruby, PHP, R | | PHP also has |
The JavaScript distinction matters in practice: "5" != 5 is false because the string is coerced to a number first, while "5" !== 5 is true. In SQL, note that NULL <> NULL does not evaluate to true; use IS NOT NULL or IS DISTINCT FROM instead.
How to Type the Not Equal Sign
Method | ≠ |
|---|---|
Unicode | U+2260 |
HTML entity | |
Windows Alt code | Alt + 8800 (Word and other Unicode-aware apps) |
Word (Alt + X) | type |
Mac | Option + = |
iPhone / Android | long-press the = key (Android Gboard); copy and paste on iOS |
LaTeX | |
Windows: There is no DOS-era Alt code for ≠, so Alt + 8800 only works in programs that accept Unicode decimal codes, such as Word and WordPad. The dependable route in Word is to type 2260 and press Alt + X, and inside an equation box (Alt + =) typing \neq converts automatically. In other apps, copy ≠ from the Character Map.
Mac: Press Option + = on a US keyboard. On some international layouts the shortcut differs, in which case the Character Viewer (Control + Command + Space, search "not equal") is the fallback.
iPhone and Android: iOS has no built-in key for ≠, so copy it from this page or create a text replacement in Settings > General > Keyboard > Text Replacement. On Android, Gboard shows ≠ when you long-press the = key on the symbols keyboard.
HTML: Write ≠ or ≠. The related entities are ≢ for ≢, ≉ for ≉, and ≇ for ≇.
Not Equal in LaTeX
In math mode, \neq and \ne are interchangeable and both print ≠. The general-purpose negation \not places a slash over the next relation symbol, so \not= also works and \not\equiv produces ≢. The amssymb package adds pre-drawn negated relations such as \ncong (≇), \nsim (≁), \nleq, and \ngeq, which usually look cleaner than the \not overlay.
```latex
\documentclass{article}
\usepackage{amsmath, amssymb}
\begin{document}
\[ a \neq b, \qquad x \ne 3, \qquad 0.1 + 0.2 \not= 0.3 \text{ (in floating point)} \]
\[ H_0\colon \mu = \mu_0 \quad \text{versus} \quad H_1\colon \mu \neq \mu_0 \]
\[ 7 \not\equiv 2 \pmod{3}, \qquad \pi \approx 3.14159, \qquad \triangle ABC \ncong \triangle DEF \]
\[ f \text{ is injective if } x_1 \neq x_2 \implies f(x_1) \neq f(x_2) \]
\end{document}
```
Like all relation symbols, \neq gets relation spacing automatically. Pasting a Unicode ≠ into a pdfLaTeX source produces an error unless the font setup supports it, so stick to the command.
Related Symbols
Symbol | Name | Meaning | Unicode | LaTeX |
|---|---|---|---|---|
= | equals | exactly the same value | U+003D | |
≠ | not equal | different values | U+2260 | |
≈ | almost equal | approximately equal (numbers) | U+2248 | |
≉ | not almost equal | not even approximately equal | U+2249 | |
≅ | approximately equal / congruent | congruent shapes, isomorphic structures | U+2245 | |
≇ | not congruent | shapes are not congruent | U+2247 | |
≡ | identical to | identity, equivalence, congruence mod n | U+2261 | |
≢ | not identical to | not equivalent | U+2262 | |
≃ | asymptotically equal | homotopy equivalence, asymptotic equality | U+2243 | |
≄ | not asymptotically equal | negation of ≃ | U+2244 | |
In short: ≈ compares numbers (π ≈ 3.14), ≅ compares figures or structures (congruent triangles, isomorphic groups), and ≡ states that two expressions are identically equal or congruent modulo some number (7 ≡ 1 (mod 3)).
What Does ≠ Mean?
It means "is not equal to." The statement a ≠ b is true whenever a and b have different values and false when they are the same. It says nothing about which is larger.
Is ≠ an Inequality?
Yes. Mathematicians count ≠ among the inequality symbols along with <, >, ≤, and ≥. It is the weakest of them because it does not specify an order, which also makes it the only one that applies to things that cannot be ordered, such as sets or strings.
What Is the Difference Between != and ≠?
They mean the same thing. ≠ is the typeset mathematical symbol; != is the keyboard-friendly spelling used in Python, JavaScript, C, Java, and most other programming languages. SQL and Excel prefer <>, and Lua and MATLAB use ~=.
Typesetting Comparisons Without the Guesswork
A paper that mixes ≠, ≈, ≡, and ≅ needs each symbol to mean exactly one thing and to be typed the same way every time. Octree, the AI LaTeX editor at useoctree.com, turns a request like "hypothesis test with a two-sided alternative" into correctly spaced \neq notation and shows you the compiled result as you write. For the complete set of equality and negated relation symbols with their LaTeX commands, visit https://tools.useoctree.com/symbols/relations.