Skip to main content

Guides

Invisible Characters in URL Slugs Break Links and Split Duplicates

CleanPastedText editorial · Updated

Text workbench

Try it on your text

Cleaning mode

Removes hidden characters and standardizes AI-style punctuation.

Try a real example

Each sample contains a problem you cannot see.

Original

Pasted text

0 chars · 0 words

Cleaned

Ready to copy

0 changes

Text stays in this browser

Same words · No AI rewriting · No content logging

Why does a URL that looks fine still 404?

Because an invisible Unicode character makes it a different URL than the one you can see. Characters like a zero-width space (U+200B) or a non-breaking space (U+00A0) render as nothing, so a slug typed or pasted with one embedded in it looks identical to the clean version on screen, in a chat message, or in a spreadsheet of URLs. But a server does not compare URLs by how they look — it compares the exact byte sequence, and the invisible character is still part of that sequence, usually surviving as a percent-encoded triplet like %E2%80%8B. If no route matches that exact path, the request 404s even though a human reading the link sees nothing wrong.

How does an invisible character end up in a slug?

Almost always through pasting, not typing. A common path: someone copies a headline out of ChatGPT, Word, or Google Docs — any of which can carry a zero-width space, a non-breaking space, or a byte order mark from the source formatting or the model's own output — and pastes it straight into a CMS title field that auto-generates the URL slug from it. Most slugify functions lowercase text and turn ordinary spaces into hyphens, but they were written expecting ASCII whitespace, not the dozen or so Unicode code points that also render as blank space. A character the function doesn't recognize as whitespace to collapse just gets carried through into the published URL, invisible and intact.

The full set of code points that can do this — zero-width space, non-breaking space, soft hyphen, byte order mark, and others — is covered in the complete invisible Unicode characters list.

Is this a documented problem?

Yes. The organization that maintains the URL parsing standard used by every major browser has a report on exactly this. An issue filed against the WHATWG URL Standard on October 13, 2016 showed that inserting a zero-width space into an otherwise ordinary GitHub URL — between two words in the path — produced a 404, because the parser percent-encodes the character instead of treating it as equivalent to no character. The bug report notes that these cases are unusually hard to track down, since the character isn't visible in a browser's address bar, and confirming it requires a hex editor or a character-level tool.

What does this cost a site, specifically?

SymptomWhy it happens
Shared link 404sThe link was copied from a place that already had the invisible character baked into the slug (an email, a chat message, a spreadsheet), so it never matched a real route.
Two URLs for one pageA redirect or CMS fallback quietly serves the same content at both the clean slug and the one with the hidden character, splitting link equity between two indexable URLs instead of one.
Analytics undercount a pageTraffic to the byte-for-byte-different URL logs as a separate page in most analytics tools, so a single article's real traffic looks split across two rows.
Sitemap and internal-link mismatchAn internal link built from the raw pasted title points to the slug with the invisible character while the sitemap generator normalizes it away (or vice versa), so the two disagree about which URL is canonical.

None of this requires Google's index to be "confused" by the invisible character — the ordinary mechanics of duplicate URLs cause it. Google's own documentation on consolidating duplicate URLs covers exactly this class of problem: pick one canonical URL, 301-redirect or rel=canonical the others to it, and stop generating new duplicates at the source.

How do you find and fix it?

You can't spot this by looking at a rendered link — the character is invisible by design. Copy the actual slug string (not the link text) out of your CMS and paste it into the checker at the top of this page: any zero-width space, non-breaking space, soft hyphen, or byte order mark shows up as its own named row with its exact code point, and the cleaner strips it, leaving the rest of the slug untouched. For a title you're about to publish, run it through the cleaner before it ever reaches the slug field — that stops the duplicate URL from being created in the first place, which is easier than untangling one after Google has indexed both.

If the pasted text is going straight into code, JSON, or a CSV import rather than a slug field, the same invisible characters cause a different class of failure — see sanitizing copied text for code, JSON, and CSV for that case.

Common questions

Frequently asked questions

Why does a URL that looks correct still 404?

Because it isn't actually the URL it looks like. A zero-width space (U+200B), non-breaking space (U+00A0), or soft hyphen (U+00AD) has no visible glyph, so a slug like /best-ai-tools with one hidden inside it is indistinguishable from the clean version on screen. But the server sees a different byte sequence — usually the invisible character percent-encoded as %E2%80%8B or similar — and if no route matches that exact path, it 404s.

How does an invisible character get into a URL slug in the first place?

Almost always by pasting. Someone copies a page title out of ChatGPT, Word, or Google Docs — which can carry a zero-width space, non-breaking space, or byte order mark from AI output or the app's own formatting — into a CMS title or slug field. Most CMS slugify functions lowercase the text and swap spaces for hyphens, but they don't necessarily strip characters they don't recognize as whitespace, so the invisible character survives into the published URL.

Can an invisible character in a slug cause duplicate content?

Yes, indirectly. The hidden character makes the slug-with-character and the clean slug two different URL strings, even though they render identically and can carry the same page content if a route or redirect happens to serve both. That is exactly the scenario rel="canonical" and 301 redirects exist to resolve — see Google's own guidance on consolidating duplicate URLs — but it only gets fixed once someone notices there are two URLs, which is hard when the difference is invisible.

Is this a real, documented problem or a theoretical one?

It's documented. The WHATWG URL Standard's own issue tracker has a report (opened October 13, 2016) that a zero-width space inserted into an otherwise-valid GitHub URL produces a 404, precisely because the character survives percent-encoding instead of being silently dropped. Browsers and servers are not required to treat an invisible character as equivalent to no character at all.

How do I check whether my slugs already have this problem?

Copy the slug — not the rendered link text, the actual URL string from your CMS or address bar — and paste it into a character-level checker like the one on this page. An invisible character shows up as a named row with its code point even though it renders as nothing. You can also watch the character count: a slug that looks like 20 characters but counts as 21 has something hidden in it.

How do I stop this from happening again?

Clean the title before it reaches your slug field, not after. Paste AI-generated titles through a tool that strips invisible Unicode first, and make sure your CMS's slug generator restricts output to ASCII letters, digits, and hyphens rather than passing through anything it doesn't explicitly recognize as whitespace to collapse.

Continue reading

Related guides & tools