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-hooksis 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
ébecomese+ 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---bar→foo-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)!"
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
| Rule | Why | Good | Bad |
|---|---|---|---|
| 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)
// 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)
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)
// 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
# 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 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
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)
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
# 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/passwdand 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-hookslooks 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.
/myCoolPostis 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,/Helpall in one site. Pick one style; redirect old patterns with 301. - URL parameters instead of slugs.
/page?id=42is 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=emailcreates 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:
| Tool | Browser-only | Transliteration | Custom separator / case | Stop-word removal | Cost |
|---|---|---|---|---|---|
| FreeDevTool URL Slug Generator | Yes (no upload) | 80+ scripts (Cyrillic, Greek, CJK, Arabic) | Yes (kebab/snake/custom) | Yes | Free |
| slugify.online | Yes | Latin only | Limited | No | Free, ad-funded |
| seoreviewtools.com slug generator | Server-side | Latin + some Cyrillic | Limited | No | Free |
npm slugify library | Local install | Configurable charmap | Yes | Manual | Free, open-source |
| WordPress sanitize_title | Inside WP | Locale-dependent | No (kebab forced) | No | Built-in |
Django slugify() | Local Python | ASCII transliteration | No | No | Built-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
- Real transliteration, not just ASCII strip. Cyrillic Привет becomes
privet, notp-i-v-e-t. Greek Αθήνα becomesathina. Mandarin pinyin support included. ASCII-strip generators silently drop these characters and break international SEO. - 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.
- 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).
- 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. Usehreflangtags 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.