What Is a URL Slug? Why Lowercase, Hyphenated, and Good for SEO
Published 7/2/2025 · 3 min read · Developer tools
Daniel Okonkwo — Front-end developer and tech writer at OneKitly
Web performance · File formats
Checked against 2 sources
A URL slug is the human-readable segment at the end of a web address that identifies a specific page, such as what-is-a-url-slug in example.com/blog/what-is-a-url-slug. Slugs are written in lowercase with words separated by hyphens because URLs are case-sensitive on many servers and hyphens are treated by search engines as word separators. A clean, descriptive slug is easier to read, share, and rank in search results than a numeric ID or a query string.
A URL slug is the readable, hyphenated part of a web address that names a page. Learn why slugs are lowercase, how they help SEO, and how to generate one from a title.
Where the slug lives in a URL
A URL has several parts: the scheme (https), the domain (example.com), the path, and optionally a query string and fragment. The slug is the final, meaningful piece of the path that names the individual resource. In example.com/blog/what-is-a-url-slug, the word blog is a path segment and what-is-a-url-slug is the slug identifying the article.
The word slug comes from newspaper publishing, where it was the short nickname given to a story while it moved through production. On the web it plays the same role: a short, stable handle for a page that stays readable even when the title later changes.
Why lowercase and hyphens
The path portion of a URL is case-sensitive on many web servers, so /About and /about can point to different pages or one of them can 404. Forcing slugs to lowercase removes that ambiguity and prevents duplicate-content problems where the same page is reachable at two casings.
Search engines recommend hyphens over underscores to separate words, because they read a hyphen as a space and an underscore as a joiner. So quick-brown-fox is indexed as three words, while quick_brown_fox may be read as one. Spaces themselves are not allowed raw in a URL; they would be percent-encoded as %20, which is ugly and hard to share, so hyphens are the clean substitute.
Generating a slug from a title
The usual recipe is: lowercase the title, replace spaces with hyphens, remove punctuation, and collapse any run of hyphens into one. So the title "What Is a URL Slug?" becomes what-is-a-url-slug. Many systems also strip small filler words and transliterate accented letters, turning café into cafe, so the slug stays within the plain ASCII characters that every browser handles identically.
Once a slug is published, treat it as permanent. If you must change it, set up a redirect from the old slug to the new one so existing links and search rankings are not lost. This is also why slugs should avoid dates or numbers that might change: a stable slug is a durable address.
Frequently asked questions
- Is the slug the same as the whole URL?
- No. The slug is just the readable segment that names the page, usually at the end of the path. The full URL also includes the scheme, domain, and any earlier path segments.
- Can a slug contain non-English or accented characters?
- Technically yes, via percent-encoding, but plain ASCII is safest for sharing and compatibility. Most systems transliterate accents, so é becomes e, keeping the slug clean.
- How long should a slug be?
- Short and descriptive is best: enough words to convey the topic, but not the entire title. Three to five meaningful words is a common target, dropping filler words like the and of.
- Does changing a slug hurt SEO?
- It can, because the old URL and its accumulated ranking stop working. If you must change it, add a permanent redirect from the old slug to the new one so links and rankings carry over.
Articles you may find interesting
All guides →Related tools
Sources
Spotted a mistake in this article?