Greater Than or Equal to in LaTeX

In math mode, greater than or equal to is \geq (or its short form \ge) and less than or equal to is \leq (\le): $x \geq 0$ gives x ≥ 0. Plain less than and greater than are the keyboard characters < and >, typed inside $ … $.

Inequality symbols

  • <
    <

    Less than. Type it inside math mode.

  • >
    >

    Greater than.

  • \leq
    ≤

    Less than or equal to; \le is identical.

  • \geq
    ≥

    Greater than or equal to; \ge is identical.

  • \leqslant
    ⩽

    Slanted ≤, common in European texts (amssymb); \geqslant for ≥.

  • \ll
    ≪

    Much less than; \gg for much greater than.

  • \nless
    ≮

    Not less than (amssymb); \ngtr, \nleq, \ngeq for the others.

  • \lesssim
    ≲

    Less than or similar to (amssymb); \gtrsim for the other side.

  • \leqq
    ≦

    Less than over a double line (amssymb); \geqq for ≧.

  • \textless
    Text mode, no math preview

    Text-mode <, for use outside math (\textgreater for >).

Try it live

Change the formula and the preview redraws as you type. Copy the LaTeX, download a PNG or SVG, copy it for Word, or use Edit here on any example below to load it.

Templates

Less than and greater than examples

Each result below is drawn from the LaTeX under it. Copy the code, edit it on this page, or open it in the full editor.

Less than and greater than signs

Inside math mode the keyboard < and > are the right symbols, with the correct spacing around them: $a < b$. MathJax also accepts \lt and \gt, which exist to avoid clashes with HTML tags, but standard LaTeX does not define them, so Overleaf reports "Undefined control sequence".

Outside math mode, pdfLaTeX with its old default font encoding prints < as ¡ and > as ¿. Either put the sign in math ($<$), use \textless and \textgreater, or add \usepackage[T1]{fontenc} to the preamble.

Choosing between ≤, ⩽ and ≦

\leq and \le are the same command; pick one and stay consistent. \leqslant (amssymb) draws the slanted form preferred in some countries and journals. \leqq draws the version with a double bar underneath. All three mean the same thing, so the choice is style, not meaning.

Many authors switch the whole document to the slanted form by adding \renewcommand{\leq}{\leqslant} and \renewcommand{\geq}{\geqslant} after loading amssymb.

Inequalities on web pages and in Markdown

In HTML or Markdown processed by MathJax, a < directly followed by a letter can be read as the start of an HTML tag and swallow the rest of the formula. Put spaces around it (a < b) or use \lt, which MathJax understands.

Common mistakes

  • LaTeX prints >= as two separate characters. It never merges them into ≥.

    Instead of
    x >= 0
    Write
    x \geq 0
  • In running text with the default pdfLaTeX font encoding, < prints as an inverted exclamation mark ¡.

    Instead of
    The value is <5 in all cases.
    Write
    The value is $<5$ in all cases.
  • \lt and \gt are MathJax conveniences. A LaTeX document needs the plain characters in math mode.

    Instead of
    \lt, \gt  % in a .tex file
    Write
    <, >
  • The slanted, negated and "similar to" forms come from amssymb; without it they are undefined.

    Instead of
    \leqslant  % without amssymb
    Write
    \usepackage{amssymb}

In Overleaf, MathJax and Word

  • Overleaf and pdfLaTeX

    <, >, \leq, \geq, \ll and \gg need nothing extra. \leqslant, \nleq, \lesssim and \leqq need \usepackage{amssymb}. \lt and \gt are not defined.

  • MathJax and KaTeX

    MathJax and KaTeX support every command on this page, including \lt and \gt. Mind the HTML issue: keep a space after < in formulas embedded in HTML.

  • Microsoft Word

    In a Word equation, typing \le or \ge and pressing Space inserts ≤ or ≥ through Math AutoCorrect. Copy for Word from the editor here pastes the full inequality as an editable equation.

Less than and greater than in LaTeX: questions

How do I write greater than or equal to in LaTeX?
Use \geq or \ge in math mode: $x \geq 5$. For the slanted ⩾ use \geqslant with amssymb.
How do I write less than in LaTeX?
Type < inside math mode: $a < b$. In plain text use \textless, or load \usepackage[T1]{fontenc} so the character prints correctly.
Is there a difference between \leq and \le?
No. \le is a shorter name for the same symbol; the output is identical.
Why does < print as ¡ in my LaTeX document?
The character is outside math mode and pdfLaTeX is using its old OT1 font encoding. Put it in math mode, use \textless, or add \usepackage[T1]{fontenc}.
How do I write not greater than or equal to?
Use \ngeq (amssymb), or \not\geq. \ngeq is the better-looking choice.

Have the formula as a picture?

Paste a screenshot or photo of the equation and get its LaTeX, ready to copy or open in the editor.

Convert an image to LaTeX