Slugify string
Turn a title or sentence into a clean URL slug: choose the separator, lowercase, accent stripping, CJK support and max length, with a before/after length comparison.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Options
Result
Type some text to generate a URL slug
What this tool does
- Turn a title with accents or Chinese into a readable URL slug — "Hello World! Café 你好" becomes hello-world-cafe-你好.
- Normalise a whole blog or docs site to one separator, one casing rule and one maximum length, instead of ending up with %E4%BD%A0 style escapes.
- Keep slugs short for SEO or short links: a maximum length truncates the result and strips the dangling separator at the cut.
- Compare the before/after character counts to make sure accent stripping or CJK removal did not shorten the slug more than you expected.
Example
Input
Hello World! Café 你好 (keep Chinese, strip accents, lowercase, separator -)
Output
hello-world-cafe-你好
The é in Café is decomposed with NFD and the combining mark removed, giving cafe. The original is 20 characters and the slug 19, counting each Chinese character as one.
Frequently asked questions
Should I keep the Chinese characters?
They are kept by default, because modern browsers and search engines handle UTF-8 paths correctly and a readable slug is friendlier. If the target only accepts ASCII — some CDNs, object stores and older CMSs — turn "Keep Chinese" off and only Latin letters and digits survive; the rest becomes the separator.
Is the maximum length counted in bytes or characters?
Characters (Unicode code points), so a Chinese character counts as one rather than three bytes. If the cut lands on a separator, that separator is trimmed, so you never get a slug ending in hello-world-.
Why does Café become cafe while 你好 stays as is?
Accent stripping only removes Unicode combining marks (the U+0300–U+036F range after NFD decomposition), which is exactly what é → e is. 你 is a standalone ideograph with no mark to strip, so it can only be kept or dropped entirely via the option.
What happens to emoji and punctuation?
Both are "neither letter nor digit", so they become the separator. With "Collapse repeated separators" enabled a run of punctuation leaves a single separator, and separators at either end are trimmed — so "Hello!!!" yields hello.
Do I get the same slug every time for the same title?
Yes. The function is pure: it reads no clock, no randomness and no locale (casing uses JavaScript’s built-in toLowerCase), so identical input and options always produce an identical slug.
Keywords:slugifyslug generatorURL slug生成 slugURL 友好permalink去除重音符号accent removalSEO 链接