Text tool
Slug Generator
Create a copy-ready, hyphen-separated URL slug from plain text.
URL slug
—
What the conversion actually does
Typed text runs through four steps in order: Unicode normalization splits accented letters into a base letter plus a separate accent mark, a pattern removes those marks, everything is lowercased, and any run of characters that isn't a-z or 0-9 collapses into one hyphen. Leading and trailing hyphens are then trimmed off, so punctuation at the start or end of your text disappears rather than leaving a dangling dash.
"Hello, Café World!" becomes "hello-cafe-world": the é splits into e + an accent mark that gets discarded, the comma and exclamation point are stripped as separators, and the space between words becomes a single hyphen. The result box also reports the slug's character length underneath it.
Formula and worked examples
"Node.js & React 18" → "node-js-react-18": the period after Node and the " & " around React are each a separate punctuation run, so each becomes its own single hyphen, while the digits 1 and 8 pass through unchanged.
"Café à la carte — Déjà Vu" → "cafe-a-la-carte-deja-vu": four accented letters (é, à, é, à) lose their marks, and the em dash between "carte" and "Déjà" is treated the same as a space, collapsing into one hyphen rather than surviving as a literal — character.
Slug pitfalls that cause real bugs
Two visually different titles can produce an identical slug once case and accents are removed. "Résumé Tips" and "Resume Tips" both normalize to "resume-tips" — the generator has no way to know these are separate pages, so if you're building URLs for a CMS or blog, you still need to check for a collision yourself, typically by appending a number or short ID.
Non-Latin scripts don't get transliterated, they get deleted. "café 日本語" produces just "cafe", because the Japanese characters have no accent mark to strip and no a-z equivalent to fall back to, so they're removed entirely along with the space that separated them. Consecutive punctuation is safe, though — "C++ Programming" becomes "c-programming" with a single hyphen, not "c--programming", because the whole ++ run is treated as one separator.
Where a generated slug gets used
A few concrete conversions this tool is built for:
- Blog post URLs — "10 Tips for Better Sleep!" → "10-tips-for-better-sleep"
- Product page paths — "Men's Running Shoes (2024)" → "men-s-running-shoes-2024"
- Heading anchor IDs for in-page navigation links
- File names for exports — "Q3 Financial Report — Draft" → "q3-financial-report-draft"
- Migrating legacy titles into a new CMS's URL scheme
- Normalizing user-submitted titles before storing them in a database
Frequently asked questions
Does the slug generator keep capital letters?
No. Every character is lowercased regardless of input, so "SEO Guide" and "Seo Guide" both produce "seo-guide".
What happens to accented characters like é or ñ?
They're reduced to their base Latin letter through Unicode normalization — é becomes e, ñ becomes n — so "Café" turns into "cafe" rather than being deleted or left as-is.
Can two different titles produce the same slug?
Yes. "Résumé" and "Resume" both generate "resume" once accents and case are stripped. The tool doesn't check for duplicates against anything else, so uniqueness across your own pages is still your responsibility.
Is my text sent to a server to generate the slug?
No. The normalization, lowercasing, and hyphenation all run in your browser's JavaScript engine, and the text is also never rendered as HTML, so pasted markup can't execute.
What happens to numbers and hyphens already in my text?
Digits 0–9 pass through unchanged, and existing hyphens are treated as separators like any other punctuation — "already--hyphenated" collapses to "already-hyphenated" instead of keeping the double dash.
Why did some characters disappear instead of turning into a hyphen?
Only Latin letters with an accent mark get converted; scripts without a Latin base letter, such as Chinese or Arabic, have nothing to fall back to and are simply dropped — "café 日本語" outputs just "cafe".