URL Slug Generator

Turn titles into SEO-friendly permalinks — separators, max length, optional stop words, bulk lines, and full URL preview.

Title or textOne line = one slug (bulk)
Slug output
109 chars in3 slugs43 chars first slug

How to generate a URL slug

  1. Type or paste a title. Each non-empty line is converted independently — useful for batch-generating slugs from a list of article titles or product names.
  2. Choose a separator. Hyphens are correct for all public URLs. Underscores are for file names and Python identifiers only — Google does not treat them as word separators in URLs.
  3. Set a max length. 60 characters is a safe default. The tool trims at the nearest word boundary rather than cutting mid-word — so "how-to-build-a-rest-api" becomes "how-to-build-a-rest" at 22 characters, not "how-to-build-a-rest-a".
  4. Toggle stop word removal to drop common English function words. The tool keeps at least one word even if all tokens are stop words, so you never get an empty output.
  5. Paste a base URL (for example https://yoursite.com/blog) to preview full links. Use Copy full URLs to grab the complete list for bulk operations.

7 rules for SEO-friendly URL slugs

These rules apply regardless of CMS or framework. Following all seven protects rankings, avoids duplicate content, and keeps URLs readable in search results.

1. Use lowercase only

URLs are case-sensitive on most servers. /Blog-Post and /blog-post are two different paths — a capital letter creates a duplicate-content risk and breaks links when users type the URL by hand.

2. Separate words with hyphens

Google's crawler treats a hyphen as a word separator. It does not treat an underscore that way — "digital_marketing" is parsed as a single token "digitalmarketing", so neither word ranks independently. John Mueller confirmed hyphens are the correct choice in a 2016 Webmaster Hangout.

3. Target 3–5 words, under 60 characters

Search results truncate long paths visually. Yoast's research and Backlinko's analysis of 11.8 million SERPs both converge on 3–5 meaningful words. Beyond 60 characters you lose legibility in search snippets without gaining ranking benefit.

4. Put the target keyword first

Words earlier in a URL carry slightly more weight. /seo-friendly-url-guide ranks better for "SEO friendly URL" than /guide-to-making-seo-friendly-urls. Keep the primary keyphrase at the start, then add qualifiers.

5. Strip stop words for short slugs

Articles and prepositions ("the", "a", "of", "and") add length without keyword signal. "how-to-build-a-url-slug-generator" becomes "build-url-slug-generator" — same meaning, 18 fewer characters. Toggle the option when brevity matters more than literal title match.

6. Avoid dates in evergreen content

"/best-seo-tips-2025" becomes misleading in 2027. Evergreen pages perform better with dateless slugs — you can update the content without changing the URL. Reserve date-based slugs for news articles or release notes where the date is the primary context.

7. Never change a published slug without a 301 redirect

Google indexes the original path. Every backlink and bookmark pointing at the old URL breaks the moment you rename without redirecting. A 301 redirect passes ~90–99% of link equity to the new path, but the disruption still causes a temporary ranking dip. Change slugs before indexing whenever possible.

Hyphens vs underscores vs dots

The separator choice has a measurable effect on how Googlebot tokenises your URL. Google explicitly recommends hyphens in its URL structure guidelines.

SeparatorExampleGoogle parsingBest forAvoid when
Hyphen -getting-started-guideWord separator — each word is indexed individuallyAll public-facing URLs, blog posts, product pagesNever
Underscore _getting_started_guideWord connector — treated as one token "gettingstartedguide"File names, Python package identifiers, internal APIsPublic URLs intended to rank in search
Dot .getting.started.guideWord separator (same as hyphen) but confusable with file extensionsVersion strings (v1.2.3), npm scoped packagesBlog slugs — readers expect dots to precede a file extension

When to strip stop words

Stop word removal shortens slugs by removing function words ("the", "a", "of", "and"). The right choice depends on the title — use these examples as a guide.

Original titleWith stop wordsWithout stop wordsVerdict
How to Build a REST API With Node.jshow-to-build-a-rest-api-with-node-jsbuild-rest-api-node-jsStrip — keywords preserved, 17 chars saved
The Best VS Code Extensions for Reactthe-best-vs-code-extensions-for-reactbest-vs-code-extensions-reactStrip — "best", "vs code", "react" all survive
Why We Chose Go Over Rustwhy-we-chose-go-over-rustchose-go-rustKeep — "why we" signals opinion/comparison; stripped version loses intent
Aboutabout(empty — fallback keeps full slug)Keep — single-word slugs are never stripped

5 common slug mistakes — and how to fix them

Each mistake either damages rankings, creates duplicate-content issues, or makes URLs harder for users to read and share.

1. Uppercase lettersmost common

BAD/Blog-Post-Title
GOOD/blog-post-title

Case-sensitive servers treat /Blog and /blog as different pages — duplicate content risk.

2. Underscores instead of hyphens

BAD/seo_best_practices
GOOD/seo-best-practices

Google's crawler joins underscore-separated words into one token. "seo best practices" becomes "seobestpractices".

3. Stop-word bloat on long titles

BAD/how-to-get-the-most-out-of-your-seo-strategy
GOOD/get-most-seo-strategy

47 characters trimmed to 22. Both target the same query; shorter slug wins on readability.

4. Year embedded in evergreen slug

BAD/best-javascript-frameworks-2025
GOOD/best-javascript-frameworks

The page becomes stale-looking in 2027. Remove the year; update content annually without changing the URL.

5. Keyword stuffing

BAD/seo-seo-tips-seo-guide-best-seo
GOOD/seo-tips-guide

Repeating the keyword signals spam. Google's quality guidelines explicitly warn against it in URLs.

Slug configuration by framework

This tool generates the slug string. How you wire it into your application depends on the framework. Here is the recommended approach for the four most common stacks.

FrameworkDefault URL formatRecommendedHow to configureWatch out for
WordPressPost ID: /?p=123Post name: /post-nameSettings → Permalinks → Post nameChange before launch — switching after indexing requires mass 301 redirects.
Next.jsFile path: app/blog/[slug]/page.tsxDynamic segment named [slug] or [id]Folder and file names define the route; use generateStaticParams() for SSG.Lowercase file names map directly to URL paths — no automatic case conversion.
LaravelAuto-increment IDStr::slug($title) or model slug packageAdd slug column; use route model binding with {post:slug}.Str::slug() uses hyphens by default and handles Unicode via Transliterator.
DjangoAuto-increment IDSlugField + django-autoslug or custom pre_save signalAdd slug = SlugField(unique=True) to model; slugify() in Python stdlib.slugify() strips non-ASCII by default — override with allow_unicode=True for multilingual slugs.

Related tools

Frequently asked questions

What is a URL slug?

A URL slug is the human-readable segment at the end of a URL path that identifies a specific page. In https://example.com/blog/how-to-build-a-slug-generator, the slug is "how-to-build-a-slug-generator". It is written in lowercase, with words separated by hyphens, and contains no special characters.

Should I use hyphens or underscores in a URL slug?

Always use hyphens for public-facing URLs. Google's crawler treats a hyphen as a word separator, so "digital-marketing" is indexed as two separate words. An underscore is treated as a word connector — "digital_marketing" is indexed as the single token "digitalmarketing", which means neither word ranks independently. John Mueller confirmed this in a 2016 Google Webmaster Hangout.

How long should a URL slug be?

Target 3–5 meaningful words, staying under 60 characters. Search result snippets visually truncate long paths, and multiple studies including Backlinko's analysis of 11.8 million SERPs show shorter, descriptive slugs correlate with higher rankings. This tool defaults to a 60-character limit and trims at a word boundary when possible — so "how-to-build-a-rest-api" becomes "how-to-build-a-rest" rather than "how-to-build-a-re".

Does removing stop words help SEO?

It depends on the title. For long titles — "How to Get the Most Out of Your SEO Strategy" — stripping stop words shortens the slug by 30–40% while preserving every keyword. For short or opinion-driven titles — "Why We Chose Go Over Rust" — removing words can strip meaning or intent. Toggle the option and compare; if the stripped version reads ambiguously, keep the full slug.

Can I change a URL slug after it has been published?

You can, but it carries risk. Google indexes the original path; every backlink, bookmark, and sitemap entry pointing at the old URL breaks immediately. If you must change a slug, implement a 301 (permanent) redirect from the old path to the new one. A 301 passes roughly 90–99% of link equity, but rankings typically dip for days to weeks during re-indexation. Change slugs before the page is indexed whenever possible.

Does the slug affect Google rankings?

Yes, but modestly. Google's John Mueller described words in a URL as "a very lightweight ranking factor" — clearly less important than page content, backlinks, and Core Web Vitals. The indirect effect on click-through rate (CTR) can be larger: a descriptive slug in a search result snippet signals relevance and raises CTR, which is a stronger ranking signal. A keyword-aligned slug also helps users and crawlers understand the page before clicking.

How does this tool handle accented characters like é, ü, or ñ?

The tool normalises accented Latin characters using Unicode NFD decomposition: the character is split into its base letter plus a combining diacritic mark, then the diacritic is stripped. So "café" becomes "cafe", "naïve" becomes "naive", and "jalapeño" becomes "jalapeno". Non-Latin scripts (Chinese, Arabic, Devanagari) preserve their Unicode letters and digits unchanged, since Unicode letters match the \p{L} category — your CMS routing rules determine whether these characters are allowed in paths.

When should I use underscores or dots instead of hyphens?

Underscores are conventional in Python package names and internal file naming systems where underscores are idiomatic — but not in public URLs. Dots work for version strings (v1.2.3) or technical identifiers, but confuse readers who expect a dot to precede a file extension like .html or .pdf. For all blog posts, product pages, and general web content, hyphens are the correct choice.