URL slug generator
Turn any text into a clean, URL-safe slug with customisable separators, case, and length. Diacritics transliterate automatically (é→e, ñ→n). Everything runs in your browser.
What is a URL slug generator?
A URL slug is the human-readable part of a URL that identifies a page — typically derived from the page title and stripped of accents, punctuation, and case quirks. Good slugs are short, descriptive, lowercase by convention, and use hyphens between words. This generator handles the boring parts: collapsing whitespace, transliterating accents, normalising case, and clipping at a sensible length.
What makes a good URL slug?
Keep slugs under ~60 characters, drop "stop words" (a, the, of), and lead with the highest-signal keyword. Avoid IDs, dates, and session tokens — they bloat the URL without adding meaning. Stable slugs help SEO; if a slug must change, set a 301 redirect from the old URL.
Hyphens vs underscores
Google treats hyphens as word separators in URLs but underscores as word joiners. Use hyphens for SEO unless you have a specific reason (technical names, code identifiers, system filenames). Dots are valid but uncommon — they can confuse routers that interpret them as file extensions.
For full URL encoding, see our URL encoder / decoder.
Common Uses
- Blog and CMS routes: Generate clean URLs from post titles automatically — modern stacks like WordPress, Ghost, and Astro Content all expect a slug field.
- E-commerce product URLs: Convert product names with brand symbols, sizes, and trademarks into clean handles for Shopify, BigCommerce, or custom catalogs.
- Documentation anchors: Generate stable section IDs from headings so deep links survive content edits without breaking.
- File and folder names: Convert messy user-supplied filenames into safe, cross-platform identifiers for upload buckets and shared drives.
- Slack/Discord channel names: Generate channel slugs from project or team names that fit platform restrictions (lowercase, hyphens, length limit).
- Database lookup keys: Create deterministic, case-insensitive identifiers for caching, rate limiting, and key-based lookups.
- Git branch names: Convert ticket titles or feature descriptions into clean branch names that pass branch-naming rules.
FAQ
What is a URL slug?
A slug is the human-readable, lowercase, hyphen-separated tail of a URL. In example.com/blog/how-to-make-coffee, "how-to-make-coffee" is the slug. It identifies the page and helps both users and search engines understand the content at a glance.
Hyphens vs underscores — which should I use?
Hyphens. Google explicitly treats hyphens as word separators but underscores as word joiners — so "modern-cars" is two words to Google, while "modern_cars" is one. Use hyphens for SEO unless you have a specific technical reason.
How do I handle non-English characters?
Turn on "Transliterate non-ASCII" to convert é → e, ñ → n, ø → o, etc. For non-Latin scripts (Cyrillic, Greek, Arabic), the tool currently strips them — they have no obvious Latin mapping and most CMSs prefer ASCII-only slugs anyway.
What's a sensible max slug length?
60–80 characters is a good default. Most search engines truncate URLs displayed in results around 70 characters, so anything longer is wasted real estate. WordPress defaults to 200, but that's a hard cap, not a recommendation.
Does this tool send my data anywhere?
No. The slug is generated entirely in your browser. Your text never touches a server.
By the Numbers
- RFC 3986 reserves only four unreserved characters for slugs beyond letters and digits: hyphen
-, period., underscore_, and tilde~ - Google recommends keeping URLs under 2,048 characters total — most search results use slugs in the 30–60 char range
- WordPress caps slugs at 200 characters by default; Shopify caps product handles at 255 characters
- A 2023 Backlinko study of 11.8M Google results found short URLs (~50 chars) ranked 2.5× higher on average than URLs over 100 characters