Text to slug generator
Turn titles into clean, URL-friendly slugs — lowercase, accent-stripped, hyphen-separated.
What a slug is, and why it matters
A slug is the human-readable part of a URL after the domain — the /text-to-slug-generator in this page's address. Good slugs do real work: they tell both people and search engines what a page is about before they even open it, they look clean when shared, and they're stable links that don't break. This tool lowercases your text, strips accents and punctuation, collapses spaces, and joins the words with the separator you choose.
The rules of a good slug
A few conventions make slugs work well. Keep them lowercase (URLs are case-sensitive on many servers, so mixed case invites broken links), use hyphens rather than underscores between words — search engines treat hyphens as word separators but underscores as joiners — and keep them short and descriptive, trimming filler words like "the" and "a". A slug of three to five meaningful words usually reads best.
Where you'll use them
Slugs show up everywhere you publish: blog post URLs, documentation pages, product links, and the anchor IDs that jump to a heading on a page. Generating them consistently keeps a whole site's URLs tidy and predictable, which matters more than it seems once you have hundreds of pages. For broader text work — changing case, sorting, find-and-replace — the text transformer includes slugify alongside its other transforms.
What the tool actually does to your text
The transformation runs in a fixed order, and each step exists for a reason:
- Lowercase. Paths are case-sensitive on most Unix servers, so
/Aboutand/aboutcan be two different URLs — and two URLs with the same content is a duplicate-content problem. - Strip accents. Characters are decomposed and the diacritical marks removed, so
cafébecomescafeandMüllerbecomesmuller. - Remove punctuation. Apostrophes are dropped rather than replaced, so
don'tbecomesdontand notdon-t. - Collapse and join. Runs of spaces and separators fold into a single separator, and leading or trailing ones are trimmed so you never get
-my-post-.
Keeping slugs stable
A slug is part of a URL, and URLs are a promise. Once a page is published, links point at it, search engines index it and people bookmark it. Changing the slug breaks all of that at once.
So if you must change one, serve a 301 redirect from the old path to the new one; that passes the accumulated ranking signals across and keeps existing links working. The practical corollary is to avoid putting volatile things in slugs in the first place — a year, a version number or a price will all age badly, and /pricing outlives /pricing-2026.
Length, stop words and non-Latin text
Shorter slugs are generally better: they are easier to read, survive being pasted into messages without wrapping, and keep the meaningful words visible in a search result. Three to five significant words is a good target. Trimming filler like "a", "the" and "of" usually helps readability, though there is no need to strip them so aggressively that the slug stops reading like English.
Non-Latin scripts are a genuine trade-off. Modern browsers display internationalised URLs correctly, but they are transmitted percent-encoded, so a Cyrillic or Chinese slug becomes an unreadable string when copied into a plain-text context. Transliterating to Latin characters keeps the link legible everywhere at the cost of some fidelity. If you need to inspect the encoded form, the URL encoder shows exactly what gets sent.