URL Slug Generator
Convert any text to a clean, SEO-friendly URL slug — custom separator, case mode, and max-length support, all in your browser
Input Text
Options
Word Separator
Case
Max Length (0 = unlimited)
Generated Slug
Your blog post title is “10 Résumé Tips — How to Stand Out (2024 Edition)”. The URL slug needs to be 10-resume-tips-how-to-stand-out-2024-edition — lowercase, accented characters normalized, special characters removed, spaces replaced with hyphens, and the em dash gone. Doing this manually for every post is error-prone; one uppercase letter or stray character means inconsistent URLs.
Why This Generator (Not a Manual Approach)
Most CMS platforms auto-generate slugs, but they don’t all handle accented characters, custom separators, or maximum length the same way. This tool gives you full control — custom separators (hyphen, underscore, dot), case options, max length truncation, and Unicode normalization for accented characters like é → e and ü → u. Everything runs in your browser.
What Is a URL Slug?
A URL slug is the human-readable part of a web address that identifies a specific page. For example, in the URL https://example.com/blog/how-to-use-git-rebase, the slug is how-to-use-git-rebase. Slugs are lowercase, use hyphens to separate words, and contain only alphanumeric characters — making them both readable for humans and safe for browsers.
Good slugs improve search engine rankings, make URLs easier to share and remember, and reflect the content of the page to both users and crawlers.
How This Tool Works
Paste any text into the input field and the slug is generated instantly. The transformation pipeline:
- Diacritic normalization — accented characters are converted to their ASCII base form (é → e, ñ → n, ü → u, ç → c, etc.)
- Non-ASCII removal — characters outside the ASCII range that cannot be transliterated (CJK, Arabic, etc.) are removed
- Special-character stripping — punctuation, symbols, and whitespace sequences are replaced with the chosen separator
- Case transformation — the result is lowercased, uppercased, or kept as-is depending on your setting
- Separator cleanup — consecutive separators are collapsed into one, and leading/trailing separators are trimmed
- Max-length enforcement — if a limit is set, the slug is cut at the nearest word boundary so no word is sliced in half
Separator Options
The separator is the character inserted between words in the slug:
- Hyphen (
-) — the standard for most web frameworks, CMS platforms (WordPress, Shopify, Ghost, Jekyll, Hugo), and SEO recommendations.hello world→hello-world - Underscore (
_) — used in Python package names, some legacy CMS platforms, and database identifiers.hello world→hello_world - Dot (
.) — used in file extensions and some configuration-key naming schemes.hello world→hello.world - Custom — type any character or short string to use as the separator. Useful for domain-specific requirements or special routing patterns.
For most web URLs and SEO purposes, the hyphen is preferred. Google’s John Mueller has confirmed that Google treats hyphens as word separators, making hello-world better for search indexing than helloworld or hello_world.
Case Modes
- Lowercase (default) — converts all characters to lowercase. This is the most common choice for URLs and is required by most web servers and frameworks.
- Uppercase — converts all characters to uppercase. Rarely used for URLs but useful for identifiers and constants.
- Preserve — keeps the original case of each character. Use this only when you need case-sensitive identifiers that will not be used in standard HTTP URLs (which are typically case-insensitive in the path).
Max Length
URLs should generally be kept under 75–100 characters for readability and SEO. The max-length option trims the slug at the nearest separator boundary so words are never cut in half. For example, if the limit is 20 and the slug would be quick-brown-fox-jumps, the result might be quick-brown-fox (trimmed at the separator before the cut point).
Common max-length recommendations:
- Blog post slugs: 50–75 characters
- Product URLs: 40–60 characters
- Category/tag pages: 30–40 characters
Accented Character Support
The slug generator handles the full Latin extended character set:
| Input | Output |
|---|---|
Résumé | resume |
Crêpes | crepes |
Ñoño | nono |
Straße | strase |
Björk | bjork |
Über | uber |
Kévin | kevin |
Characters outside the Latin script (Chinese, Japanese, Korean, Arabic, Cyrillic, etc.) are removed entirely because one-to-one transliteration requires a large dictionary lookup and would add significant JavaScript bundle weight. If you need CJK transliteration, consider pre-processing with a library like pinyin (Chinese) or wanakana (Japanese).
Common Use Cases
CMS and Blog Platforms
Every major content management system generates slugs automatically, but they sometimes produce suboptimal results (duplicated words, numbers appended for uniqueness, excessive length). Use this tool to craft a precise slug before entering it into WordPress, Ghost, Contentful, Strapi, or any headless CMS.
Static-Site Generators
Tools like Hugo, Jekyll, Gatsby, and Astro use file names or front-matter slug fields to determine URLs. This generator helps you produce consistent, SEO-friendly slugs for your content files.
E-commerce Product URLs
Product slugs in platforms like Shopify, WooCommerce, and BigCommerce affect both click-through rates and rankings in Google Shopping. A clean slug like wireless-noise-cancelling-headphones is more descriptive than a SKU-based URL.
API Route and Identifier Generation
When designing REST APIs or GraphQL schemas, you may need URL-safe identifiers from human-readable names. This tool generates slug identifiers for tags, categories, topics, and other resources.
Internationalized Content
If you publish content in multiple languages, each article needs a URL-safe slug in the target locale. This tool normalizes accented characters from French, Spanish, German, Portuguese, and other Latin-script languages into ASCII slugs.
SEO Best Practices for URL Slugs
- Use hyphens, not underscores — search engines treat hyphens as word separators
- Keep it short and descriptive — include the primary keyword, drop filler words (the, a, and, or, of)
- Use lowercase — URL paths are case-sensitive on most servers; lowercase avoids duplicate content issues
- Avoid keyword stuffing — one or two relevant keywords are enough; overstuffing triggers spam filters
- Remove dates where possible —
how-to-use-gitages better than2024-01-how-to-use-git - Be consistent — choose one separator and stick to it across your entire site
Frequently Asked Questions
Can I use this for YouTube video IDs or other auto-generated identifiers? No — auto-generated platform IDs (YouTube, Twitter, etc.) are opaque strings that cannot be reverse-engineered. This tool is for converting human-readable text into URL-safe slugs, not for decoding platform identifiers.
What happens to numbers in the input?
Numbers are preserved as-is. Product 42 Review becomes product-42-review.
Does removing special characters affect SEO?
No. Special characters like &, @, %, and # have special meaning in URLs and must be percent-encoded or removed. Clean slugs without these characters are always better for SEO and user experience.
Why are Chinese/Japanese characters removed?
Transliterating CJK characters to Latin requires a large dictionary that would significantly increase page load time. For CJK content, a pre-processing step with a dedicated library (e.g., pinyin for Mandarin) is recommended before using this tool.
Is my text sent to a server? No. All slug generation happens entirely in your browser using JavaScript. No text or data is ever transmitted to any server. This tool works offline once the page is loaded.
What is the difference between a slug and a URL?
A URL (Uniform Resource Locator) is the complete web address, including protocol, domain, path, and query parameters. A slug is only the path segment that identifies a specific page — the how-to-use-git-rebase part of https://example.com/blog/how-to-use-git-rebase.