Toolstia / Slug generator
Make a clean URL slug
A slug is the readable last part of a web address, the words after the final slash. Search engines, social previews and people reading a link all use it, so a slug that is short, plain and consistent is worth a few seconds of care. This generator takes a title or any sentence and turns it into one you can paste straight into a CMS, a static site generator or a file name.
It does the fiddly parts for you: it strips accents, replaces an ampersand with the word and, drops apostrophes, turns every other run of symbols and spaces into a single separator, and can trim the result to a maximum length without cutting a word in half. You can choose a hyphen or an underscore, keep capitals, and optionally keep letters from other scripts such as Bangla or Arabic.
The slug is built as you type and shows its character count, so you can see whether it will fit before you copy it.
How it works
- Paste your title or text.
- Choose the separator, length limit and options.
- Copy the slug.
What a good slug looks like
Short, readable and made of plain words, for example how-to-merge-pdf-files. Hyphens are the usual separator for web addresses, and lower case avoids two versions of the same page.
Accents and symbols
Letters with accents are turned into plain letters, so cafe from café. An ampersand becomes "and", apostrophes are dropped, and other symbols become separators.
Other languages
By default only English letters and numbers are kept. Switch on the option to keep letters from other languages, such as Bangla or Arabic, if your site supports non-English web addresses.
Length and small words
A length limit cuts at a word boundary where it can. Removing small words like "the" and "of" gives shorter slugs, but check that the result still makes sense.
From title to slug, step by step
Take the title: 10 Best Café Tips & Tricks: Where's the Rain? The tool first removes the accent from é, replaces the ampersand with the word and, and deletes the apostrophe in Where's. Everything that is not a letter or number then becomes a separator, and the lower-case words are joined with hyphens. The result is 10-best-cafe-tips-and-tricks-wheres-the-rain, which is 44 characters.
Turn on the option to remove small English words and the same title becomes 10-best-cafe-tips-tricks-wheres-rain, 36 characters. Both the and and went away, while the content words stayed. The list of removed words is short and fixed: a, an, and, are, as, at, be, but, by, for, from, in, into, is, it, of, on, or, the, to and with.
Shortening a slug without breaking words
With a maximum length, the tool cuts the slug at that many characters and then backs up to the last separator, provided that separator lies past the halfway point. For How to Merge PDF Files Without Uploading Them, a limit of 30 gives how-to-merge-pdf-files, 22 characters. The first 30 characters happen to end exactly on the whole word without, but the tool still drops the last word of the cut text, so expect the result to be somewhat shorter than the limit.
If there is no separator in the second half of the cut text, the slug is simply cut at the limit, so a single very long word can end mid-word. Any separator left at the end is removed. Look at the preview before you copy.
Hyphen, underscore and capital letters
The default is lower case with hyphens, which is the most common convention for page addresses. Underscores work, and the same title with an underscore and capitals kept gives How_to_Merge_PDF_Files for a limit of 30, but web addresses are case sensitive on many servers, so mixed capitals risk creating two addresses for one page.
Underscores are better suited to file names, database keys and some code identifiers than to public page addresses. Choose one style per site and stay with it, since a consistent pattern is easier to maintain than a clever one.
Non-English titles and special letters
By default only the letters A to Z and the digits 0 to 9 survive. With Keep letters from other languages switched on, the title ঢাকা শহর guide 2026 becomes ঢাকা-শহর-guide-2026 instead of just guide-2026. Many sites and browsers handle such addresses, but they are percent-encoded when copied into some tools, so check that your platform and your sharing channels display them well.
Accent removal works by splitting a letter into its base and its accent mark and dropping the mark. Letters that are not built that way, such as the German sharp s, the Danish and Norwegian o with a stroke, and the ligature ae, are not converted and are treated as symbols. Straße becomes stra-e. Edit those by hand, for example to strasse. If you switch on Keep letters from other languages, those letters are kept as they are (straße), which is only suitable if your site supports such addresses.
What the generator will not decide for you
It does not check whether the slug is already used on your site, and it does not shorten a title to its keywords. If every word in the input is a small word, the tool keeps the original words rather than returning an empty slug.
For a blog, aim for the few words that name the page, not the whole headline. Dates, category names and numbers that will go out of date are better left out, since changing a published address needs a redirect.
Questions
Should I use hyphens or underscores?
Hyphens. Search engines treat hyphens as word separators in web addresses, while underscores are often treated as part of a word.
Does it work with Bangla text?
Turn on "Keep letters from other languages". Without it, Bangla letters are removed because they are not English letters or numbers.
Should I change a slug after a page is published?
Avoid it. Changing the address breaks existing links unless you set up a redirect.
Why did my slug lose a letter such as the German sharp s?
Only letters that can be split into a base letter plus an accent are converted. A few letters, such as the German sharp s and the Scandinavian o with a stroke, are not, so they are treated as separators. Edit the slug by hand or type the letters as you want them to appear.
How long should a slug be?
There is no fixed rule. Short, descriptive slugs of three to six words are easy to read and share. The maximum length option exists for systems that limit address length, not because search engines need short ones.
Does a number at the start matter?
Numbers are kept as they are, so a title that starts with 10 gives a slug that starts with 10. That is fine, but if the number will change in future, such as a list that grows, consider leaving it out.
Will it remove words like the and of if I leave the option off?
No. Without the small-words option every word stays, so The Art of War becomes the-art-of-war.
Can I generate slugs for many titles at once?
Not in one step. The tool processes the text you paste as one slug, so line breaks inside it become separators. Paste one title at a time.