Skip to main content
v2026.11,858 entries · CC-BY 4.0

End of Proof Symbol in LaTeX: qed and qedhere

Add, change or place the end-of-proof (QED) symbol in LaTeX with amsthm: qedsymbol, qed and qedhere, plus fixes for common placement problems.

Written and maintained by CASRAI Editorial Board

Last updated

In LaTeX, the end-of-proof symbol (the QED symbol) is added automatically when you write a proof inside the proof environment from the amsthm package. To change it, redefine \qedsymbol; to place it correctly after a displayed equation or list, put \qedhere inside that last element. This guide gives a decision table for what to type depending on how your proof ends, and the failure cases the AMS documentation lists.

What it is used for in research

Mathematics and theoretical papers mark the end of a proof with a short symbol so a reader can see where the argument stops and the text resumes. The amsthm documentation describes its proof environment as automatically adding a QED symbol at the end. For the wider conventions of structuring theorems and proofs in a paper, see mathematics paper writing conventions for theorem and proof structure.

Install or access

The package is amsthm, maintained by the American Mathematical Society and listed on CTAN (version 2.20.6, dated 2020-05-29, under the LaTeX Project Public License 1.3c; checked 2026-10-29). The AMS documentation PDF that describes it is version 2.20.3 from September 2017, so the manual and the package carry different version numbers. AMS document classes already incorporate amsthm, so with an AMS class you do not load it separately. With another class, add this to the preamble:

\usepackage{amsthm}

Documentation: CTAN amsthm page and the AMS LaTeX page.

Step-by-step: add and control the symbol

  1. Load amsthm in the preamble (unnecessary under an AMS class).
  2. Write the proof inside \begin{proof} ... \end{proof}. The QED symbol is appended automatically.
  3. To use a different symbol, redefine it with \renewcommand. Overleaf’s example uses \renewcommand{\qedsymbol}{$\blacksquare$} to replace the default white square with a black one, and another example sets it to the letters QED (that example also loads amssymb).
  4. If the proof ends with a displayed equation, put \qedhere inside the equation, just before it closes.
  5. If the proof ends with a list, put \qedhere as the last thing before \end{enumerate} or \end{itemize}.
  6. For a long proof written as a section or subsection rather than a proof environment, use \qed after ordinary text.

An example for step 4:

\begin{proof}
  ...
  \begin{equation}
    a^2+b^2=c^2 \qedhere
  \end{equation}
\end{proof}

Decision table: how does your proof end?

The proof ends with What to type
Ordinary text Nothing; the proof environment adds the symbol
An amsmath display, or \[ ... \] \qedhere inside the equation
An equation where \qedhere gives an error \mbox{\qedhere}
A list \qedhere as the last thing before \end{enumerate} or \end{itemize}
eqnarray or $$ ... $$ Not supported by \qedhere; switch to an amsmath display
A section-style proof, outside the environment \qed after ordinary text

Source: AMS, Using the amsthm Package, version 2.20.3 (September 2017), checked 2026-10-29. With amsmath version 2 or later, \qedhere places the symbol flush right; with earlier versions it sits a quad away.

Output and how to read it

The symbol appears at the right end of the last line of the proof. If it lands on its own line, the proof most likely ends in a display or list (use \qedhere) or has a stray blank line (see below). To remove it from one proof, put \renewcommand{\qedsymbol}{} just before \end{proof}; to remove it from all proofs, put that line in the preamble.

Troubleshooting

  • A blank line before \end{proof} (or before an explicit \qed) disables the placement mechanism and can even set the symbol at the top of a new page. Delete the blank line.
  • \qedhere errors inside an equation: try \mbox{\qedhere}.
  • \qedhere in eqnarray or $$: the manual says it does not work there; amsmath displays and \[ ... \] were crafted for it.
  • Symbol needed outside a proof: use \qed, not \qedhere.
  • Documented display problems: in an unstarred multi-line display the final line is not numbered; inside split the number or label is suppressed; in an alignment with no ampersand the box does not go flush right.

Free alternatives and related packages

Package Notes
amsthm Defines proof, \qedsymbol, \qed, \qedhere; used by AMS classes (AMS manual); LPPL 1.3c (CTAN)
ntheorem Provides an automatic way of signalling the end of a proof (TeX FAQ)
QED package (Paul Taylor) Described as the apparently original automatic solution (TeX FAQ)
thmtools Named in the AMS manual: a QED symbol can be applied to any theorem element, not just proofs

For the editor side of this workflow, see Overleaf alternatives for collaborative LaTeX. For other symbols in manuscripts, see formatting symbols in the corresponding-author line in LaTeX and SI units in scientific writing.

FAQ

How do I change the end of proof symbol in LaTeX?

Redefine \qedsymbol with \renewcommand, for example \renewcommand{\qedsymbol}{$\blacksquare$}. Put it in the preamble to change every proof.

Why is my QED symbol on its own line?

Usually the proof ends in a displayed equation or a list, or there is a blank line before \end{proof}. Use \qedhere inside the last display or list, and remove the blank line.

What is the difference between \qed and \qedhere?

\qedhere puts the symbol at a chosen spot inside the final display or list of a proof environment. \qed is for use outside the proof environment, such as a long proof set as a section, and works properly only after ordinary text.

Sources

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about End of Proof Symbol in LaTeX: qed and qedhere

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Ask CASRAI · Regulatory Radar

Research-admin question? Get an answer that links its sources.

An AI assistant specialized in research administration. Every answer links its sources to check before you act. 2 questions free, no account. $29/month after.

  • Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.
  • Every answer numbers its sources and links each one, so you can check the source yourself.