Copied!
Back
Text Tool

URL Slug Generator

Convert titles into clean, SEO-friendly URL slugs — lowercase, hyphenated, ASCII-transliterated. Free, no signup, runs in your browser.

Last updated: April 2026
slug-generator.tool
0 characters
Output will appear here...
https://example.com/blog/your-generated-slug

What is a URL slug and why does it matter?

A URL slug is the human-readable, URL-safe portion of a web address that identifies a specific page — typically the part after the last slash. In https://freedevtool.org/url-encoder, the slug is url-encoder. In https://example.com/blog/best-developer-tools-2026, the slug is best-developer-tools-2026.

Slugs serve three audiences simultaneously, and each cares about something different:

  • Search engines — Google's John Mueller has confirmed that keyword-rich, descriptive slugs are a (small but real) ranking factor. They also influence which keywords get bolded in SERP snippets.
  • Users — when a URL appears in search results, social media previews, or email links, a readable slug builds trust and predicts the page content. /best-react-hooks is more clickable than /post-12847.
  • Developers & content editors — slugs in URLs are easier to recognize and manage than database IDs. Manual editing, log inspection, and analytics all benefit from human-readable URLs.

Modern CMS platforms (WordPress, Ghost, Strapi, Contentful, Notion) auto-generate slugs from page titles using slug generation algorithms. When you publish a post titled "10 Best React Hooks for 2026," the CMS produces /10-best-react-hooks-for-2026 automatically. This tool exposes that algorithm so you can preview, customize, and validate slugs before publishing.

How a slug generator actually works

Behind the scenes, a slug generator runs a six-step pipeline on the input text:

  • 1. Normalize Unicode. Decompose accented characters (NFD form) so é becomes e + combining-acute-accent — easier to strip in step 3.
  • 2. Transliterate non-ASCII. Replace each character with an ASCII equivalent. cafécafe, ПриветPrivet, 北京bei jing. Uses lookup tables built from ICU/Unicode data.
  • 3. Lowercase. Convert all letters to lowercase. URLs are technically case-sensitive in the path, but lowercase is the SEO and consistency standard.
  • 4. Strip non-alphanumeric. Replace anything that isn't a letter, digit, or hyphen with a separator. Punctuation, emoji, control chars all go.
  • 5. Collapse separators. Multiple consecutive hyphens become one (foo---barfoo-bar). Strip leading and trailing hyphens.
  • 6. Truncate (optional). Cut to max length, then trim back to the previous word boundary so you don't end mid-word.

Slugify with transliteration — Cyrillic, Greek, and CJK

The transliteration step is what makes a multilingual slug generator possible. Modern libraries ship with lookup tables for the major non-Latin scripts: Cyrillic (Привет мирprivet-mir) uses BGN/PCGN romanization, Greek (Γειά σαςgeia-sas) follows ISO 843, and CJK Chinese characters use Pinyin (北京bei-jing), Japanese uses Hepburn romaji, and Korean uses Revised Romanization. If you publish content in multiple languages, picking a Cyrillic-aware URL slug generator (or one that handles CJK and Greek correctly) is the difference between readable permalinks and percent-encoded URL noise.

Slug generation with stop word removal

Stop words like "the", "a", "and", "of", "to" rarely add meaning to a URL but inflate its length. A slug generator with stop word removal collapses "The Complete Guide to React Hooks" into /complete-guide-react-hooks instead of /the-complete-guide-to-react-hooks. The trade-off: aggressive stop-word stripping can produce slugs that read awkwardly out of context, so most teams keep stop words in the title and only strip them in the slug.

Worked example: "Café del Mar — Best Songs (2026 Update)!"

pipeline
Step 1 — Normalize:    "Café del Mar — Best Songs (2026 Update)!"
Step 2 — Transliterate: "Cafe del Mar -- Best Songs (2026 Update)!"
Step 3 — Lowercase:     "cafe del mar -- best songs (2026 update)!"
Step 4 — Strip:         "cafe-del-mar---best-songs--2026-update-"
Step 5 — Collapse:      "cafe-del-mar-best-songs-2026-update"
Step 6 — Truncate(50):  "cafe-del-mar-best-songs-2026-update"   (already short)

The end result: a clean, ASCII-only, lowercase, hyphen-separated permalink that works in any URL context, indexes cleanly in search engines, and stays human-readable.

Slug style guide — best practices for every URL

RuleWhyGoodBad
Use hyphens, not underscores Google has explicitly recommended hyphens since 2008. They're treated as word separators; underscores are treated as part of the word. /my-cool-post /my_cool_post
Lowercase always URLs are case-sensitive in path. Mixed casing creates duplicate-content issues and inconsistent inbound links. /about-us /About-Us or /aboutus
Keep slugs short (3–5 words ideal) Mobile SERPs truncate URLs around 75 chars. Long slugs reduce click-through. /best-react-hooks-2026 /the-10-best-react-hooks-you-need-to-know-in-2026
Strip stop words "a", "the", "and", "of" rarely add value to URLs. Cleaner is better. /guide-css-grid /the-complete-guide-to-css-grid
Use ASCII, not Unicode URLs with raw Unicode become percent-encoded (résumér%C3%A9sum%C3%A9) — ugly in SERPs and shares. /resume-template /résumé-template
Avoid stop characters Periods, commas, exclamation points, question marks all reserved or get encoded. /q3-revenue-up-15-percent /q3-revenue!-up-15%25
Add the year when relevant "Best X for 2026" beats "Best X" — Google's freshness signal + matches user intent. /best-developer-tools-2026 /best-developer-tools
Don't change slugs after publishing Breaks inbound links from search results, social shares, bookmarks. Set up 301 redirects if you must change. Pick once, ship 301s if you change Silently change without redirects

Hyphens vs underscores vs nothing — the SEO debate

Google's URL structure guidelines have always recommended hyphens. The reason traces back to how Google's tokenizer parses URLs. Hyphens are treated as word boundaries — my-cool-post tokenizes to {my, cool, post}, three keywords each indexed independently. Underscores aren't word boundaries — my_cool_post tokenizes to a single token my_cool_post, which never matches the user's three-word search query.

The same applies to omitting separators entirely. /mycoolpost = one token, useless for search. Don't do it.

The "no separator" exception: branded short URLs

For brand top-level paths like /api, /about, /blog, single words are fine — no separator needed. The "use hyphens" rule applies to multi-word slugs.

Slug generation in 8 programming languages

JavaScript / Node.js (slugify library)

javascript
// npm i slugify
import slugify from 'slugify';

slugify('Café del Mar — Best Songs (2026)!');
// 'Cafe-del-Mar-Best-Songs-2026'

slugify('Hello World', { lower: true, strict: true, locale: 'en' });
// 'hello-world'

// Custom: remove specific words
slugify(title, {
  lower: true,
  strict: true,
  remove: /[*+~.()'"!:@]/g,
});

Python (python-slugify)

python
from slugify import slugify

slugify('Café del Mar — Best Songs (2026)!')
# 'cafe-del-mar-best-songs-2026'

# Custom max length, separator, stop words
slugify(title, max_length=50, separator='-', stopwords=['the', 'a', 'an'])

# Multi-language transliteration
slugify('Привет мир')   # 'privet-mir'
slugify('北京')           # 'bei-jing'

PHP (Symfony / Cocur Slugify)

php
// Symfony String component
use Symfony\Component\String\Slugger\AsciiSlugger;

$slugger = new AsciiSlugger();
$slug = $slugger->slug('Café del Mar — Best Songs (2026)!')->lower()->toString();
// 'cafe-del-mar-best-songs-2026'

// Or Cocur Slugify (more configurable)
use Cocur\Slugify\Slugify;
$slugify = new Slugify(['lowercase' => true, 'separator' => '-']);
$slugify->slugify('Café del Mar');  // 'cafe-del-mar'

Ruby on Rails

ruby
# Built-in
require 'active_support/core_ext/string/inflections'
"Café del Mar — Best Songs (2026)!".parameterize
# 'cafe-del-mar-best-songs-2026'

# With friendly_id gem (most popular in Rails)
class Post < ApplicationRecord
  extend FriendlyId
  friendly_id :title, use: :slugged
end
post.title = "10 Best React Hooks 2026"
post.save
post.slug   # '10-best-react-hooks-2026'

Go (gosimple/slug)

go
// go get github.com/gosimple/slug
import "github.com/gosimple/slug"

slug.Make("Café del Mar — Best Songs (2026)!")
// "cafe-del-mar-best-songs-2026"

// Language-specific transliteration
slug.MakeLang("Привет мир", "ru")  // "privet-mir"

// Custom max length
slug.MaxLength = 50

Rust

rust
use slug::slugify;

let s = slugify("Café del Mar — Best Songs (2026)!");
// "cafe-del-mar-best-songs-2026"

// For more control, use deunicode + manual processing
use deunicode::deunicode;
let ascii = deunicode("北京");  // "Bei Jing"

Java (slugify library)

java
import com.github.slugify.Slugify;

Slugify slg = Slugify.builder().lowerCase(true).build();
String slug = slg.slugify("Café del Mar — Best Songs (2026)!");
// "cafe-del-mar-best-songs-2026"

Bash / Shell

bash
# One-liner using iconv + sed + tr
echo "Café del Mar — Best Songs (2026)!" | \
  iconv -f utf-8 -t ascii//TRANSLIT | \
  tr '[:upper:]' '[:lower:]' | \
  sed -E 's/[^a-z0-9]+/-/g; s/^-+|-+$//g'
# cafe-del-mar-best-songs-2026

Common slug mistakes that hurt SEO

  • Changing slugs after publishing. Every change breaks inbound links. If you must change, set up a 301 redirect from the old slug. WordPress & Ghost handle this automatically; custom systems often don't.
  • Auto-generating from user input without sanitization. An attacker submits a title with ../../etc/passwd and your slug generator produces a path-traversal vulnerability. Always sanitize and reject obviously malicious patterns.
  • Including the date in every slug. /2024/05/best-react-hooks looks dated by 2025. Skip the date in the URL; use the page's published date as a separate field.
  • Ignoring duplicates. Two posts titled "Hello World" produce the same slug. Append a counter, a short UUID suffix, or year: /hello-world, /hello-world-2, /hello-world-2026.
  • Using underscores or camelCase. /myCoolPost is legal but indexes poorly. Stick to lowercase + hyphens.
  • Slugs longer than 80 chars. Mobile SERPs truncate around 50 visible chars. Aim for 3–5 words; trim aggressively.
  • Mixing slug styles across the site. /about-us, /contact_us, /Help all in one site. Pick one style; redirect old patterns with 301.
  • URL parameters instead of slugs. /page?id=42 is technically indexable but vastly worse for SEO than /best-react-hooks-2026. If you must use parameters, URL-encode them properly to avoid breaking the path.
  • Including session tokens or trackers in URLs. /blog/post?utm_source=email creates duplicate URLs in Google's index. Use canonicals or strip params at the CDN.
  • Forgetting to re-validate after CMS migrations. Importing 5,000 posts from WordPress to Hugo? Slug generators may produce different output. Audit randomly sampled URLs before going live.

WordPress slug rules — defaults, overrides, and gotchas

WordPress remains the most-used CMS on the web, so its slug rules are worth knowing even if you build elsewhere. WordPress generates a slug from the post title via the sanitize_title() function: lowercase, replace spaces with hyphens, strip punctuation, and run a Latin-script transliteration (cafécafe, but not Cyrillic or CJK out-of-the-box — those get percent-encoded unless you install a plugin like Babble or Polylang). The result is stored in the post_name column.

Authors can override the auto-generated slug from the post-editor sidebar — and should, when the auto-version is bloated with stop words or runs too long. WordPress handles slug collisions automatically by appending -2, -3, etc. The platform also auto-creates 301 redirects from old to new slugs when you change a published post's slug, which is one of the few CMSes that does this correctly out of the box. Ghost handles it similarly; Strapi, Contentful, and most headless CMSes leave 301s as your responsibility.

Slug for multilingual websites — hreflang and per-language paths

If you ship a multilingual site, slug per language is the standard pattern: /en/best-react-hooks, /es/mejores-hooks-react, /fr/meilleurs-hooks-react. Generate each language's slug from the localized title, not from a single English source. Pair the slugs with <link rel="alternate" hreflang="..."> tags in the page head so search engines understand they're language variants of the same content rather than duplicates. Don't auto-translate slugs from English — translate the title first, then slugify.

301 redirect best practice when slugs change

The single most damaging slug mistake is silently changing a published URL without a redirect. Every external link, every Google index entry, every social share now 404s. The fix is always the same: when changing a slug, set up a permanent (301) redirect from the old path to the new path. Most CMSes have a redirect-manager plugin or built-in feature. If you control the server, add the rule to .htaccess, Cloudflare's _redirects file, or Nginx's rewrite directives.

Best free URL slug generator for 2026 — what to compare

Search results for "url slug generator", "slugify online", and "create slug from title" surface a mix of single-page generators and full slugify libraries packaged as web tools. Three things separate the good from the noise: transliteration depth (does it actually handle Cyrillic, Arabic, Mandarin?), slug-style options (kebab vs snake vs custom separator), and whether the tool is browser-only or sends your titles to a server. Here's how the most-used slug generators compare in 2026:

ToolBrowser-onlyTransliterationCustom separator / caseStop-word removalCost
FreeDevTool URL Slug GeneratorYes (no upload)80+ scripts (Cyrillic, Greek, CJK, Arabic)Yes (kebab/snake/custom)YesFree
slugify.onlineYesLatin onlyLimitedNoFree, ad-funded
seoreviewtools.com slug generatorServer-sideLatin + some CyrillicLimitedNoFree
npm slugify libraryLocal installConfigurable charmapYesManualFree, open-source
WordPress sanitize_titleInside WPLocale-dependentNo (kebab forced)NoBuilt-in
Django slugify()Local PythonASCII transliterationNoNoBuilt-in

How do I create a SEO-friendly slug from a long title?

Three rules cover 95% of cases. One: lowercase everything — modern URLs are case-sensitive on most servers, but search engines treat /Hello-World and /hello-world as different URLs, splitting link equity. Two: replace any non-ASCII character with its closest Latin equivalent (transliteration) — Google indexes /cafe-del-mar far better than /café-del-mar because %C3%A9 percent-encoding hurts CTR. Three: drop stop words (a, an, the, of, in, on, and) so the slug stays under ~60 characters. Paste any title into the slugify field at the top of this page and it applies all three rules automatically; the worked example "Café del Mar — Best Songs (2026 Update)!" → cafe-del-mar-best-songs-2026-update.

What's the difference between a slug, a permalink, and a URL?

A URL is the full address: https://freedevtool.org/slug-generator. A permalink is the persistent (non-changing) URL for a piece of content. The slug is the human-readable path segment that identifies the resource — slug-generator in the example above. WordPress, Ghost, Webflow, Hugo, and Next.js all generate the slug automatically from the post title, then use it as the last URL path segment. Get the slug right at publish time; renaming it later requires a 301 redirect to preserve link equity, which most CMSs forget to do automatically.

Slug generator alternative to slugify.online — 4 reasons developers switched

  1. Real transliteration, not just ASCII strip. Cyrillic Привет becomes privet, not p-i-v-e-t. Greek Αθήνα becomes athina. Mandarin pinyin support included. ASCII-strip generators silently drop these characters and break international SEO.
  2. Configurable separator and case. Default kebab-case for URLs, snake_case for filenames, custom separator for legacy systems. Most online tools force kebab and offer no override.
  3. Stop-word filter with override. Drops a/an/the/of by default, with a toggle for cases where you need to keep them (book titles, song names where the article is part of the brand).
  4. No ads, no popups, no upload. Title text never leaves the browser. Critical for unannounced product launches where the slug itself is sensitive.

Pair the slug generator with the URL Encoder / Decoder for percent-encoding edge cases, the Case Converter for slug variants, and the Meta Tag Generator for the rest of the on-page SEO stack.

URL slug best practices for 2026

The fundamentals haven't changed since Google's 2008 URL-structure guidance, but a few practices have firmed up over the past five years — particularly around 301 redirects when changing slugs, multilingual sites with hreflang, and avoiding tracking parameters that fragment indexing. The list below captures what still matters for ranking and what's become non-negotiable.

  • Generate slugs once, lock them. Auto-generate from the title at create time. Let the user edit explicitly. Don't silently regenerate when titles change.
  • Limit to 3–5 words / 50–60 characters. Mobile SERP truncation; clickable preview length; user attention span.
  • Use a battle-tested library in your language — slugify (JS), python-slugify, Cocur (PHP), gosimple/slug (Go). Don't roll your own.
  • Always lowercase, always hyphens. Pick once, enforce site-wide.
  • Use 301 redirects when slugs change. Preserves SEO juice and existing inbound links.
  • Set up a slug-uniqueness check at the database level. Add a unique index on the slug column so the app can't accidentally publish two pages with the same URL.
  • For multi-language sites, slug per language. /en/best-react-hooks + /es/mejores-hooks-react + /fr/meilleurs-hooks-react. Use hreflang tags to link them.
  • Don't skip the slug step in the CMS workflow. Make slug-preview visible to authors before publish — many discover SEO opportunities in the slug edit UI.
  • Keep ASCII-only for paths. Use Unicode in titles, headlines, and content; ASCII-only in URLs. Saves percent-encoding pain everywhere.

How to use the URL slug generator

Convert page titles, product names, or any string into clean URL slugs — lowercase, hyphenated, transliterated. Used for permalinks, REST API endpoints, file names, and SEO-friendly URLs. Generation runs locally; supports 80+ languages with proper transliteration (Cyrillic, Greek, accented Latin, CJK).

Common mistakes to avoid

Frequently Asked Questions

What is a URL slug and why does it matter for SEO?
A URL slug is the human-readable portion of a URL that identifies a specific page — for example, /my-blog-post in https://example.com/my-blog-post. Slugs are critical for SEO because search engines use them to understand what a page is about. Clean, descriptive, keyword-rich slugs improve click-through rates in search results, are easier to share on social media, and help search engine crawlers determine page relevance. A well-crafted slug can be the difference between a URL that ranks and one that gets overlooked.
How do I create an SEO-friendly URL slug?
Follow these best practices to create SEO-friendly slugs: use lowercase letters for consistency, replace spaces with hyphens (not underscores), remove special characters and punctuation, include your target keyword, and keep it short — ideally 3–5 words. Remove stop words like "the," "and," "of," and "a" when they don't add meaning. Avoid numbers that may change over time (like years). A good slug is descriptive, concise, and instantly tells readers and search engines what the page contains.
Should I use hyphens or underscores in URLs?
Use hyphens (-). Google treats hyphens as word separators, so my-blog-post is interpreted as three separate words: "my," "blog," and "post." Underscores are treated as word joiners, meaning my_blog_post is read as one concatenated token. Google's own documentation and public statements from search advocates confirm that hyphens are the recommended separator for URLs. While underscores won't break your site, hyphens give you a slight SEO advantage and are the universally accepted web convention.
How long should a URL slug be for SEO?
Aim for 3–5 words or roughly under 60 characters. Google typically displays about 50–60 characters of a URL in search result snippets before truncating with an ellipsis. Shorter slugs are easier to read, copy, share, and remember. Focus on including your primary keyword while removing unnecessary filler words. Studies show that shorter URLs tend to correlate with higher rankings, though this is likely because concise URLs signal focused, well-organized content rather than being a direct ranking factor.
How do I handle special characters and accents in slugs?
Accented and special characters should be transliterated to their closest ASCII equivalents — e with acute accent becomes e, n with tilde becomes n, u with umlaut becomes u, and so on. Any remaining non-alphanumeric characters (except the separator) should be stripped entirely. This ensures maximum compatibility across all browsers, web servers, email clients, and social media platforms. Some CMS platforms handle this automatically, but it's important to verify — broken or percent-encoded characters in slugs look unprofessional and can confuse both users and crawlers.

Browse all 50 free developer tools

All tools run in your browser, no signup required, nothing sent to a server.