Skip to content
All LaTeX symbols

Modulus and mod (|z|, a mod n)

Miscellaneous

mod

LaTeX command

|z|

modulus of a complex number

Use inside math mode: $|z|$ — base LaTeX, KaTeX and MathJax

'Modulus' means two things: the absolute value of a complex number, written with bars, and the mod operation of number theory. LaTeX has three mod commands with different spacing and parentheses; \bmod for an operator inside an expression, \pmod to end a congruence.

All ways to write it

CommandUsePackageCopy
|z|modulus of a complex numbernone
a \bmod nbinary mod, no parenthesesnone
a \equiv b \pmod{n}congruence with (mod n)none
a \mod nmod with leading spacenone
\operatorname{mod}upright word formnone

Example

|3 + 4i| = 5, \qquad 17 \bmod 5 = 2

Complex modulus and the remainder operation.

Questions

\bmod, \pmod or \mod?

\bmod inside an expression (a \bmod n). \pmod{n} at the end of a congruence with parentheses. \mod is like \pmod without the parentheses.

Related symbols

Using modulus / mod in Confluence

Confluence Cloud has no built-in LaTeX. With LaTeX Math for Confluence you add a math macro to any page, type |z| 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.