Slug Generator

Turn a title into a clean URL slug, accents and punctuation handled, in your browser.

Runs entirely in your browser. Nothing is uploaded, logged or stored.

A slug is the readable part of a URL: the piece a person can look at and tell what the page is about. Getting there from a title means losing the accents, the punctuation and the spaces without losing the words.

How it works

Accented letters are decomposed into a base letter and a mark, and the mark is dropped: é becomes e, ü becomes u. That handles most of the Latin alphabet without a lookup table.

The letters that are not a base letter plus a mark are listed explicitly, because decomposition cannot help there: ß becomes ss, æ becomes ae, ø becomes o, ł becomes l. Straße and Strasse therefore give the same slug, which is the point.

Everything else that is not a letter or a digit becomes the separator, runs of separators collapse into one, and the ends are trimmed.

Examples

Case Input Result
A French title Crème brûlée : la recette de l'été creme-brulee-la-recette-de-l-ete
German, where the ß has to be spelled out Straße & Verkehr strasse-verkehr
Punctuation collapsing rather than piling up Hello --- World!!! hello-world

Frequently asked questions

Why a hyphen rather than an underscore?

Search engines treat a hyphen as a word separator and an underscore as a joiner, so hello_world can be read as one word. Both are offered because existing systems use both, but a hyphen is the right default for a public URL.

What happens to Greek, Cyrillic or Chinese text?

Those characters are dropped, and if a title is entirely in one of those scripts the slug comes back empty. That is deliberate: there is no single correct romanisation of them, several competing standards exist, and quietly picking one would put a transliteration in your URL that you never agreed to.

Is the slug guaranteed to be unique?

No, and it cannot be. Two different titles can reduce to the same slug — Straße and Strasse do, which is usually what you want. Uniqueness belongs to whatever stores the slug, normally by appending a number.

Should I keep the numbers?

They are kept. Digits are meaningful in a title far more often than not, and a slug that turned "top 10 recipes" into "top-recipes" would be describing a different page.

Good to know

  • Everything happens in your browser. What you paste is not uploaded, not logged and not stored.

Sources

All Code tools