Text & Writing

Free Text to Slug Converter Online

Convert any text to clean URL slugs. Handles spaces, accents, special characters and case.

What is a URL slug?

A URL slug is the human-readable portion of a web address that identifies a specific page. In the URL https://example.com/blog/how-to-bake-bread, the slug is how-to-bake-bread. Slugs replace spaces with hyphens, strip special characters, and enforce lowercase — producing clean, linkable, and search-engine-friendly URLs.

Every major content management system — WordPress, Ghost, Webflow, Shopify, and others — generates a slug from your page title automatically. However, auto-generated slugs often include stop words, redundant characters, or unoptimized phrasing. This converter lets you craft the exact slug you want and preview it instantly before publishing.

Developers working with routing frameworks (Next.js, Nuxt, Laravel, Django) also use slug generators to normalize file names, route paths, and database keys that must be URL-safe. Consistent slug formatting across a project reduces routing bugs and improves codebase maintainability.

How to use the slug converter

  1. 1
    Choose your separator

    Select hyphen (-) or underscore (_). Hyphens are recommended for public URLs — Google treats them as word separators. Use underscores only if your codebase or framework convention requires them.

  2. 2
    Paste or type your text

    Enter your page title, product name, or any text. The converter handles mixed case, accented characters, numbers, and special symbols automatically.

  3. 3
    Copy the result

    Your slug appears instantly in the green output box. Click Copy to grab it, then paste directly into your CMS, router config, or file name.

Slug best practices and SEO impact

URL structure is a confirmed on-page SEO factor. While slugs are not a primary ranking signal, a well-crafted slug improves click-through rates from search results, makes links more shareable, and helps Google understand page content before even crawling it.

PracticeRecommendedAvoidReason
Word separatorhyphens (my-page)underscores (my_page)Google reads hyphens as spaces; underscores join words
Caseall lowercaseMixed or UPPER caseCase differences create duplicate content on most servers
Length3–6 keywordsFull sentence slugsLong slugs get truncated in search results
Stop wordsRemove "a", "the"Keep all wordsShorter slugs read better and pass more link equity
Special charsalphanumeric only@, #, %, &, !Non-ASCII chars require percent-encoding
Accentstransliterate (e)Encode (%C3%A9)ASCII slugs are cleaner and more portable

How slug generation works under the hood

The slugification algorithm runs through four transformation steps in sequence:

1
Unicode normalization (NFD)
Decomposes characters like é into base character e + combining accent ́. This separates the letter from its diacritic so the accent can be stripped cleanly.
2
Strip diacritics
Removes all Unicode combining marks (U+0300–U+036F) — the accents, cedillas, umlauts, and tildes — leaving only the base Latin characters.
3
Lowercase and clean
Converts to lowercase, then replaces every character that is not a-z, 0-9, or a space with a space (preparing for separator replacement).
4
Replace separators
Collapses all runs of spaces into the chosen separator (hyphen or underscore), then trims leading and trailing separators for a clean result.

Example transformation: "Héllo Wörld! 2024""hello-world-2024"

Slugs in different frameworks and platforms

Different frameworks and platforms use slugs in slightly different ways. Understanding the conventions of your platform helps you generate the right format:

WordPress / Ghost
hyphen-lowercase
Auto-generated from post title; editable before publish
Next.js / Nuxt
[slug].tsx / [slug].vue
File names and dynamic route params; conventionally hyphenated
Django / Flask
SlugField
Built-in slugify() function; stored in database as hyphenated string
Shopify
product handle
Product URL identifier; lowercase hyphen convention
Webflow
Page slug
Editable in page settings; defaults to page name slugified
GitHub
Repo / branch names
Hyphens preferred; underscores also common for repos

Common slug mistakes to avoid

Mistakes that hurt SEO
  • Using query parameters instead of clean slugs (?id=123)
  • Keeping stop words that dilute keyword signals
  • Changing slugs after indexing without 301 redirects
  • Duplicate slugs causing content conflicts
Good slug habits
  • Include the primary keyword near the start of the slug
  • Keep slugs stable — avoid unnecessary renaming
  • Use hyphens consistently across your entire site
  • Preview slugs before publishing to catch issues early

Related text tools

Once you have your slug, these tools help you with the next steps in writing and publishing workflow:

FAQ

Common questions

What is a URL slug?

A URL slug is the part of a web address that identifies a specific page in a human-readable form. In "https://example.com/blog/how-to-bake-bread", the slug is "how-to-bake-bread". Slugs replace spaces with hyphens, remove special characters, and use lowercase letters so URLs are clean, shareable, and optimized for search engines.

How does the slug converter handle accented characters?

Accented characters like é, ñ, ü, and ø are transliterated to their closest ASCII equivalents (e, n, u, o) using Unicode normalization (NFD decomposition). This ensures slugs remain URL-safe without percent-encoding, which keeps links clean and readable across all browsers and platforms.

Should I use hyphens or underscores in URL slugs?

Use hyphens. Google officially recommends hyphens as word separators in URLs. Underscores cause Google to treat connected words as a single unit — "my_page" is read as one keyword "mypage", while "my-page" is read as two separate keywords "my" and "page". Hyphens also improve readability for human visitors.

Does slug length affect SEO?

Yes, but the guideline is to keep slugs concise and descriptive rather than long. Remove stop words like "a", "the", "and", "of" from slugs when possible. Most SEO guides recommend keeping slugs under 5–7 words. Google truncates long URLs in search results, so a clear, keyword-rich slug is better than a verbose one.

Can I use numbers in URL slugs?

Yes, numbers are fully valid in slugs. They are commonly used for years ("2024-seo-guide"), versions ("python-3-tutorial"), or listicles ("10-best-practices"). Numbers are preserved exactly as-is by this converter.

What happens to symbols like @, #, and & in slugs?

Most special characters and symbols are stripped from slugs because they are either reserved in URLs (# starts a fragment, & separates parameters) or require percent-encoding which makes URLs ugly. Exceptions: hyphens and underscores used as separators are preserved or standardized based on your chosen separator setting.

Should slugs always be lowercase?

Yes. URLs are technically case-sensitive on most servers, meaning /Blog/Post and /blog/post could be two different pages, causing duplicate content issues. Always use lowercase slugs and set up redirects to enforce them. This converter lowercases everything by default.

What is the difference between a slug and a permalink?

A slug is just the text identifier portion of a URL (e.g., "my-article-title"), while a permalink (permanent link) is the complete URL structure including the domain and path (e.g., "https://example.com/blog/my-article-title"). The slug is one component of the permalink.

Can I change a slug after publishing without hurting SEO?

Changing a published slug can hurt SEO if you do not set up a 301 redirect from the old URL to the new one. Without a redirect, any backlinks and search rankings pointing to the old URL are lost. If you must change a slug, always implement a permanent redirect and update internal links.

More in Text & Writing