If and Only If in LaTeX (\iff)

  ⟺  \iff
LaTeX command
\iff
Package
No package needed: built into LaTeX
Mode
Math mode only
Copy the Unicode character
⟺U+27FA

Where it is used

Writes a long double-headed arrow for logical equivalence, read "if and only if".

\iff produces \Longleftrightarrow with extra thick spacing on both sides. It joins two statements that imply each other, as in a theorem like n \text{ is even} \iff n^2 \text{ is even}. Logic texts often prefer \leftrightarrow or \Leftrightarrow for the biconditional inside formulas, keeping \iff for statements in prose. Because of that padding, \iff looks too loose inside compact subscripts or set-builder conditions. Do not confuse it with \equiv, which means identically equal or congruent modulo n.

Also listed under: Logik & Bukti

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

A⊆B  ⟺  A∩B=AA \subseteq B \iff A \cap B = A
\documentclass{article}
\begin{document}
If and Only If: $\iff$

\[ A \subseteq B \iff A \cap B = A \]
\end{document}

Related symbols

All Simbol Matematik →

Frequently asked questions

How do I write If and Only If in LaTeX?
Type \iff in math mode, for example $A \subseteq B \iff A \cap B = A$. It works in plain LaTeX without loading any package.
Which package do I need for \iff?
None. \iff is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \iff in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\iff$ in running text. If you only need the glyph in text, paste the Unicode character ⟺ instead (with XeLaTeX or LuaLaTeX and a font that has it).
Math poweredTulis LaTeX menggunakan AI

Editor LaTeX AI Terbaik, Alternatif Overleaf

Octree membantu penyelidik dari 15+ universiti menulis kertas penyelidikan dengan lebih cepat menggunakan AI

  • Jana diagram TikZ yang cantik menggunakan AI
  • Muat naik imej dan tukar ke LaTeX dengan lancar
  • Dapatkan bantuan segera untuk menulis dan memformat kertas penyelidikan