Developer Web

Slug generator

What to do

Transformed in your browser · nothing is uploaded

Local · hyphens, because Google reads underscores as joiners

Turns a title into a URL slug: accents folded to plain letters, everything lowercased, and every run of non-alphanumeric characters collapsed to a single hyphen. The kebab-case and snake_case tabs do something different, and the difference matters if your title is not in English.

How to use the slug generator

1 Paste your text into the first box.
2 Choose what you want done to it.
3 Copy the result, or save it as a text file.

Folding accents rather than percent-encoding them is the right call for a URL even though browsers handle Unicode perfectly well now. An encoded URL is unreadable the moment it is copied into an email or a chat message, it breaks when something truncates it at a fixed length, and nobody can retype it from a printed page. "café" becomes "caf%C3%A9", which is nine characters for four letters.

The folding works by decomposing each letter into a base and its accent and then discarding the accent, so é becomes e, ü becomes u and Å becomes A. That covers most of western Europe and stops dead at letters that are not accented versions of anything. ß, Æ, Ø, Ł and the fi ligature have no base letter to fall back to, so they are dropped and replaced by a hyphen: straße gives stra-e, and Ærø gives r. Any writing system without Latin letters loses everything, so a Cyrillic or Chinese title comes back as an empty slug. If your titles are not in a Latin script, this tab is the wrong one and you need transliteration rather than folding.

The other two tabs keep every letter. kebab-case and snake_case only change the separators and the case, so Привет мир becomes привет-мир and stays usable. They also split on capital letters, which the slug does not: parseHTTPResponse gives parse-http-response in kebab-case and parsehttpresponse in a slug. Use the slug tab for URLs and the other two for identifiers.

Two conventions are worth holding to. Hyphens rather than underscores, because Google says plainly that it recommends hyphens and that underscores are conventionally used to join words rather than separate them. And keep slugs short: three to five words carries the topic, and once a URL is published, changing it costs you every link pointing at the old one unless you set up a redirect first.

What people use it for

  • Deriving a post URL from a headline before it is published and linked to
  • Turning a title with accents in it into a safe filename
  • Naming a CSS class or a data key from a human-readable label
  • Seeing what a title looks like once the punctuation and the case are gone
  • Checking whether a non-English title survives slugging at all

Questions

Hyphens. Google recommends them explicitly and notes that underscores are already used for joining words, as in a function name like format_date.

Google Search Central; URL structure best practices
Was this tool any good?
Internal signal only · I use it to find the tools worth rebuilding