Slug Generator

Convert any text into a clean, URL-friendly slug.

Separator:

Slug Generator — What It Does

Paste any title, heading, or phrase and instantly generate a clean, URL-safe slug. The tool lowercases text, strips special characters, transliterates accented letters to ASCII equivalents, and replaces spaces with your chosen separator (hyphen, underscore, or dot). Ideal for blog post URLs, CMS slugs, file names, and API route naming.

Slug Conversion Rules

  • All letters converted to lowercase
  • Spaces and punctuation replaced with the separator (default: hyphen)
  • Accented characters transliterated — é → e, ü → u, ñ → n
  • Consecutive separators collapsed into one — foo--bar → foo-bar
  • Leading and trailing separators stripped

Slug Examples

  • Hello, World!hello-world
  • 10 Best Café Recipes (2024)10-best-cafe-recipes-2024
  • C# vs. Java: Which is Better?c-vs-java-which-is-better
  • What's New in Node.js 22whats-new-in-nodejs-22

Slug SEO Tips

  • Include target keywords — Use 2–4 keywords that reflect the page content.
  • Keep it short — Aim for under 60 characters. Shorter URLs are easier to share and fit in search snippets.
  • Avoid stop words — Drop "a", "the", "and", "in" when the meaning stays clear.
  • Never change live slugs — Changing a published URL without a 301 redirect breaks links and loses SEO equity.

Frequently Asked Questions

What is a URL slug?
A URL slug is the human-readable part of a URL that identifies a specific page. For example, in "https://example.com/blog/how-to-write-slugs", the slug is "how-to-write-slugs". Slugs are lowercase, use hyphens instead of spaces, and contain only ASCII letters, numbers, and separators.
Why use hyphens instead of underscores in URL slugs?
Google treats hyphens as word separators in URLs but may treat underscores as joining characters — so "how-to-code" is indexed as three words, while "how_to_code" might be treated as one. For SEO, hyphens are strongly preferred. Underscores are acceptable in non-public URLs and file paths.
How should I handle special characters and accented letters in slugs?
Accented characters (é, ü, ñ, etc.) should be transliterated to their ASCII equivalents (e, u, n). Special characters like &, %, @, and # should be removed. Apostrophes and quotes should be dropped entirely rather than replaced with hyphens to avoid ugly double-hyphens.
What is the maximum length for a URL slug?
Technically, URLs can be up to 2,048 characters, but slugs should be kept to 50–70 characters for usability and SEO. Google typically displays URLs up to about 75 characters in search results. Focus on including 2–4 keywords rather than the full title.
Does slug capitalization affect SEO?
Yes. Slugs should always be lowercase. Mixed-case URLs can create duplicate content issues because servers may treat "Blog/My-Post" and "blog/my-post" as different pages. Always canonicalize to lowercase and redirect uppercase variants with a 301 redirect.