Slug Generator
Convert any text into a clean, URL-friendly slug.
Slug
What is it?
This tool converts any text into a clean, URL-friendly slug — lowercase, accent-free, with spaces and special characters replaced by a separator — entirely in your browser as you type.
Formula Explanation
Accented characters are converted to their plain equivalent (é → e, ñ → n), the text is optionally lowercased, and every run of characters that isn't a letter or digit (spaces, punctuation, symbols) is collapsed into a single separator, with any separator at the very start or end removed.
Example Calculation
"Café Münchën — 10 Tips & Tricks!" becomes cafe-munchen-10-tips-tricks with a hyphen separator, or cafe_munchen_10_tips_tricks with an underscore.
How to Use
- Type or paste your text — the slug updates live below.
- Choose a hyphen or underscore separator.
- Toggle lowercase on or off depending on your needs.
- Click Copy to copy the generated slug.
Benefits
- Handles accented and non-English characters automatically, not just plain ASCII text.
- Updates live as you type, with no button to click.
- Processes everything locally in your browser — your text is never sent anywhere.
Use Cases
- Generating a URL path segment from a blog post or article title.
- Creating a clean filename from a document title.
- Building a consistent ID or key from a product or category name.
What Your Result Means
The result contains only letters, digits, and your chosen separator — safe to use directly in a URL path without further encoding, and free of leading or trailing separators.
Tips
- Hyphens are the more common convention for URL slugs; underscores are more common for filenames or code identifiers.
- Keep lowercase on for URLs — most web servers treat paths as case-sensitive, and lowercase avoids inconsistency.
- Very long titles produce very long slugs — consider trimming to the key words if you want a shorter URL.
Common Mistakes
- Expecting numbers or hyphens already in the text to be removed — only non-alphanumeric characters are replaced, digits and letters are kept.
- Mixing separators inconsistently across a site's URLs — pick one convention (hyphen is most common) and stick with it.
- Forgetting that accented characters are converted to their closest plain-ASCII equivalent, not removed entirely.
FAQs
Is my text sent anywhere?
No, the slug is generated entirely locally in your browser using JavaScript — nothing is sent to a server.
Why use hyphens instead of underscores?
Search engines and most web frameworks treat hyphens as word separators in URLs, while underscores are sometimes treated as part of a single word — hyphens are the more common SEO-friendly choice.
Does this handle non-English text?
Yes — accented Latin characters (like é, ñ, ü) are converted to their plain equivalent; characters outside the Latin alphabet (e.g. Chinese or Arabic script) are removed since they don't map to a plain ASCII slug.
Can the slug be empty?
Yes, if the input contains no letters or digits at all (e.g. only punctuation or unsupported script) — enter some alphanumeric text to generate a non-empty slug.
Text is converted to a slug locally in your browser and is never sent to a server.
Last updated: August 1, 2026