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

Date Published

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

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.

Quick answer: What does ≠ mean? ≠ means "is not equal to": 3 ≠ 4. It is NOT EQUAL TO, Unicode U+2260, HTML &ne;. It says the two sides differ, not which one is larger.

How to type it: Option + = on a Mac, 2260 then Alt + X in Word, \neq or \ne in LaTeX, and != in most programming languages.

Not Equal Sign (≠): Copy and Paste

Copy the sign from the box below, or take the code you need from the table:

1≠

Not equal

Character

≠

Unicode

U+2260 (NOT EQUAL TO)

HTML entity

&ne; or &#8800;

LaTeX

\neq or \ne

Windows Alt code

No DOS Alt code; Word: 2260, then Alt + X

Mac

Option + =

Word / Google Docs

Equation: \neq; Docs: Insert → Special characters, search "not equal"

Related negated relations to copy: ≢ (not identical, U+2262), ≉ (not almost equal, U+2249), ≇ (not congruent, U+2247). In code, ≠ is spelled !=.

Not Equal Sign Definition

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

!=

<> was removed in Python 3

JavaScript

!= and !==

!== also checks the type (strict inequality)

Java, C, C++, C#, Go, Rust, Swift

!=

SQL

<> (standard) and !=

both work in most databases

Lua, MATLAB

~=

Excel, Google Sheets

<>

=IF(A1<>B1, "different", "same")

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

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 &ne; or &#8800;. The related entities are &nequiv; for ≢, &nap; for ≉, and &ncong; for ≇.

Google Docs: Insert → Special characters and search "not equal," or insert an equation and type \neq followed by a space.

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.

1\documentclass{article}
2\usepackage{amsmath, amssymb}
3\begin{document}
4\[ a \neq b, \qquad x \ne 3, \qquad 0.1 + 0.2 \not= 0.3 \text{ (in floating point)} \]
5\[ H_0\colon \mu = \mu_0 \quad \text{versus} \quad H_1\colon \mu \neq \mu_0 \]
6\[ 7 \not\equiv 2 \pmod{3}, \qquad \pi \approx 3.14159, \qquad \triangle ABC \ncong \triangle DEF \]
7\[ f \text{ is injective if } x_1 \neq x_2 \implies f(x_1) \neq f(x_2) \]
8\end{document}

Try this in Octree — free LaTeX editor with AI, compiles in your browser

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

\neq

≈

almost equal

approximately equal (numbers)

U+2248

\approx

≉

not almost equal

not even approximately equal

U+2249

\not\approx

≅

congruent

congruent shapes, isomorphic structures

U+2245

\cong

≇

not congruent

shapes are not congruent

U+2247

\ncong (amssymb)

≡

identical to

identity, congruence mod n

U+2261

\equiv

≢

not identical to

not equivalent

U+2262

\not\equiv

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)).

More: the approximately equal symbol, the congruent symbol, comparison operators in the mathematical expressions lesson, and every relation with its command on the relations symbol list.

Related symbols and guides

Not Equal Sign FAQ

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 ~=.

How do I type the not equal sign on a keyboard?

On a Mac press Option + =. On Windows there is no classic Alt code; in Word type 2260 and press Alt + X, or copy ≠ from this page.

How do I write not equal in LaTeX?

Use \neq or \ne in math mode, e.g. $a \neq b$. To negate other relations, put \not in front, as in \not\equiv.

Typesetting comparisons and hypotheses? Octree is an AI LaTeX editor in the browser: type H_1\colon \mu \neq \mu_0, see the PDF update, and let the AI fix compile errors. Open Octree free →

Try this in Octree — free LaTeX editor with AI, compiles in your browser