Paste a title. Get a clean, shareable URL slug instantly.
Type or paste any page title, blog post heading, or product name above and this slug generator converts it into a URL-friendly string — lowercase letters, hyphens instead of spaces, no special characters. Copy the result straight into your CMS, router, or database.
Input:
10 Best Tips, in 2026!Output:
10-best-tips-in-2026The four rules applied here: (1) lowercase everything, (2) spaces become hyphens, (3) punctuation is stripped (comma, exclamation mark), (4) repeated hyphens collapse into one. A good slug is also short, readable, and keyword-rich — drop filler words like "in" if the slug gets long.
How to use this slug generator
- Type or paste your title into the input box above.
- The slug updates as you type — no button needed.
- Click Copy to put it on your clipboard.
- Paste it wherever you need it: WordPress, Shopify, Next.js, Django, or your own database.
Another worked example
| Input title | Output slug |
|---|---|
| My Café & Bar Menu — Spring 2026 | my-cafe-bar-menu-spring-2026 |
| What is OAuth 2.0? | what-is-oauth-2-0 |
| Extra Spaces Here | extra-spaces-here |
| Crêpes, Résumés & Naïve Queries | crepes-resumes-naive-queries |
Notice how accented characters (é, ê, ï) are transliterated to their plain ASCII equivalents, and the ampersand (&) is removed entirely.
How to generate a URL slug in code
If you need to do this server-side or automate it in a pipeline, here are two minimal, copy-pasteable snippets.
JavaScript (browser or Node.js)
function slugify(text) {
return text
.toString()
.normalize('NFD') // split accents from base letters
.replace(/[\u0300-\u036f]/g, '') // strip accent marks
.toLowerCase()
.trim()
.replace(/[^\w\s-]/g, '') // remove non-word chars
.replace(/[\s_]+/g, '-') // spaces and underscores to hyphens
.replace(/--+/g, '-'); // collapse repeated hyphens
}
console.log(slugify('10 Best Tips, in 2026!'));
// => '10-best-tips-in-2026'
Python 3
import re
import unicodedata
def slugify(text: str) -> str:
text = unicodedata.normalize('NFD', text) # split accents
text = text.encode('ascii', 'ignore').decode() # drop non-ASCII
text = text.lower().strip()
text = re.sub(r'[^\w\s-]', '', text) # remove punctuation
text = re.sub(r'[\s_]+', '-', text) # spaces to hyphens
text = re.sub(r'-+', '-', text) # collapse repeats
return text
print(slugify('10 Best Tips, in 2026!'))
# => '10-best-tips-in-2026'
Popular frameworks include this out of the box — for example, Django has django.utils.text.slugify, and the slugify npm package handles edge cases across dozens of languages.
How it works
The tool runs entirely in your browser using JavaScript. No text is sent to any server — everything happens locally on your device, so your content stays private.
Under the hood it follows five steps in order:
- Normalise — Unicode text is decomposed so accented characters (é → e) can be handled cleanly.
- Lowercase — all characters are converted to lowercase.
- Strip punctuation — anything that isn't a letter, number, space, or hyphen is removed.
- Spaces to hyphens — spaces (and underscores) become
-. - Collapse & trim — multiple hyphens in a row collapse to one; leading and trailing hyphens are removed.
When to use a slug generator — and when not to
Good times to use it
- Creating blog post URLs in a CMS like WordPress, Ghost, or Contentful.
- Generating route paths in frameworks like Next.js, Nuxt, or Rails.
- Naming product handles in Shopify or WooCommerce.
- Building anchor IDs for jump links within a long page.
- Normalising user-submitted data (e.g. tag or category names) before storing it.
When a different approach makes more sense
- Non-Latin scripts (Arabic, Chinese, Korean): pure ASCII slugs lose all meaning. Consider keeping the original script or using a dedicated transliteration library for the target language.
- Very long titles: slugs over ~60–70 characters can hurt readability and SEO. Manually trim to your key phrase after generating.
- Version numbers with dots (e.g.
v1.2.3): dots are stripped by default. Keep them if your routing system needs exact version paths, and adjust the regex accordingly. - Filenames with extensions: if you need
my-file.pdf, strip only the name part and preserve the extension separately.
For guidance on URL best practices, Google's own URL structure documentation recommends short, descriptive, hyphen-separated URLs — which is exactly what a well-formed slug provides.
Bottom line: clean slugs make your URLs readable, shareable, and search-engine friendly. Paste your next title above and grab a perfect URL segment in one click.