Text to Slug Converter
Convert any text into a clean, URL-friendly slug.
Related Tools
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.