When to use it
Turning a blog title into a URL slug, normalizing repo names, cleaning
up filenames in bulk — "Hello World — first post!" becomes
hello-world-first-post or hello-world-first depending on what you
want to keep.
Options
- Separator —
-or_. Hyphens are the SEO standard for URLs. - Lowercase — useful when the target system treats casing as significant.
- Strip accents — NFD decomposition then drops combining marks, so
é → e,ü → u. Helpful for European languages. - ASCII only — replaces every non-ASCII character with the separator. Off by default — it's lossy. Turn it on only when you need to feed a legacy system that can't handle Unicode.
- Max length — 0 = unlimited. Trailing separator is cleaned up after slicing.
ASCII vs Unicode
Modern browsers and servers accept https://blog.example/한글-슬러그
directly, and search engines often match Unicode slugs to local
queries. Use ASCII mode only when an external integration (email,
older servers) chokes on Unicode paths.
Pre-publish titles stay in the page
Unicode-preserving mode (Hangul slugs) and ASCII-only toggle both go through regex. Input is never logged.