Slug generator
Transformed in your browser · nothing is uploaded
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
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.
They are folded to their base letters, so café becomes cafe rather than caf%C3%A9, which is the whole point of a slug.
ß is not an accented s, so there is no base letter to fold it to. It gets dropped like any other non-Latin character. Write it as strasse before converting.
Æ, Ø, Ł, Đ, Þ and the fi ligature, for the same reason: they are letters in their own right rather than accented versions of Latin ones.
Because folding has nothing to work with. A non-Latin title needs transliteration, which is a different operation. The kebab-case tab keeps the original letters if you would rather have those.
The slug strips anything that is not a plain letter or digit. kebab-case keeps accents and other scripts, and it splits on capital letters, so parseHTTPResponse becomes parse-http-response.
Short. Three to five words carries the topic. A slug is not a place to repeat the whole headline.
Only if the page is genuinely dated, such as a news item. On evergreen content it invites a rewrite later, and rewriting a URL is what you are trying to avoid.
Only where the slug reads fine without them. Stripping every small word makes some titles unreadable, and the ranking gain from doing it is not real.
You can, but every existing link breaks unless you put a permanent redirect in place first. Decide before publishing.
A 301. It is permanent and passes ranking to the new URL. A 302 keeps the old URL indexed, which is the opposite of what a rename needs.
Yes, and they are kept exactly as typed. A leading number is fine in a URL, though not in a CSS class or a JavaScript identifier.
They become a hyphen like any other punctuation. If the word matters, spell it out as "and" or "plus" before converting.
On most servers yes: the path is case-sensitive, so /My-Post and /my-post are two different URLs. Lowercasing everything is what avoids serving the same page twice.
Yes, and it is a good habit. A lowercase hyphenated name has no spaces to escape and no characters any filesystem objects to.
No. The conversion runs in this page as you type.