How to Write Percent in LaTeX

In LaTeX % starts a comment, so everything after it on the line disappears. To print a percent sign, escape it with a backslash: 50\% gives 50%. The same \% works in text and in math mode.

Percent commands

  • \%
    %

    Percent sign, in text and math mode.

  • 50\%
    50 %

    A percentage, no space (common US style).

  • 50\,\%
    50 %

    With a thin space, as SI and ISO style recommend.

  • \qty{50}{\percent}
    Text mode, no math preview

    siunitx: number and percent with consistent spacing.

  • \textperthousand
    Text mode, no math preview

    Per mille ‰ in text (textcomp).

Try it live

Change the formula and the preview redraws as you type. Copy the LaTeX, download a PNG or SVG, copy it for Word, or use Edit here on any example below to load it.

Templates

Percent sign examples

Each result below is drawn from the LaTeX under it. Copy the code, edit it on this page, or open it in the full editor.

Why % makes text disappear

% is LaTeX’s comment character: the rest of the line, including the line break, is ignored. That is useful for notes in the source, but it means a 20% discount compiles to "a 20" with no error message. Search your source for % that is not preceded by a backslash when text goes missing.

Other characters with the same problem are #, $, &, _, { and }: each has a job in LaTeX and needs a backslash to print literally.

Percentages with siunitx

For documents with many numbers, siunitx keeps percent formatting consistent: \qty{12.5}{\percent} prints the number and sign with the spacing you configure once, and \num groups long numbers. The space between number and sign is set once in \sisetup, so switching a whole document between "12.5 %" and "12.5%" style is a one-line change.

LaTeX
\usepackage{siunitx}
...
The error rate fell to \qty{12.5}{\percent}.

Common mistakes

  • Unescaped % comments out the rest of the line, so "discount" never appears.

    Instead of
    a 20% discount
    Write
    a 20\% discount
  • \percent is a siunitx unit macro and only works inside \qty or \unit.

    Instead of
    \percent  % without siunitx
    Write
    \%
  • Inside \text the percent sign is still a comment character and must be escaped.

    Instead of
    \text{%}
    Write
    \text{\%}

In Overleaf, MathJax and Word

  • Overleaf and pdfLaTeX

    \% works everywhere. The editor greys out anything after an unescaped %, which is a quick way to spot the problem. siunitx commands need \usepackage{siunitx}.

  • MathJax and KaTeX

    MathJax and KaTeX accept \% in math. MathJax, like LaTeX, treats a bare % as a comment: 50% x renders as just 50. Escape it in web formulas too.

  • Microsoft Word

    Word needs no escaping: type % directly, in text and in equations. Copy for Word from the editor here converts \% to a normal percent sign.

Percent sign in LaTeX: questions

How do I type a percent sign in LaTeX?
Write \%. A bare % starts a comment.
Does \% work in math mode?
Yes. $50\%$ prints 50% in math, and MathJax accepts it too.
Why is the rest of my line missing after a percentage?
An unescaped % turned the rest of the line into a comment. Replace it with \%.
Should there be a space before the percent sign?
SI and ISO style put a (thin) space before %, many US style guides do not. Write 50\,\% or 50\% consistently, or let siunitx decide from one setting.

Have the formula as a picture?

Paste a screenshot or photo of the equation and get its LaTeX, ready to copy or open in the editor.

Convert an image to LaTeX