Generate

Make a URL slug

Paste the title, copy the slug.

The rule is the one most content systems use: normalise, drop the accent marks, lowercase, replace everything that is not a letter or a digit with a hyphen, then collapse the repeats.

Accents are stripped rather than transliterated, so São Paulo becomes sao-paulo. Letters that are not Latin — Greek, Cyrillic, Chinese — are kept as they are rather than dropped, because a slug of empty hyphens helps nobody and browsers encode them correctly.

The result is capped at 80 characters and never ends in a hyphen. It will not shorten a long title to a whole word: a slug cut mid-word reads worse than a longer one that ends cleanly.

Questions

Should the slug match the title exactly?

No. A slug exists to be readable and stable; the title can change without the URL having to.

Are uppercase letters a problem?

They work, but some servers treat them as different and others lowercase them, which gives two URLs for one page. Lowercase avoids it.

Why keep non-Latin letters?

Dropping them leaves a row of hyphens. Browsers display and encode them correctly, and search engines read them.

Does it translate between languages?

No. Transliteration is a different job with different answers, and this page does one thing only.

More text and code