The LaTeX command for gcd is \gcd (greatest common divisor).
\gcdWriting a paper? The table generator and the BibTeX cleaner are one click away, no account.
Write \gcd inside math mode, that is between $…$ for inline math or in a \[ … \] or equation block for display math. It is part of core LaTeX math, so no extra package is required.
\gcd sets the name upright with operator spacing; typed as plain letters it would print in italics, as a product of variables.
$\gcd_{i=1}^{n} x_i$Open this example in the live preview: it renders as you type, with no compiler and no signup.
\csc\exp\log\ln\det\dim\ker\deg\arg\hom\operatorname{sgn}\operatorname{tr}\operatorname{rank}\operatorname{diag}Math operators in LaTeX: the full table or search all 350+ LaTeX symbols.
Use \gcd in math mode; it needs no extra package. For example, $\gcd_{i=1}^{n} x_i$.
None: \gcd is built into LaTeX, so no extra package is required.