URL Slug Generator

Turn any title into a clean URL slug, with accented characters transliterated rather than stripped, and optional stop-word removal.

How to use this calculator

  1. 1Paste a title or heading.
  2. 2Choose a separator, and whether to strip stop words.
  3. 3Set a maximum length if you want short URLs, then copy the result.

How the calculation works

normalize(NFD) → strip combining marks → map special letters → lowercase → replace non-alphanumerics with the separator → collapse → trim at a word boundary
NFD
Unicode canonical decomposition — splits "é" into "e" plus a combining acute accent
combining marks
The U+0300–U+036F range, removed after decomposition to leave the base letters
separator
Hyphen or underscore joining the words. Search engines treat hyphens as word separators

Decomposition before stripping is what makes accented text survive. Without it, "Café Crème" reduces to "caf-crme"; with it, "cafe-creme".

Some letters have no canonical decomposition — ß, æ, ø, ł, đ, þ — and need explicit mapping, or they vanish along with the punctuation.

Truncation cuts at a separator rather than a character count, so a slug never ends mid-word.

Worked example

A title with accents and punctuation

  1. 1.Decompose to separate accents from letters: "Café" becomes "Cafe" plus a combining mark, which is then removed.
  2. 2.Lowercase everything.
  3. 3.Replace punctuation — the colon, brackets and exclamation mark — with spaces.
  4. 4.Split on whitespace and rejoin with hyphens.
  5. 5.Result: cafe-creme-10-best-ways-to-make-coffee-2026-edition.

Result: cafe-creme-10-best-ways-to-make-coffee-2026-edition

The same title with stop words removed

  1. 1.The same transliteration and cleaning happens first.
  2. 2."to" is a stop word and is dropped.
  3. 3.Result: cafe-creme-10-best-ways-make-coffee-2026-edition.
  4. 4.Shorter, but "ways-make-coffee" reads less naturally than "ways-to-make-coffee".
  5. 5.Google has stated it does not need stop words removed, so this is a style preference rather than an optimisation.

Result: cafe-creme-10-best-ways-make-coffee-2026-edition

The transliteration bug in most slug functions

The obvious implementation is to lowercase the string and strip anything outside a–z, 0–9 and spaces. It works perfectly on English and mangles everything else. "Café" becomes "caf". "Über" becomes "ber". "Piñata" becomes "piata".

The fix is Unicode normalisation. NFD decomposes precomposed characters into a base letter plus separate combining marks, so "é" becomes "e" followed by U+0301. Removing the combining range then leaves the base letters intact, and "Café Crème" correctly becomes "cafe-creme".

A handful of letters have no canonical decomposition because they are distinct letters rather than accented forms — ß, æ, ø, ł, đ, þ. These need an explicit mapping table, which is why this calculator carries one. Without it they disappear silently along with the punctuation.

Hyphens, underscores, and never changing a slug

Use hyphens. Google has been explicit that hyphens are treated as word separators in URLs while underscores are not, so "best_coffee_maker" may be read as a single token where "best-coffee-maker" is read as three words. The difference is small but there is no upside to underscores.

Far more important than any of this: do not change a slug once it is published. A URL is an identity, and changing it creates a new page as far as search engines are concerned while turning the old one into a 404 for everyone who linked to it. Accumulated ranking does not transfer on its own.

If a slug genuinely must change — a title that was wrong, or a restructure — set a 301 redirect from the old URL to the new one. That passes the authority across and keeps existing links working. Getting the slug right the first time is easier than maintaining redirects forever, which is the real argument for thinking about it before publishing.

What this assumes, and where it stops

Assumptions

  • Latin-script output. Non-Latin scripts are decomposed where possible but have no ASCII equivalent.
  • Stop-word removal uses a short English list and is off by default.
  • Truncation cuts at a separator so words are never left as fragments.

Limitations

  • Produces ASCII slugs. Cyrillic, Greek, Arabic, Chinese and similar scripts have no canonical Latin decomposition and will be removed rather than transliterated — those languages generally do better with genuine Unicode URLs.
  • The stop-word list is English only and deliberately short.
  • Does not check whether the slug is already in use on your site. Duplicate slugs need a suffix, which is your CMS's job.
  • Cannot know your URL structure. The example URL shown is illustrative only.

Common questions

What makes a good URL slug?

Short, readable, hyphen-separated, lowercase, and descriptive of the page. Include the main keyword, drop punctuation and dates that will age badly, and aim for around three to six words. Most importantly, get it right before publishing, because changing it later costs you links.

Should I use hyphens or underscores?

Hyphens. Google treats hyphens as word separators in URLs but does not consistently do the same for underscores, so "coffee-maker-review" parses as three words while "coffee_maker_review" may be read as one token. There is no advantage to underscores.

Should I remove stop words from slugs?

Usually not. Google has said it does not need them removed, and dropping them can make a slug read awkwardly — "ways-make-coffee" against "ways-to-make-coffee". Remove them only when a slug is genuinely too long and readability does not suffer.

What happens to accented characters?

They are transliterated to their base letters, so "Café" becomes "cafe" rather than "caf". This works by decomposing each character into a base letter plus combining accent and then removing the accent — the naive approach of stripping non-ASCII characters deletes the whole letter.

Sources

Formula and content last reviewed on .

Results are estimates for information only, not professional advice.

Report an error

Tools people commonly use alongside the url slug generator.

See all developer tools calculators →