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
\middivides, with relation spacingNo package needed\nmiddoes not divide, ∤Package: amssymb|plain bar: tighter spacing, use for absolute valueNo package needed
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.
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.