FormaTeX
WarningTypography & Layout

Overfull \hbox (Line Too Wide)

Overfull \hbox (Xpt too wide) in paragraph at lines N--M.

What this error means

A line of text is wider than the text area, causing text to stick out into the margin. This is a warning, not an error — compilation continues — but it usually produces visually poor output with text outside the page margins.

Common causes

  • A long word or URL that LaTeX can't hyphenate
  • \texttt{} or verbatim text that can't be line-broken
  • An oversized image or table
  • Tight column widths in a table forcing content overflow

How to fix it

For long URLs, use the url or hyperref package with automatic line-breaking. For text, add \sloppy to allow looser line-breaking, or manually insert \- to hint where hyphenation is allowed. For images, ensure they fit within \textwidth.

Code examples

Causes the error
\documentclass{article}
\begin{document}

See the documentation at https://www.example.com/very/long/url/that/does/not/break/automatically/in/latex.

\end{document}
Fixed
\documentclass{article}
\usepackage{hyperref}  % enables automatic URL line-breaking
\begin{document}

See the documentation at \url{https://www.example.com/very/long/url/that/does/not/break/automatically/in/latex}.

\end{document}

Related errors

Test the fix live

Paste your LaTeX into the playground and compile instantly.

One quick thing

We track anonymous usage — page views, feature usage, compilation events — to understand what works and what doesn't. No ads, no personal data, no third-party sharing.

Cookie policy