Slug generator
Runs entirely in your browser. Your files and data never leave your device.
51 characters
About this tool
Type a title on the left and the URL-safe version appears on the right. Accented letters lose their accents, punctuation and emoji disappear, spaces become hyphens, and the result is cut to a length you choose. A counter under the panes shows how many characters the slug ended up with.
Is my data uploaded anywhere?
No. The whole conversion runs in your browser with ordinary string operations. Nothing you type is sent anywhere, so an unpublished headline or an internal project name is as private here as it is in your own editor.
How are accented letters handled?
The default mode folds everything down to ASCII. It uses String.prototype.normalize with the NFKD form, which splits a letter like é into a plain e plus a floating accent, and then deletes the accents. So Café becomes cafe and Ñoño becomes nono.
Some letters do not decompose that way, because they are not a base letter with a mark stuck on top. The German ß is the usual one that catches people out: NFKD leaves it alone, so without special handling it would vanish from the slug. This tool maps it to ss first, along with æ to ae, œ to oe, ø to o, đ and ð to d, ł to l, and þ to th. Straße comes out as strasse.
One choice worth explaining: ö becomes o, not oe. German usage would prefer oe, but the same letter is its own vowel in Swedish and Finnish, where oe would be wrong. Since the tool cannot know the language of your text, it takes the neutral option.
If you would rather keep the original letters, switch the character setting to Unicode mode. Then accents survive and non-Latin scripts do too, so 東京の天気 stays as 東京の天気 instead of turning into an empty string. Modern browsers and search engines handle these URLs, though they look messy when copied as percent-encoded text.
What do the other settings do?
The separator can be a hyphen or an underscore. Lowercasing can be turned off if you want to keep capitals. “Collapse repeats” squashes runs of separators into one, so hello --- world gives hello-world rather than hello---world. “Trim the ends” removes separators from the start and the finish, which is what strips the leftovers from a trailing question mark.
Max length is a slider, and 0 means no limit. Truncation lands on a separator, so a word never gets chopped in half. If a single word is longer than the limit and there is no separator to cut at, it does get cut, since the alternative is an empty slug.
Where does this come up?
Naming a blog post URL, a documentation anchor, a file on disk, a CSS class, a database key, or a branch name. Anywhere a human-readable title has to become something safe to put in a path.