Disclosure: Some links are affiliate links — we may earn a commission if you upgrade to a paid tool, at no cost to you. All tools on this site are free to use. See full disclosure →
Separator:
your-slug-will-appear-here

What Makes a Good URL Slug?

A URL slug is the last part of a web address — the section that describes the specific page. Getting slugs right affects SEO, usability, and link longevity. A well-crafted slug is readable, keyword-rich, short, and permanent.

The Rules of a Good Slug

  • Lowercase only. URLs are case-sensitive on most web servers. Using uppercase creates duplicate content risk and confusion. Stick to lowercase always.
  • Hyphens as separators. Google treats hyphens as word boundaries and underscores as joiners. how-to-write = three words. how_to_write = one word. Use hyphens for SEO.
  • No special characters. Characters like &, %, #, ?, = have special meaning in URLs and must be percent-encoded, making links ugly and fragile. Strip them entirely.
  • No stop words. Remove filler words like "a," "an," "the," "and," "but" unless they're essential to meaning. "the-best-seo-tools" → "best-seo-tools."
  • Short and descriptive. 3–5 words is ideal. The slug should communicate the topic without reading the page.
  • Permanent. Once a URL is indexed and linked, changing it loses SEO value unless you redirect. Plan your slugs before publishing.

Slug Examples: Good vs Bad

Original Title Bad Slug Good Slug
10 Best SEO Tools in 2026 10-Best-SEO-Tools-in-2026 best-seo-tools-2026
How to Write Better Blog Posts How_to_Write_Better_Blog_Posts how-to-write-better-blog-posts
Café Review: Amélie's in Paris Caf%C3%A9-Review-Am%C3%A9lie's-in-Paris cafe-review-amelies-paris
What is a 401(k)? A Beginner's Guide what-is-a-401(k)?-a-beginners-guide what-is-a-401k-beginners-guide

Slugs and SEO: What Actually Matters

Keywords in Slugs

Search engines read URLs as ranking signals. If your target keyword is "home affordability calculator," having that phrase in your slug (/home-affordability-calculator) reinforces the topic relevance. It won't make or break rankings on its own, but it's a confirmed signal.

Keep the slug focused on one or two primary keywords. Don't stuff it with every keyword variant — that dilutes the signal and looks spammy in SERPs.

Slug Length

Google has no stated maximum URL length, but there's a practical limit: long URLs get truncated in search results. URLs over 60–70 characters typically get cut off in the SERP snippet. Keep slugs short enough that the full URL fits in one line — roughly 50–75 characters for the entire URL including the domain.

Stop Word Removal

Words like "a," "an," "the," "in," "on," "and," "or," "but," "of" rarely add search value to a slug. "a-guide-to-the-best-tools-for-writing-on-a-mac" → "guide-best-writing-tools-mac." Same meaning, shorter URL, clearer keyword signal.

Subfolders vs Flat Structure

A common question: should slugs include the category (/blog/how-to-write) or be flat (/how-to-write)? Both can rank. Subfolder structure helps with site architecture and internal linking context. Flat slugs are slightly shorter. The most important thing is consistency — don't mix both styles on the same site.

Technical Slug Rules for Developers

If you're generating slugs programmatically (in a CMS, URL router, or content pipeline), here's what the algorithm should do:

  1. Normalize Unicode (NFD decomposition)
  2. Remove combining diacritical marks (U+0300–U+036F)
  3. Convert to lowercase
  4. Replace whitespace, underscores, and existing hyphens with the separator character
  5. Remove all remaining non-alphanumeric characters except the separator
  6. Replace consecutive separators with a single separator
  7. Trim leading and trailing separators

This tool follows exactly that algorithm. The output is safe for use in Apache, Nginx, and all major cloud hosting providers without URL encoding.

FAQ

Frequently Asked Questions

What is a URL slug?

A URL slug is the part of a web address that identifies a specific page in a human-readable way. For example, in the URL 'example.com/blog/how-to-write-better-headlines', the slug is 'how-to-write-better-headlines'. Slugs use lowercase letters, numbers, and hyphens — no spaces, special characters, or uppercase letters. They serve both SEO and usability: search engines read them as keywords, and users can tell what a page is about before clicking.

Should I use hyphens or underscores in slugs?

Use hyphens. Google's John Mueller has confirmed that Google treats hyphens as word separators in URLs, while underscores are treated as connectors — meaning 'how_to_write' is read as one word 'howtow rite', not three words. This makes hyphens significantly better for SEO. The only exception is if you're in a system that requires underscores (like some Python frameworks for route matching), but even then, consider your SEO implications.

Does this tool handle accented characters and Unicode?

Yes. Characters like é, ü, ñ, ç, ø are normalized to their ASCII equivalents (e, u, n, c, o) before generating the slug. This ensures the slug works on all web servers and browsers without URL encoding. For example, 'Château de Versailles' becomes 'chateau-de-versailles'. Characters with no ASCII equivalent are stripped.

How long should a URL slug be?

Shorter slugs are generally better. Aim for 3–5 words that capture the main keywords of the page. 'how-to-write-seo-titles' is better than 'how-to-write-seo-friendly-page-titles-that-rank-on-google'. Long slugs dilute keyword relevance and look unwieldy in search results. Most SEO guides recommend keeping slugs under 60 characters. Remove stop words (a, an, the, and, but, or, in, on) if they don't add meaning.

Can I change a slug after publishing without hurting SEO?

Yes, but you must set up a 301 redirect from the old URL to the new one. Without a redirect, the old URL becomes a 404 error and you lose any backlinks and ranking signals built up for that URL. With a proper 301 redirect, most of the SEO value transfers to the new URL. Most CMS platforms (WordPress, Webflow, etc.) have redirect management tools. Set the redirect before publishing the new URL to avoid any indexing gap.

More Free SEO & Writing Tools

Keyword Density Checker Case Converter Readability Score

For AI-powered content research and SEO, see our guide to the best AI writing tools in 2026.

The TextTools Team
Infinfy Editorial
We're a team of writers and editors who built the tools we wished existed. Free, fast, and honest — no upsells, no accounts, no nonsense. Part of Infinfy Solutions.