PlayTools

Slug Generator

Turn any title into a clean, URL-safe slug: lowercased, accent-stripped, punctuation removed, words joined with a hyphen or underscore. One title per line.

Runs in your browser — nothing you enter is uploaded

10 Best Ways to Optimize Your Website in 2026!

10-best-ways-to-optimize-your-website-in-2026

A slug is the human-readable part of a URL. This tool lowercases the text, strips accents (café → cafe), removes punctuation, and joins words with your chosen separator. Google treats hyphens as word separators and underscores as joiners, so hyphens are the safe default. Keep slugs short and descriptive; once a page is indexed, changing its slug means setting up a 301 redirect. Everything runs in your browser.

Advertisement

What makes a good URL slug

The slug is the last, human-readable segment of a URL — the part that names the page. "/guides/how-to-choose-a-mattress" tells a reader and a search engine what the page covers before it loads. A vague slug like "/guides/post-4821" wastes that signal. This tool converts a title into a clean slug and can process a whole list at once.

The transformation is deliberate: Unicode is normalised and combining accents are removed so "résumé" becomes "resume"; the text is lowercased; apostrophes are deleted so "don’t" becomes "dont" rather than "don-t"; every other non-alphanumeric run collapses to a single separator; and leading and trailing separators are trimmed. The result is ASCII-safe and needs no percent-encoding in the address bar.

Use hyphens, not underscores. Google documents that it treats a hyphen as a word boundary and an underscore as a word joiner, so "blue_widgets" may be read as the single token "bluewidgets" while "blue-widgets" is two words. Every major CMS and style guide has settled on hyphens for this reason.

Keep slugs short and stable. Three to five meaningful words read well in search results and when the link is shared. Dropping stop words (a, the, of, to) tightens them further, but only when the slug still makes sense without them. Once a URL is published and indexed, changing the slug requires a 301 redirect from the old path — otherwise every existing link and search listing breaks.

All processing happens in your browser. Nothing you type is uploaded, and the tool works offline once loaded.

Key formulas (reference)

slug = title
  .normalize("NFKD").replace(/[\u0300-\u036f]/g, "")   // strip accents
  .toLowerCase()
  .replace(/[^a-z0-9]+/g, "-")                          // non-alphanumeric → separator
  .replace(/^-+|-+$/g, "")                              // trim separators

These free tools pair well with this page — open them in a new tab to finish your workflow.

Advertisement

Frequently Asked Questions

What is a URL slug?

The slug is the readable, keyword-bearing part of a URL that identifies a specific page — in "/blog/how-to-bake-bread", the slug is "how-to-bake-bread". A clear slug helps both readers and search engines understand what the page is about before they open it.

Should I use hyphens or underscores?

Hyphens. Google explicitly treats a hyphen as a word separator and an underscore as a word joiner, so "red_shoes" can be read as one token "redshoes" while "red-shoes" is two words. Hyphens are the long-standing web convention for slugs.

How are accented characters handled?

They are transliterated to their base Latin letter: "café" becomes "cafe", "Zürich" becomes "zurich". This keeps slugs ASCII-safe and avoids percent-encoding, which turns "é" into "%C3%A9" in the address bar.

What do the stop words option do?

It drops short function words (a, an, the, of, to, and, …) so "the-best-way-to-learn-french" becomes "best-way-learn-french". Shorter slugs are tidier, but only remove stop words when the slug still reads clearly — never at the cost of meaning.

Is there an ideal slug length?

There is no hard limit, but shorter is better for readability and for how the URL displays in search results and when shared. Three to five meaningful words is a good target. The optional length cap trims anything longer at a word boundary.

Can I change a slug after publishing?

You can, but the old URL will 404 unless you add a 301 redirect from the old slug to the new one. Every inbound link, bookmark and search-engine record points at the old address, so always redirect rather than just changing it.

Does it process multiple titles at once?

Yes. Put one title per line and you get one slug per line, each with its own copy button — handy for generating slugs for a batch of blog posts or product names.