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|$, works in 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

  • |z|modulus of a complex numberNo package needed
  • a \bmod nbinary mod, no parenthesesNo package needed
  • a \equiv b \pmod{n}congruence with (mod n)No package needed
  • a \mod nmod with leading spaceNo package needed
  • \operatorname{mod}upright word formNo package needed

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.

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.

Related symbols

Also in Miscellaneous

See all LaTeX symbols