URL Slug Generator
Turn a page title into a URL slug that search engines like. Accented characters are transliterated, punctuation is removed, the separator and the maximum length are configurable, and the result never ends with a dangling separator.
Title or text
Slug
Ready — paste some input or load the sample.
100% Client-Side · Privacy First. This tool runs entirely inside your browser. Nothing you type is uploaded, logged or sent to a server — you can even use it offline.
Overview
A URL slug is the part of an address that identifies one specific page, and it is worth treating as a permanent decision rather than a formatting detail. Two rules decide whether a slug works: it should be readable, and it should never change. Readable because a bare slug in a search result tells the reader what they will find; permanent because every link that ever pointed at the old address has to keep working. This generator turns a title into a slug by normalising the text, dropping the accents, transliterating the characters that have no ASCII form, and joining the remaining words with a separator. Two details are handled carefully: an ampersand becomes the word and rather than disappearing, and the separator is never used to build a regular expression, so a separator such as d or a bracket cannot break the conversion. You can choose the separator, keep or drop the capital letters, and cut the result at a maximum length without leaving a trailing separator behind.
How to use the url slug generator
- 1Paste the page title or the sentence you want to turn into a slug.
- 2Choose a separator: a hyphen for URLs, an underscore for file names.
- 3Set a maximum length if the slug has to fit into a fixed path.
- 4Copy the result and keep it stable once the page is published.
- 5Read the notes for the length of the slug and a couple of example paths.
- 6Keep the slug stable after publication, because a changed slug needs a permanent redirect to keep the old links alive.
Cheat sheet
The syntax you will use most, and what each part does.
| Pattern | What it means |
|---|---|
Hello World |
Becomes hello-world with the default lowercase and hyphen settings. |
Café & Crème |
Becomes cafe-and-creme: the accents are dropped and the ampersand becomes the word and. |
Straße |
Becomes strasse, using the German spelling rule rather than dropping the letter. |
Ærø / Åland |
The characters without an ASCII form are transliterated rather than discarded. |
A very long sentence here |
The maximum length cuts the slug and removes the separator that would be left dangling at the end. |
Post 1 — 2026 |
Punctuation becomes a separator, so consecutive separators collapse into one. |
Common mistakes
The slug changes and old links break.
Treat the slug as permanent. If you must change it, leave a redirect from the old address to the new one.
Accents turn into random characters.
The text is normalised first, so é becomes e and ü becomes u rather than becoming an escape sequence.
The slug ends with a separator.
The cut at the maximum length removes the trailing separator, so the address does not end with a dangling hyphen.
The same title produces two pages.
A slug has to be unique. Add a distinguishing word rather than a number, because a numbered suffix is hard to remove later.
Worked examples
A blog title
How to Convert YAML to JSON
A lowercase hyphenated slug with no trailing separator.
A title with punctuation
Docker Run vs. Docker Compose: What's the Difference?
A slug where the punctuation became separators and the apostrophe was removed cleanly.
Frequently asked questions
Should slugs be lowercase?
Yes. Lower case avoids the duplicate content problem where the same page exists under two capitalisations, and it makes the URL easier to read and to type.
How long should a slug be?
Three to five words is usually enough. Anything longer tends to repeat the title, and search engines weigh the words in the path only a little.
Should I include the date in the slug?
Only for a page that is genuinely dated, such as a release note. A date in every URL makes the archive feel disposable and creates a redirect chain every time you refresh it.
Does it handle non-Latin scripts?
It transliterates the Latin accents and drops anything that is not a Latin letter or a digit, so a title in Greek or Chinese becomes empty. Keep the original text in the title tag and let the slug carry an identifier.
What happens to an ampersand?
It becomes the word and, so "Tools & Tips" becomes "tools-and-tips". That reads better than a bare plus sign and avoids having to escape it in a URL.
Why does the result sometimes lose the last word?
A maximum length cuts the slug at the requested number of characters, and a partial word is dropped rather than left half finished. Set a slightly larger limit or shorten the title instead.
Should I change the slug after publishing?
Only with a permanent redirect from the old address. Changing a slug without a redirect sends every existing link, bookmark and ranking to a dead end.
Is a hyphen or an underscore better?
Use a hyphen in a URL, because a percent-encoded underscore is a common source of broken links in email clients and analytics tools. Use an underscore only for file names.
Should the slug match the page title exactly?
It does not have to. A shortened slug that keeps the important words is often better than a title that was trimmed to fit a character limit.
Are numbers in a slug bad for search engines?
On their own, no. A number in the middle of a slug is harmless, while a date such as 2026-01-31 adds nothing and makes the page look dated.
Why were my non-Latin characters removed?
Only Latin letters and digits survive, because a URL has to be portable between systems. Keep the original script in the title tag and the page heading.