Skip to content
All LaTeX symbols

Divides symbol (∣)

Relations

∣

LaTeX command

\mid

divides, with relation spacing

Use inside math mode: $\mid$ — base LaTeX, KaTeX and MathJax

In number theory a ∣ b means a divides b. Use \mid rather than a bare | so LaTeX spaces it as a relation. The same \mid is correct for 'such that' in set-builder notation and for conditional probability.

All ways to write it

CommandUsePackageCopy
\middivides, with relation spacingnone
\nmiddoes not divide, ∤amssymb
|plain bar — tighter spacing, use for absolute valuenone

Commands marked with a package need that \usepackage line in a LaTeX document.

Example

3 \mid 12, \qquad P(A \mid B) = \frac{P(A \cap B)}{P(B)}

Divisibility, and the vertical bar as 'given' in probability.

Questions

\mid or | for conditional probability?

\mid. It gets the spacing of a relation symbol; | is treated as an ordinary character and sits too close.

Related symbols

Using divides in Confluence

Confluence Cloud has no built-in LaTeX. With LaTeX Math for Confluence you add a math macro to any page, type \mid and it renders inline or as a block, with a live preview while you edit. Every command on this page renders there without extra packages.