URL Slug Generator
Converts any text into a clean, URL-safe slug for routes, filenames, and IDs
About this generator
Titles and labels entered by users or authors contain spaces, punctuation, and accented characters that cannot appear unescaped in a URL. This generator converts any text into a clean, URL-safe slug: lowercased, accent-stripped, with special characters removed and spaces collapsed into a single separator. Paste in a blog post title, a product name, or a heading and get a slug you can drop straight into a route, a filename, a CMS field, or a database key. The text textarea accepts any input. The separator dropdown chooses between a hyphen (-) or an underscore (_). The function normalises Unicode accents via NFKD decomposition, strips all remaining non-alphanumeric characters, trims leading and trailing separators, and collapses runs of whitespace or separators into one. If the result is empty — for example, if the input was only punctuation — it returns 'untitled'. Hyphens are the standard choice for web URLs: search engines treat them as word separators, which improves keyword matching in the slug. Use underscores only when a system specifically requires them, such as Python module names or certain filename conventions. Generate a slug from your title once and store it — if the title changes later, keep the original slug so existing links continue to work.
How to use
- Paste or type the title or phrase you want to convert.
- Choose a hyphen or underscore as the word separator.
- Click Generate to produce a clean, URL-safe slug.
- Copy the slug into your route, filename, or CMS field.
Use Cases
- •Turning article titles into clean URL paths for a blog or CMS
- •Generating safe filenames from human-readable names
- •Creating anchor IDs for headings on a page
- •Producing stable keys or identifiers from labels
- •Cleaning user-entered text before using it in a URL
Tips
- →Prefer hyphens for web URLs — search engines treat them as word breaks.
- →Keep slugs short and meaningful; trim filler words for a cleaner link.
- →Generate the slug from the title once and store it, so the URL stays stable if the title changes.
- →Watch for accented characters — this tool strips them so the slug stays ASCII-safe.
FAQ
what is a url slug
A slug is the human-readable part of a URL that identifies a page, such as best-coffee-recipes in /blog/best-coffee-recipes. It is lowercase, uses a separator instead of spaces, and avoids special characters so it is safe and descriptive in a link.
why are slugs good for seo
Descriptive slugs tell both readers and search engines what a page is about before they open it. A clean, keyword-bearing slug is easier to share, more likely to be clicked, and gives search engines an extra relevance signal compared with an opaque numeric URL.
should I use hyphens or underscores in a slug
Hyphens are the standard and recommended choice for URLs because search engines treat them as word separators, whereas underscores can join words together. Use underscores only when a system specifically requires them, such as certain filenames.
what happens to accented characters like é or ü
The generator normalises the input using Unicode NFKD decomposition, which separates base letters from their accent marks, then strips all non-ASCII characters. So 'Héros' becomes 'hros' rather than keeping the accent or producing a percent-encoded sequence. If you need to preserve accented characters, you should encode them separately before adding to a URL.
You might also like
Popular tools from other categories that share themes with this one.