Herramientas Guías
Developer Gratis Sin registro

Text to URL Slug Converter

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

Cargando la herramienta…

Acerca de esta herramienta

Turn titles, headings, or any text into SEO-friendly URL slugs. Options include lowercase conversion, separator choice (hyphen, underscore, dot), accent/diacritic removal (é→e, ü→u, ñ→n), special character stripping, max-length truncation, and title-case slug mode. Results update live as you type with a one-click copy button.

Cómo usar

  1. 1 Type or paste your text in the input field.
  2. 2 Choose your separator and toggle options like lowercase, accent removal, and max length.
  3. 3 The slug preview updates live as you type.
  4. 4 Click 'Copy' to copy the generated slug to your clipboard.

What a slug is and why it matters

A slug is the human-readable part of a URL that identifies a specific page — the my-first-post in example.com/blog/my-first-post. It needs to be safe to put in a web address, which means no spaces, no accented letters, no punctuation that browsers or servers might mangle, and ideally all lowercase. This tool takes any title or sentence and runs it through a predictable pipeline to produce exactly that: a clean, lowercase, hyphen-separated string. It updates live as you type, so you see the result form character by character.

Slugs matter for two reasons. Search engines treat words in the URL as a mild ranking signal and display them in results, so a descriptive slug like best-running-shoes-2024 reads better than ?id=4712. And clean URLs are easier to share, remember, and trust — people are wary of links full of cryptic codes.

How the conversion pipeline works

The tool transforms your text through an ordered series of steps, and the order is what makes the output reliable:

  1. Transliterate accents (optional, on by default). Each accented character is mapped to a plain ASCII equivalent using a built-in table — é→e, ü→u, ñ→n, and even ligatures like æ→ae and ß→ss. This is a direct character map, not Unicode normalization, so the results are explicit and consistent.
  2. Lowercase (optional, on by default), or apply Title Case if you choose that mode instead.
  3. Replace whitespace with your chosen separator — hyphen, underscore, or dot.
  4. Strip everything else. Any character that isn't a letter, a digit, or the separator is removed entirely. This is what kills apostrophes, exclamation marks, and emoji.
  5. Collapse and trim. Runs of repeated separators become one, and any separator at the very start or end is removed.
  6. Truncate to your max length if set, then trim a trailing separator so the slug never ends on a dangling hyphen.

A worked example

Type Café au Lait — 50% Off! with the default settings (lowercase on, accents on, hyphen separator). Here's what happens at each stage: the é becomes e giving Cafe au Lait — 50% Off!; lowercasing yields cafe au lait — 50% off!; spaces become hyphens, producing cafe-au-lait-—-50%-off!; then the em dash, percent sign, and exclamation mark are stripped because they aren't letters, digits, or hyphens, leaving cafe-au-lait--50-off; collapsing the double hyphen gives the final result: cafe-au-lait-50-off. Notice the digits in 50 survive — numbers are always preserved.

Choosing a separator

SeparatorBest forNotes
Hyphen (-)Web URLs and SEOThe standard. Google treats hyphens as word boundaries.
Underscore (_)Filenames, code identifiersSearch engines may read two_words as one token, so avoid for SEO slugs.
Dot (.)Some package or version namesRarely used in page URLs; reserved feel.

For anything that will live in a public web address, the hyphen is almost always the right call — it's both the convention and the SEO-friendly choice.

Common use cases

  • Blog and CMS URLs generated from a post title before publishing.
  • Documentation anchors where a heading needs a stable #fragment link.
  • File and asset names derived from a human label, stripped of spaces and accents.
  • Database keys or API identifiers that must be URL- and shell-safe.
  • Product or category handles in e-commerce platforms.

Tips and common mistakes

  • Keep slugs short and meaningful. Use the max-length field to cap long titles; the tool trims any trailing hyphen so you never get an ugly cut-off. Two to five descriptive words is the sweet spot.
  • Don't change a published slug casually. Editing a live URL breaks every existing link and bookmark unless you set up a redirect. Decide on the slug before you publish.
  • Mind non-Latin scripts. The accent map covers Western European diacritics; it does not transliterate Cyrillic, Greek, Arabic, or CJK characters, which will simply be stripped. For those, write the slug manually or in romanized form.
  • Title-case mode is rarely right for URLs. Most servers treat URLs as case-sensitive, and mixed-case slugs invite duplicate-content confusion. Leave lowercase on unless you have a specific reason.
  • Numbers survive, symbols don't. If a "50%" needs to read as "50-percent" in the slug, spell it out in your input first — the tool removes the % rather than translating it.

Preguntas frecuentes

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}