Skip to content

overflow-wrap vs word-break: How to Break Long URLs Without Breaking Your Layout

By 7 min read

A long URL with no spaces can make a page wider than a phone screen. Here is how to find the culprit, the difference between overflow-wrap and word-break, the flexbox trap, and how to break URLs neatly.

id
Cover for the article on breaking long URLs with overflow-wrap

overflow-wrap is a CSS property that lets the browser break a long word or URL onto the next line so the text doesn't spill out of its box. Without it, a string with no spaces, like developers.google.com/speed/pagespeed/insights, is treated as one unbreakable word, and on a phone it can make the whole page wider than the screen. As of October 2026, overflow-wrap is marked Baseline widely available on MDN, so it's safe to use in every modern browser.

Here's what happened:

Hafidz Nc

Fractional Head of Digital