webby.tools

Text to Slug Generator

Convert any text into a clean, URL-friendly slug. Useful for blog post URLs, page slugs, file names, and database keys. Paste one line or many — each line becomes its own slug.

What is a Slug?

A slug is the URL-friendly version of a piece of text. It is typically lowercase, uses hyphens instead of spaces, and contains only letters, numbers, and hyphens. For example, the title "My First Blog Post!" becomes the slug my-first-blog-post.

Slugs appear in website URLs (e.g. example.com/blog/my-first-blog-post), file names, database IDs, and CSS class names.

How the Slugifier Works

  1. Normalise accented characters — é becomes e, ü becomes u, ñ becomes n, etc. (when the option is enabled).
  2. Lowercase everything — all letters are converted to lowercase.
  3. Replace common symbols — & becomes "and", @ becomes "at".
  4. Strip non-alphanumeric characters — punctuation, brackets, quotes, and other special characters are removed.
  5. Replace spaces with the separator — spaces (and any existing hyphens or underscores) are replaced with your chosen separator.
  6. Trim leading and trailing separators — the slug is cleaned up so it doesn't start or end with a hyphen or underscore.

Frequently Asked Questions

Hyphens or underscores — which should I use?

Hyphens are strongly preferred for web URLs. Google treats hyphens as word separators, so "my-blog-post" is read as three separate words. Underscores are sometimes used for database column names or Python variable names where hyphens are not valid identifiers.

Can I slugify multiple titles at once?

Yes — enter one title per line and each line will be converted to its own slug. Blank lines are preserved as blank lines in the output so the line numbers stay aligned.

What happens to accented characters like é or ü?

With "Convert accented characters" enabled, the tool uses Unicode normalisation (NFD) to separate base letters from their diacritical marks, then strips the marks. This converts é → e, ñ → n, ü → u, and so on. Disable the option to drop those characters entirely instead.

Icons from Creative Fabrica

This website may contain affiliate links. If you click on an affiliate link and make a purchase, we may receive a small commission at no additional cost to you.