Text to Slug Converter

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

About This Tool

Converts arbitrary text into a URL-safe slug: lowercased, with whitespace replaced by hyphens, accented characters folded to ASCII (NFD normalization + diacritic stripping), and non-alphanumeric characters removed.

Supports custom separator (- or _), optional truncation to a max length, and Unicode-aware modes that preserve non-Latin scripts.

Slug generation is a multi-step text normalization pipeline. The standard sequence is: (1) lowercase via String.prototype.toLowerCase (or toLocaleLowerCase for locale-sensitive cases like Turkish dotless i), (2) Unicode NFD normalization to decompose combined characters into base + combining mark, (3) strip combining marks via regex matching the Unicode 'Mn' (Mark, Non-spacing) category, (4) replace remaining non-alphanumeric with the chosen separator, (5) collapse consecutive separators, and (6) trim leading/trailing separators. The result is ASCII-only by default, with the optional Unicode-preserving mode skipping steps 2-3 in favor of preserving the original characters.

A worked example: the input 'Crème Brûlée: A Classic French Dessert!' processes as follows. Lowercase: 'crème brûlée: a classic french dessert!'. NFD normalization: 'cre\u0300me bru\u0302le\u0301e: a classic french dessert!' (with combining marks shown explicitly). Strip combining marks: 'creme brulee: a classic french dessert!'. Replace non-alphanumeric with hyphen: 'creme-brulee--a-classic-french-dessert-'. Collapse consecutive hyphens and trim: 'creme-brulee-a-classic-french-dessert'. Each step has a specific purpose; skipping any one produces visibly broken output.

Limitations and SEO considerations are mostly about length and character handling. Google's John Mueller has stated that URL slug length doesn't directly affect ranking, but slugs over 60-80 characters become awkward in citations, social shares, and display contexts. Truncation at word boundaries (preferring to cut at a hyphen rather than mid-word) preserves readability. Hyphens vs underscores: Google's documentation explicitly recommends hyphens, which it treats as word separators. Underscores are treated as word-joiners (matching 'foo_bar' as a single token in search), which is rarely what slug authors intend.

Non-Latin scripts present a real choice. Modern browsers and search engines support Unicode in URLs (RFC 3987 IRI), and Cyrillic, CJK, Arabic, and Devanagari slugs work in most contexts. They transmit as percent-encoded UTF-8, expanding the wire-level URL significantly (each CJK character becomes 9 ASCII characters when percent-encoded). For maximum portability across older systems, downstream tools, and email clients that may mangle Unicode URLs, ASCII-only slugs remain the safer default. Transliteration (converting non-Latin scripts to romanized equivalents like 'привет' → 'privet') is a third option that preserves some semantic meaning while staying ASCII; the tool offers basic transliteration for common scripts but is not a substitute for proper internationalization work.

The about text and FAQ on this page were drafted with AI assistance and reviewed by a member of the Coherence Daddy team before publishing. See our Content Policy for editorial standards.

Frequently Asked Questions

How are accented characters handled?
Default behavior decomposes them via NFD normalization, then strips combining marks. "Café" becomes "cafe". A toggle preserves the original characters for sites that support full Unicode in URLs.
Is there a maximum length?
URLs technically support up to 2048 characters total, but slugs over 60–80 characters become awkward. The tool offers a configurable cap with smart trimming at word boundaries to avoid mid-word cuts.
Should slugs use hyphens or underscores?
Google explicitly recommends hyphens, treating them as word separators while underscores join words. For SEO, hyphens are the consensus default.
What about non-Latin scripts?
Modern browsers support Unicode in URLs, and IDN handles domains. For paths, Cyrillic or CJK slugs work but transit as percent-encoded UTF-8. Stripping to Latin-only ASCII is more portable but loses semantic meaning.
Does the tool preserve numbers?
Yes. Digits 0–9 are kept. Only spaces and special characters are transformed. "Top 10 Tools for 2026" becomes "top-10-tools-for-2026".
How do I handle stop words?
Optionally remove common English stop words (a, an, the, of, in, on, etc.) for shorter slugs. 'The Best Way to Bake a Cake' becomes 'best-way-bake-cake'. Stop word removal hurts readability for some audiences and helps for others; toggle as appropriate.
Why does my slug have trailing hyphens?
Likely because the original ended with punctuation that converted to a hyphen. The standard pipeline trims trailing separators after collapse; if your output has them, the trim step may be skipped or applied before the collapse.
Should slugs be unique?
Within a site, yes; URL conflicts produce 404s or unintended redirects. Database-backed CMSes typically append a counter ('article-slug-2', 'article-slug-3') for repeats. Generated slugs should be checked against existing URLs before being committed as canonical.
Can slugs include date components?
Yes. Date-prefixed slugs ('2026-05-blog-post-title') sort chronologically in URL listings and aid SEO when freshness matters. Date-suffixed slugs ('blog-post-title-2026') tag the year for archival reading. Pure title slugs are cleaner but lose temporal context. Pick a convention site-wide rather than mixing.