function slugify(input) {
return input
.normalize('NFKD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
.replace(/^-+|-+$/g, '')
.replace(/-{2,}/g, '-');
}
slugify('Café Crème — URL Slugs');
// cafe-creme-url-slugs
Slugify Text into a Clean URL Slug
Paste any string and get the lowercase, hyphenated version a URL expects, with the matching JavaScript and Python implementation beside it.
https://toolguest.com/your-slug-here
A slug is one step of publishing. These three free tools finish the job, and none of them asks for an account.
ToolGuest URL Slug Generator is a free, zero-ad, 100% client-side SEO utility that converts page titles, keywords and pasted line lists into clean, lowercase, hyphenated URL slugs, with stop-word removal, accent handling, number stripping and batch processing, in under 50ms and offline, with zero server uploads and no sign-up.
Copy the same slug rules into JavaScript or Python
Use the browser when you need one slug; use these snippets when the conversion belongs in a build script, a CMS hook or an API. Both follow the same order: normalise accents, lowercase, replace non-alphanumerics, filter stop words and trim at a word boundary.
import re
import unicodedata
def slugify(value: str) -> str:
value = unicodedata.normalize('NFKD', value)
value = value.encode('ascii', 'ignore').decode('ascii')
value = re.sub(r'[^a-zA-Z0-9]+', '-', value).strip('-').lower()
return re.sub(r'-{2,}', '-', value)
print(slugify('Café Crème — URL Slugs'))
# cafe-creme-url-slugs
Built like a product, not a form
Every control you need to produce production-ready permalinks.
Multi-separator engine
Hyphens, underscores, slashes, dots or any custom delimiter.
Accent & script normalizer
é→e, ñ→n, ü→u. Cyrillic and Greek transliterated automatically.
SEO stop-word filter
Strip a, an, the, and, or — shorter, punchier URLs.
Live SERP preview
See exactly how your slug renders in Google results.
Bulk + CSV import
Paste a hundred headlines or drop a file — convert all in one shot.
Copy, export, history
Copy the slug or URL, export .txt / .csv, keep a private history.
What does it mean to slugify text?
Slugify Text is ToolGuest's free, client-side converter that turns any string into a lowercase, hyphenated URL slug. It folds accents, drops punctuation and optional stop words, collapses repeated separators and shows the finished URL, with matching JavaScript and Python snippets for the same rules and no signup or upload.
To slugify text is to reduce a human string to the characters a URL can carry safely, then join the survivors with a separator. Nothing is translated, summarised or rewritten. Emoji, punctuation and accented letters are removed or folded, spaces become hyphens, and the result is lowercase so a case-sensitive server cannot serve two versions of one page.
The operation is small enough to write in ten lines and important enough to get wrong in production. This page shows the live converter and the code that reproduces it, so the slug you approve in the browser is the slug your build script will write.
Slugify text: inputs, outputs and the rule behind each one
Each row is a string a real editor or developer would paste. The output column is what this page returns with the default settings.
| Input string | Slugified output | Rule applied | Where it matters |
|---|---|---|---|
Slugify This String | slugify-string | Lowercase, spaces to hyphens, stop word removed | Page routes and CMS permalinks |
Café Crème & 100% Fresh | cafe-creme-100-fresh | Accents folded, symbols dropped, digits kept | Product names and menus |
User_Profile_Settings v2 | user-profile-settings-v2 | Underscores and spaces unified to hyphens | Docs pages and file names |
Über Unsere Straße | uber-unsere-strasse | ü → u, ß → ss | German titles in an English sitemap |
Slugify is five string operations in a fixed order
The order matters more than the code. Normalise Unicode first, so an accented letter becomes a base letter plus a combining mark that can be removed. Lowercase next, so later comparisons are stable. Then replace every run of non-alphanumeric characters with one separator, collapse repeats and trim the edges. Reorder those steps and you get slugs such as caf--cr-me or a trailing hyphen that looks like a broken link.
Stop-word removal comes last, after tokenisation, because it operates on whole words rather than characters. That is also where a custom list belongs: buy, shop or a brand term can be filtered without touching the character rules.
Slugify in JavaScript and Python without a dependency
In JavaScript, normalize("NFKD") plus a combining-mark regex covers most Latin accents, and a single replace(/[^a-z0-9]+/g, "-") handles the rest. In Python, unicodedata.normalize and re.sub do the same job. Neither needs a package, which matters in a build script that should not gain a dependency for ten lines of string handling.
Copy the snippets from this page and run them against a sample of real titles before shipping. Compare old and new outputs side by side: a rule change that silently renames a hundred routes is a migration, not a refactor.
Where slugify breaks in production
Three failures recur. The first is double separators, produced when spaces and punctuation are replaced in two passes instead of one. The second is a slug that is empty because the input was entirely emoji or punctuation, which needs a fallback such as a short hash or an id. The third is a slug longer than the database column, silently truncated by the server but not by the CMS preview.
Set a maximum length and cut at a separator boundary, not mid-word. If the language does not use spaces, such as Chinese or Japanese, decide explicitly whether to keep UTF-8 characters or transliterate them; the answer differs for a blog and for an internal API key.
Slugify a whole list without a spreadsheet
Route tables, product imports and sitemap migrations all need dozens of slugs at once. Bulk mode applies one rule set to every line and exports the result, which removes the most common cause of inconsistent URLs: two people, two spreadsheets, two different stop-word lists.
Sort the output and scan for duplicates before you import it. Two titles can slugify to the same string, and the second page will overwrite the first or inherit its canonical tag.
Slugify Text questions, answered
What does it mean to slugify a string?
Slugify means converting a string into a URL-safe slug: lowercase letters, digits and a single separator in place of spaces, punctuation and accents. Developers use it for routes, file names, API identifiers and database keys, so the same text can travel through a URL without percent-encoding or case ambiguity.
How do I slugify text in JavaScript?
Normalise with normalize("NFKD"), remove combining marks, lowercase the result, replace every run of non-alphanumeric characters with a hyphen and trim the edges. The copy-ready snippet on this page does exactly that with no dependency. Run it against real titles before you replace an existing implementation.
Does slugify handle emoji and symbols?
Yes. Emoji, currency signs, em dashes and smart quotes are treated as non-alphanumeric characters and replaced by the separator, then collapsed. If a string contains nothing else, the result would be empty, so keep a fallback such as an id or a short hash for those rows rather than storing a blank slug.
Why does my slugify function produce double hyphens?
Because spaces and punctuation were replaced in two separate passes, or repeated characters were never collapsed. Replace one run of non-alphanumeric characters with a single separator using a plus quantifier, then trim leading and trailing separators. This tool applies that order and flags repeated separators in the health badge.
Can I slugify a whole list of strings at once?
Yes. Switch to Bulk mode, paste one string per line and every row is converted with the same separator, accent and stop-word rules. Copy the list or export .txt or .csv. Sort the output and check for duplicates before importing, since two similar strings can produce one identical slug.
All URL Slug & SEO Formatting Tools
Start with the full generator or jump straight to the job you need. Every page uses the same private, client-side engine and keeps all controls active.
Slugify the string, then ship the route
Paste the text, confirm the output and copy either the slug or the snippet that reproduces it in your codebase.
Open the slug generator