Runs in your browser. Your files and text never leave your device - nothing is uploaded.
Generate a Clean URL Slug From Any Title
The Tools Kit’s free Slug Generator turns a blog post title, product name, or any phrase into a URL-friendly slug as you type. It removes accents, lowercases the text, and replaces spaces and punctuation with a single hyphen or underscore, so you get a tidy permalink segment you can paste straight into WordPress, a static site generator, or your app’s router.
Everything happens in your browser: there is no Generate button to press, no upload, and no account. It is one of several text and format utilities in our conversion tools collection.
How to Use the Slug Generator
- 1
Type or paste your text
Enter a blog post title, product name, or any phrase into the Text field. The slug appears below it as you type.
- 2
Choose a separator
Keep Hyphen (-) for web URLs, or switch to Underscore (_) for file names, database keys, and code identifiers.
- 3
Set the Lowercase option
Leave Lowercase ticked for an all-lowercase slug, or untick it to capitalize the first letter of each word segment.
- 4
Copy the slug
Click Copy to put the finished slug on your clipboard, ready to paste into your CMS, router, or file name.
How Text Is Converted to a Slug
The tool applies the same fixed sequence of steps to whatever you type, so the same title always produces the same slug:
- Remove accents. Unicode NFKD normalization splits letters such as é or ñ into a base letter plus an accent mark, and the accent is discarded.
- Lowercase and trim. The text is lowercased and spaces at either end are dropped.
- Replace everything else. Any run of characters that are not a-z or 0-9, whether spaces, punctuation, symbols, or emoji, becomes one separator.
- Tidy the edges. Separators at the start or end are removed and any doubled separators are collapsed, so you never get
--or a trailing hyphen.
| Input text | Slug (hyphen, lowercase) |
|---|---|
| My Blog Post: Café Tips! | my-blog-post-cafe-tips |
| 10 Tips & Tricks for 2026 | 10-tips-tricks-for-2026 |
| naïve résumé — part 2 | naive-resume-part-2 |
| 50% Off Sale | 50-off-sale |
| Crème Brûlée Recipe 😋 | creme-brulee-recipe |
| Don't Panic | don-t-panic |
Notice the last row: an apostrophe counts as a word break, so remove it from the text first if you prefer dont-panic. Symbols like & and % are dropped rather than spelled out, and letters with no plain-letter form (ß, æ, ø, ł) and non-Latin scripts are removed too, so a title written entirely in Cyrillic or Chinese produces no slug. If you need to keep those characters in a link, the URL encoder shows how they are percent-encoded, and the URL decoder turns an encoded link back into readable text.
Hyphens vs. Underscores in URL Slugs
For web addresses, use hyphens. Google’s URL structure guidance recommends hyphens to separate words, because search engines and readers reliably treat a hyphen as a space, while underscores can make words run together. Hyphens also stay visible when a link is underlined, where an underscore disappears into the underline.
Underscores still have their place. Choose Underscore (_) when you are naming files, database columns, environment keys, or Python variables, where snake_case is the convention. If you need other naming styles such as camelCase or CONSTANT_CASE, the case converter handles those directly.
The Lowercase checkbox controls capitalization. Ticked (the default), you get my-blog-post. Unticked, the first letter at the start and after each separator is capitalized, giving My-Blog-Post. This rebuilds capitals rather than keeping yours, so “iPhone 15” becomes Iphone-15. Lowercase slugs are the safer choice for URLs, because many servers treat paths case-sensitively and /My-Post and /my-post can end up as two different addresses.
What Makes a Good SEO-Friendly Slug
- Describe the page. Use the words a reader would search for, such as
cold-brew-coffee-guide, rather than an ID likepost-4812. - Keep it short. Three to five meaningful words is usually enough. The tool keeps every word you type, so cut filler such as “the”, “a”, and “complete” from the text before copying. A word counter or character counter helps when you are working to a length target for titles and slugs.
- Avoid dates you will outgrow. A year in the slug, like
best-laptops-2026, forces a URL change or a stale-looking link next year. - Settle it before publishing. Changing a live slug breaks existing links unless you add a 301 redirect from the old URL.
- Validate in code. If your app accepts user-entered slugs, the pattern
^[a-z0-9]+(?:-[a-z0-9]+)*$matches exactly the hyphen, lowercase format this tool produces; try it in the regex tester.
Common uses
- Creating the permalink for a blog post, news article, or documentation page
- Building product and category URLs for an online store
- Turning a document or image title into a safe file name with underscores
- Generating readable IDs and route parameters for an app or API
- Cleaning up page titles before adding them to a CMS or a sitemap, alongside the HTML entity encoder when a title with & or quotes also goes into HTML markup
Slug terms explained
| Term | What it means here |
|---|---|
| Slug | The human-readable part of a URL that identifies one page, such as "how-to-make-cold-brew" in /blog/how-to-make-cold-brew |
| Slugify | To convert a title or phrase into a slug: lowercase, accents removed, and spaces and punctuation replaced by a separator |
| Separator | The character placed between words in the slug; this tool offers a hyphen (-) or an underscore (_) |
| Kebab case | Words joined by hyphens, like my-blog-post; the usual format for URL slugs |
| Snake case | Words joined by underscores, like my_blog_post; common in file names, database columns, and Python code |
| Unicode normalization (NFKD) | A standard way of splitting an accented letter into its base letter plus a separate accent mark, so the accent can be removed |
| Permalink | The permanent URL of a post or page; the slug is usually its last segment |
Frequently Asked Questions
A slug is the readable part of a web address that identifies a specific page, usually the last segment of the URL. In example.com/blog/cold-brew-coffee-guide, the slug is cold-brew-coffee-guide. Good slugs are short, lowercase, and describe the page content in a few words.
Type or paste the title into the Text field and the slug is generated instantly. Accents are removed, letters are lowercased, and every space or run of punctuation becomes a single hyphen. For example, "My Blog Post: Café Tips!" becomes my-blog-post-cafe-tips.
Use hyphens for URLs. Google’s URL guidance recommends hyphens to separate words, because an underscore can cause words to be read as one joined term. Underscores are still a sensible choice for file names, database keys, and variable names, which is why the tool offers both.
Letters such as é, ñ, ü, and ç are split into a base letter plus an accent using Unicode NFKD normalization, and the accent is dropped, so "Crème Brûlée" becomes creme-brulee. Letters that have no accent-free decomposition, such as ß, æ, ø, and ł, are removed rather than transliterated, so check slugs that contain them.
No. Only the plain letters a-z and digits 0-9 survive in the slug, so text written entirely in another script produces no slug at all, and emoji are removed. For non-Latin URLs, transliterate the title into Latin letters first, or keep the original characters and percent-encode them.
Every character that is not a letter or digit is treated as a word break. A run of them in a row, such as a colon followed by a space, becomes a single separator, and separators at the start or end are trimmed. An apostrophe also counts as a break, so "Don’t Panic" becomes don-t-panic; delete the apostrophe first if you want dont-panic.
The slug is cleaned exactly the same way, then the first letter at the start and after each separator is capitalized, giving My-Blog-Post instead of my-blog-post. It does not preserve your original capitalization: "iPhone 15" becomes Iphone-15.
No. Every word in your text is kept, except symbols such as & that are dropped. If you want a shorter slug, delete filler words from the text before copying, for example turning "The Complete Guide to Cold Brew" into "Cold Brew Guide".
There is no fixed limit, but short slugs of roughly three to five meaningful words are easier to read, share, and remember. This tool does not shorten or truncate the slug, so trim the input text if the result is longer than you want.
No. The slug is generated by JavaScript running in your browser on every keystroke, so unpublished titles and product names never leave your device. There is no signup and no usage limit.
You can, but the old URL will stop working unless you add a 301 redirect from it to the new one. Changing slugs on established pages can also break links shared elsewhere, so it is best to settle on a good slug before you publish.
Reviewed by Raja Jahangir · Last reviewed: October 7, 2026
How do you turn a title into a URL slug?
To generate a slug, type the title and the URL-friendly version appears instantly: accents are removed, everything is lowercased, and runs of spaces or punctuation become a single hyphen or underscore. For example, 'My Blog Post: Café Tips!' becomes my-blog-post-cafe-tips. Untick Lowercase to capitalize the first letter of each word segment, such as My-Blog-Post-Cafe-Tips.
Should URL slugs use hyphens or underscores?
Use hyphens. Google treats a hyphen as a word separator, so blue-widgets is read as two words, while blue_widgets is read as one joined term. Hyphens are also easier to see in underlined links. Underscores remain useful for file names and code identifiers, which is why both separators are offered.
