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:
- ModernTex: when a build fails, the Build button shows the error count and the last good PDF stays on screen. The Build Results panel lists each error, warning and note in plain language, Compile › Next Issue steps through them, and Raw Log shows the full LaTeX log. See ModernTex.
- Overleaf: the logs panel, opened with the button next to Recompile, lists each error and warning with its file and line, and the editor marks the line in the gutter. The unprocessed log is at the bottom of that panel.
- TeXShop: the console window shows the log as it is written and stops at the error. Goto Error moves the source window to the line. TeXShop's default pdfLaTeX command includes
--file-line-error, so the same error starts with the file and line in place of the!:./main.tex:3: Too many }'s.and./main.tex:3: Missing } inserted.
Related errors
- Runaway argument: when the missing brace belongs to a command's argument.
- Paragraph ended before \x was complete: the same, caught at a blank line.
- Extra alignment tab has been changed to \cr: the other error that braces and
&produce in tables. - Missing $ inserted: when the formula itself is not closed.