What is Text to Slug?

Text to Slug converts any title or text into a URL-friendly slug. It lowercases text, swaps spaces and special characters for hyphens, and strips accents. Use it for blog post URLs, file names, or API endpoints.

The slug becomes the human-readable part of a URL: /blog/how-to-build-a-rest-api. The tool lowercases everything, replaces accents with their ASCII equivalent (café becomes cafe), turns spaces and punctuation into a single separator, and can cap the length so the URL stays compact. Bulk mode processes a full list of titles at once.

How to use

  1. Type or paste a title, heading, or any text you want to convert into a URL slug.
  2. Choose the separator character (hyphen, underscore, or period) and set a maximum length if needed.
  3. Copy the generated slug to use in your CMS, URL structure, or file naming convention. Multiple texts can be converted at once.

When to use

  • Generating blog or article URLs from post titles before publishing in a CMS.
  • Creating filesystem-safe filenames from arbitrary user input or document titles.
  • Building React Router or Next.js dynamic segments like /products/[slug] from product names.

Result

Your blog post is titled 'How to Build a REST API with Node.js & Express (2024 Guide)'. The tool generates 'how-to-build-a-rest-api-with-node-js-and-express-2024-guide', ready to drop into any URL.

FAQ

Should I use hyphens or underscores as the separator?
Hyphens are the standard for URLs — Google has long treated them as word separators, while underscores are read as part of the word. Stick with hyphens for SEO, and only switch to underscores for filenames where hyphens conflict with tooling.
Why does the slug strip accents from words like résumé?
Older systems and many URL routers handle plain ASCII more reliably than percent-encoded UTF-8. Stripping accents turns résumé into resume so links remain copy-pastable. Turn the option off if your stack supports IRIs and you want to preserve the original spelling.
What happens to the slug if my title is very long?
If you set a max length, the slug is cut and trimmed back to the last full word before the limit so you don't end up with half a word at the end. Without a limit the full slug is returned, even if it's 200+ characters.
How does bulk mode treat the input?
Each line becomes its own slug. Paste a list of 50 article titles and you'll get 50 corresponding slugs on the same lines — ready to drop into a CSV column for batch imports, redirects, or sitemap updates.
Is the resulting slug guaranteed to be unique?
No. Two different titles can collapse to the same slug ("REST API" and "REST-API" both become rest-api). Your CMS or database needs a uniqueness check; the usual fix is to append -2, -3 etc. when a collision is detected.

Related Tools