Purplelink
← All LaTeX errors

Too many }'s and Missing } inserted

Two messages for one problem: braces that do not pair up. One reports a closing brace too many, the other a group that was never closed.

What it means

These two messages are opposite sides of one problem, braces that do not pair up. Too many }'s means TeX met a closing brace with no opening brace before it to match. Missing } inserted means a group was still open at a point where it had to be closed, such as the end of a formula, a table cell or an environment, so TeX closed it for you. In both cases the build continues, and the formatting around that spot is likely to be wrong.

The log line

This small file triggers the error:

\documentclass{article}
\begin{document}
The term \emph{endogeneity}} is defined in Section 2.
\end{document}

Compiled with pdfLaTeX (TeX Live 2026), it writes this to the .log file:

! Too many }'s.
<recently read> }

l.3 The term \emph{endogeneity}}
                                 is defined in Section 2.
You've closed more groups than you opened.

Change line 3 to The variance is $\sigma^{2$ in both groups. and the log shows the second message:

! Missing } inserted.
<inserted text>
                }
l.3 The variance is $\sigma^{2$
                                in both groups.
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

In the first excerpt the l.3 line breaks right after the second brace of \emph{endogeneity}}. That brace has no partner. In the second excerpt, <inserted text> followed by } is TeX reporting what it added, and the l.3 line breaks at the $ that tried to end the formula while ^{2 was still open.

To try a fix without touching your project, save the example as a .tex file and compile it online with the LaTeX to PDF tool.

Why it happens

The causes below are in order of likelihood. Each has a before and an after you can compare with your own source.

1. An extra closing brace

Typed twice, or left behind when a command such as \emph{ was deleted and its closing brace was not.

Before

The term endogeneity} is defined in Section 2.

After

The term endogeneity is defined in Section 2.

2. A brace opened inside math and not closed before the $

Exponents, subscripts and \frac arguments are the usual places. The message is Missing } inserted and the break is at the closing $.

Before

The variance is $\sigma^{2$ in both groups.

After

The variance is $\sigma^{2}$ in both groups.

3. A group still open when an environment ends

A brace opened inside center, itemize or a similar environment has to be closed inside it. Here \end{center} arrives while the {\large group is open.

Before

\begin{center}
{\large Summary of results
\end{center}

After

\begin{center}
{\large Summary of results}
\end{center}

4. A brace group that runs across table cells

Each cell of a table is its own group, so a brace opened in one cell cannot be closed in the next. TeX reports Missing } inserted at the & and then Missing { inserted. Format each cell separately.

Before

{\bfseries Model & Accuracy} \\

After

\textbf{Model} & \textbf{Accuracy} \\

5. A set brace typed without its backslash

Literal braces are written \{ and \}. When the closing one loses its backslash inside a formula, TeX words the complaint differently: Extra }, or forgotten $.

Before

Let $S = \{1, 2, 3}$ be the index set.

After

Let $S = \{1, 2, 3\}$ be the index set.

How to find the line

For Too many }'s the l. line breaks right after the extra brace, so the position is exact. For Missing } inserted the break shows where TeX needed the group closed, at a $, an & or an \end, and the opening brace is somewhere before it. An editor that highlights matching braces settles it quickly: put the cursor on each brace near the break and see which one has no partner.

When you run pdflatex in a terminal without -interaction=nonstopmode, TeX stops at the error and prints a ? prompt. Press Return to carry on past the error, type x to quit, or type h for TeX's own help text, which is the paragraph you see after the l. line in the log. Editors run TeX in non-stop mode, so you get the log and never see the prompt.

What each editor shows:

Related errors

Frequently asked questions

How do I find an unmatched brace in a long LaTeX file?
Start at the line given in the log. If that does not show it, comment out half of the document body and compile, then repeat on the half that still fails. Most editors also highlight the partner of the brace under the cursor.
Why does Missing } inserted appear in a table?
A brace group cannot span cells. In {\bfseries A & B} the group opens in one cell and closes in the next, so TeX closes it at the & and then finds an unmatched brace in the following cell. Give each cell its own formatting command.
Do braces in comments count?
No. Everything after an unescaped % on a line is ignored, including braces. A closing brace that sits after a % is invisible to TeX, which is a common way to end up with a missing brace.