Using ≠ in math
The sign is an equals sign with a slash through it. It states that two expressions have different values:
- 5 + 2 ≠ 8
- x ≠ 0, a common condition before dividing by x
- a ≠ b ≠ c is ambiguous, because it doesn’t say that a ≠ c. Write “a, b and c are distinct” instead.
- A ≠ ∅ says that set A is not empty.
Related signs: ≈ means approximately equal, ≡ means identical or congruent in modular arithmetic, and ≢ means not identical. In LaTeX, \neq or \ne gives ≠, and \not\equiv gives ≢.
Not equal in code and spreadsheets
| Where | Not equal | Example |
|---|---|---|
| Python, C, Java, PHP | != | if x != 0: |
| JavaScript | !== (strict) or != | a !== b |
| SQL | <> (standard) or != | WHERE status <> 'closed' |
| Excel, Google Sheets | <> | =IF(A1<>B1, "diff", "same") |
| Visual Basic | <> | If a <> b Then |
| Lua | ~= | if a ~= b then |
In JavaScript, prefer !==. The loose != converts types first, so 0 != "" is false. Some coding fonts draw != as a single ≠ through ligatures, but the file still contains two characters, and the code needs them.
Typing ≠ in documents
- Word: in an equation (Alt+=), type
\neand press space. - Google Docs: Insert > Special characters and search “not equal,” or Insert > Equation and type
\neqfollowed by a space. - Mac: besides the Option shortcut, the Character Viewer (Control+Command+Space) lists related math signs.
- Excel filters and conditional formatting: the built-in “does not equal” option does the same job as <> without a formula.
- Phones: neither iPhone nor Android has a default ≠ key. Copy it here or create a text replacement.
In math content, use the real ≠ rather than a stand-in like =/=, which screen readers announce as three separate symbols.
Frequently asked questions
How do I type the not equal sign on a Mac?
Press Option+Equals (Option+=).
How do I type ≠ on Windows?
In Word, type 2260 and press Alt+X. Elsewhere, copy it from this page; the short Alt codes don’t include it.
How do you write not equal in Excel?
Use <>, as in =A1<>B1. Excel formulas don’t accept ≠.
What does != mean?
It is the not-equal operator in most programming languages, the plain-text version of ≠.
Unicode data: Unicode Character Database 18.0.0 (unicode.org).