Convert text into a URL-, filename-, and ID-safe slug locally.
Loading tool
About Slugify String
Turn a title or phrase into a slug safe for URLs, file names and IDs, one line at a time. Accents are stripped with Unicode NFD normalization plus a mapping for letters like ß, æ and ø; you can choose the separator (hyphen, underscore, dot or custom), keep or drop lowercase, spell out symbols (& becomes and, @ becomes at), keep non-Latin letters such as Cyrillic or CJK, and set a maximum length that cuts on a word boundary.
Common uses
- Create a URL slug for a blog post or product page from its title.
- Generate file-system-safe names from document titles.
- Build HTML id or anchor values from headings.
- Slugify a batch of titles at once, one per line.
FAQ
- What is a URL slug?
- A slug is the human-readable part of a URL that identifies a page, such as how-to-ship-faster in /blog/how-to-ship-faster. It is usually lowercase, uses hyphens between words and avoids characters that need percent-encoding.
- Should slugs use hyphens or underscores?
- Hyphens are the usual choice for URLs, and Google recommends hyphens over underscores to separate words in URLs.
- How are accented characters handled?
- With diacritic stripping on, characters are decomposed (é becomes e plus a combining accent) and the accent marks are removed, so Crème Brûlée becomes creme-brulee. Letters that do not decompose, like ß or ø, are mapped to ss and o.