Slug Generator

Convert titles and phrases to URL-friendly slugs — kebab-case, snake_case, or custom separators for SEO-friendly URLs.

What is a URL Slug?

A URL slug is the human-readable, URL-friendly portion of a web address that identifies a specific page. For example, in the URL https://example.com/blog/how-to-build-a-rest-api, the slug is "how-to-build-a-rest-api". Slugs replace spaces with hyphens, remove special characters, and use only lowercase letters, numbers, and hyphens.

Good URL slugs are important for both SEO and usability. Search engines use the words in a URL as ranking signals. Short, descriptive, keyword-rich slugs help search engines understand page content and improve click-through rates in search results. They also make URLs shareable and memorable for users.

This generator converts text to slugs by lowercasing all letters, replacing non-alphanumeric characters with the chosen separator, collapsing multiple consecutive separators into one, and trimming separators from the start and end. It also handles Unicode characters by removing accents from Latin letters (é→e, ñ→n, ü→u) before processing.

FAQ

Should I use hyphens or underscores in URLs?
Google recommends hyphens (-) for URL slugs. Google treats hyphens as word separators, so "red-apple" is understood as two words "red" and "apple". Underscores are treated as word joiners, so "red_apple" is seen as one word "red_apple". For SEO, always use hyphens in URLs.
What is the ideal slug length?
Keep slugs under 60 characters. Shorter slugs are more memorable and fully visible in search results without truncation. Focus on the key keywords and remove stop words (the, a, and, or, etc.) unless they're essential to the meaning.
How are accented characters handled?
Accented Latin characters are converted to their base ASCII equivalents: é→e, ñ→n, ü→u, à→a, etc. This ensures slugs are pure ASCII and universally compatible with all web servers and browsers.