Text To Slug
Type or paste a title and instantly get a clean, URL-safe slug. Pick a hyphen or underscore separator, strip accents, keep the case, or cap the length — then copy the result with one tap. Everything runs in your browser; nothing is uploaded.
What is the Text To Slug?
The Text To Slug tool turns any title, headline, or sentence into a clean,
URL-safe slug — the short, readable string that identifies a page in its
address, like getting-started in
example.com/docs/getting-started. It lowercases the text, swaps
spaces and punctuation for a single separator, and strips out everything a
browser or content management system would choke on. The result is a tidy slug
you can paste straight into a blog post, a route, or a file name.
How to use it
- Type or paste your title into the input box.
- Read the slug below — it updates live as you type.
- Adjust the options if you need to: pick a hyphen or underscore separator, turn accent stripping on or off, keep the original case, or set a maximum length.
- Tap Copy to grab the slug. Answer in one second, then get back to writing.
The method behind it
The tool builds the slug deterministically, in a fixed order, so the output is
always predictable. First, if Strip accents is on, it decomposes the text using
Unicode NFKD normalization and removes the combining diacritical marks, so
é becomes e and ü becomes u.
Next it lowercases the text unless you chose to keep the case. Then it replaces
every run of characters that is not a letter or a digit with a single separator,
collapsing multiple spaces, commas, and symbols into one clean break. Finally it
trims any separator from the start and end, and if you set a maximum length it
truncates and trims again so the slug never ends on a dangling dash. Letters and
digits are matched with Unicode-aware rules, so non-Latin scripts are preserved
rather than wiped out.
Examples
Hello, World!becomeshello-world.Crème Brûlée Recipebecomescreme-brulee-recipewith accent stripping on.10 Tips for 2026 — Part #2becomes10-tips-for-2026-part-2.- With the underscore separator,
My Draft Titlebecomesmy_draft_title.
Common use cases
- Generating blog post and article URLs that are short and readable.
- Naming files, folders, and image assets without spaces or special characters.
- Building route paths and anchor IDs in web apps.
- Cleaning up a page title before pasting it into a CMS like WordPress, Ghost, or a static site generator.
- Creating consistent handles for tags, categories, and product pages.
Why use this one
Most slug generators give you a single fixed format. This one puts the choices in your hands: hyphen or underscore, keep or strip accents, preserve case, and cap the length — all updating live with a one-tap copy. The accent transliteration means an accented word stays readable instead of vanishing, which matters for international titles. And because everything runs in your browser, your unpublished titles and private drafts never touch a server.
It pairs naturally with its text-toolkit siblings. Reach for the URL Encoder / Decoder when a value needs percent-encoding instead of a slug, the Case Converter to switch a title between sentence, title, and upper case before slugging it, or the Lorem Ipsum Generator to mock up placeholder titles while you design a page.
Frequently asked questions
What is a URL slug?
A slug is the human-readable part of a URL that identifies a page, usually built from its title — for example the my-first-post in example.com/blog/my-first-post. A good slug is lowercase, uses hyphens between words, and contains no spaces, accents, or punctuation.
Should a slug use hyphens or underscores?
Google recommends hyphens to separate words in URLs because it treats a hyphen as a word boundary, while an underscore joins words together. Hyphens are the safe default for SEO; underscores are mainly useful for file names or code identifiers. This tool lets you pick either.
What happens to accented characters like e-acute or u-umlaut?
With Strip accents on, the tool transliterates them to their base Latin letter, so cafe-creme and uber stay readable instead of being deleted. Turn the option off to keep the original accented letters in the slug.
Is my text sent to a server?
No. The slug is generated locally in your browser with JavaScript. Nothing you type is uploaded, logged, or stored, so it is safe for unpublished titles and private drafts.