Conversion Tools

Slug Generator

This free Slug Generator turns any title or phrase into a clean, URL-friendly slug as you type. It strips accents, lowercases the text, and replaces spaces and punctuation with a single hyphen or underscore, all inside your browser.

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. 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. 2

    Choose a separator

    Keep Hyphen (-) for web URLs, or switch to Underscore (_) for file names, database keys, and code identifiers.

  3. 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. 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:

  1. Remove accents. Unicode NFKD normalization splits letters such as é or ñ into a base letter plus an accent mark, and the accent is discarded.
  2. Lowercase and trim. The text is lowercased and spaces at either end are dropped.
  3. Replace everything else. Any run of characters that are not a-z or 0-9, whether spaces, punctuation, symbols, or emoji, becomes one separator.
  4. 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 textSlug (hyphen, lowercase)
My Blog Post: Café Tips!my-blog-post-cafe-tips
10 Tips & Tricks for 202610-tips-tricks-for-2026
naïve résumé — part 2naive-resume-part-2
50% Off Sale50-off-sale
Crème Brûlée Recipe 😋creme-brulee-recipe
Don't Panicdon-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 like post-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

TermWhat it means here
SlugThe human-readable part of a URL that identifies one page, such as "how-to-make-cold-brew" in /blog/how-to-make-cold-brew
SlugifyTo convert a title or phrase into a slug: lowercase, accents removed, and spaces and punctuation replaced by a separator
SeparatorThe character placed between words in the slug; this tool offers a hyphen (-) or an underscore (_)
Kebab caseWords joined by hyphens, like my-blog-post; the usual format for URL slugs
Snake caseWords 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
PermalinkThe permanent URL of a post or page; the slug is usually its last segment

Frequently Asked Questions

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.

Sources and standards