Ttooleras
🔗

Text to Slug Converter

Text Tools

Convert titles to URL-friendly slugs — SEO-ready, handles Unicode and accents. Free, private — all processing in your browser.

Examples — click to try
Advertisement

The Text to Slug tool converts titles, headings, and any text into URL-friendly slugs — lowercase, hyphen-separated, ASCII-only strings safe for URLs, file names, and identifiers. Handles tricky cases: accented characters (cafécafe), Unicode transliteration (北京beijing), punctuation removal, whitespace collapse, and length limits. Customizable: separator character (- default, _ for SQL-friendly), case (lowercase default, uppercase option), Unicode handling (transliterate, strip, or preserve).

Good URL slugs are critical for SEO and UX. /blog/how-to-set-up-docker-for-nodejs-apps is readable, shareable, memorable, and includes keywords. /blog/post-123 is none of those. Every CMS (WordPress, Jekyll, Hugo, Ghost, Contentful) uses slugs for post URLs. Modern frameworks (Next.js, Remix) use them for routing. This converter handles all the edge cases — making slugs from complex titles in any language instantly.

Text to Slug Converter — key features

Unicode transliteration

Handles accented Latin, Cyrillic, Greek, Arabic, CJK. Converts to ASCII slug.

Custom separator

Hyphen (default, SEO-preferred), underscore, or custom character.

Case options

Lowercase (default), uppercase, or preserve original case.

Diacritic stripping

Automatically strips accents (é → e, ñ → n). Preserves meaning while making ASCII-safe.

Length limits

Truncate long slugs at word boundaries. Configurable max length (default 80 chars).

Character whitelist

Specify additional characters to preserve. Useful for language-specific needs.

Batch conversion

Paste multiple titles, one per line. Get slugs for all at once.

Preview live

Slug updates as you type. See the result instantly.

How to use the Text to Slug Converter

  1. 1

    Paste title or text

    Article title, blog post heading, file name, any text to slugify.

  2. 2

    Choose separator

    Hyphen (-) for URLs (SEO standard). Underscore (_) for SQL or filenames.

  3. 3

    Set options

    Transliterate non-Latin? Strip accents? Preserve case? Max length?

  4. 4

    Copy the slug

    Resulting slug is ready to use in your URL, file name, database column, or API identifier.

Common use cases for the Text to Slug Converter

Content management

  • Blog post URLs: Convert blog titles to permalinks. 10 Best JavaScript Libraries 2026 → /blog/10-best-javascript-libraries-2026.
  • WordPress / Ghost / Medium: These CMSs generate slugs automatically but sometimes produce bad results. Override with a clean manual slug.
  • E-commerce product URLs: Product titles to clean URLs. Wireless Noise-Cancelling Headphones Pro X → /products/wireless-noise-cancelling-headphones-pro-x.
  • Category and tag URLs: Category names to slugs: Web Development, Tutorials → /categories/web-development-tutorials.

Developers

  • Database primary keys: Human-readable ID columns in URLs (instead of UUID). Pair with incrementing integer for uniqueness.
  • File naming: Upload user-provided file names safely. cv final v3 (real).pdf → cv-final-v3-real.pdf.
  • Cache keys: Predictable, human-readable cache keys.
  • Kubernetes resource names: K8s resource names must be lowercase, hyphen-separated, under 63 chars. Slugify matches.

SEO

  • Keyword-rich URLs: URLs with keywords rank slightly better. /how-to-learn-python-in-2026 beats /post/12345.
  • Memorable, shareable URLs: Clean slugs are easier to remember and share verbally.
  • Meaningful URL structure: Site hierarchy visible in URLs: /category/subcategory/post-title.

International sites

  • Multilingual content: Each language version has its own slug. Transliterate for readability in URLs.
  • Non-Latin URLs: Option to preserve Unicode in URLs (modern browsers support IDN). Some markets prefer native-script URLs.
  • ASCII-safe for global users: Transliterate to ASCII for maximum compatibility — URLs work everywhere.

Text to Slug Converter — examples

Simple blog title

English title with spaces.

Input
10 Best JavaScript Libraries for 2026
Output
10-best-javascript-libraries-for-2026

Accented characters

French text with accents.

Input
Où acheter le meilleur café à Paris
Output
ou-acheter-le-meilleur-cafe-a-paris

Special characters removed

Punctuation stripped.

Input
What's New in JavaScript? (ES2026 Features!)
Output
whats-new-in-javascript-es2026-features

Cyrillic transliteration

Russian text to ASCII.

Input
Путеводитель по Москве
Output
putevoditel-po-moskve

Chinese transliteration

Using Pinyin.

Input
北京旅游指南
Output
beijing-lvyou-zhinan

Length limit

Truncate long titles.

Input
A Very Very Very Very Long Blog Post Title That Goes on and on and on and Never Ends
Max length: 50
Output
a-very-very-very-very-long-blog-post-title-that

Underscore separator

For SQL column or legacy system.

Input
user_first_name style
Input: User First Name
Output
user_first_name

Emoji and special

Removed entirely.

Input
🚀 Launch Day 2026! 🎉
Output
launch-day-2026

Technical details

Slug generation involves several transformations:

Standard process:

1. Unicode normalization (NFKD for separating base + diacritics)
2. Strip diacritics (é → e, ñ → n)
3. Transliterate non-Latin (optional: 北京 → beijing, Москва → moskva)
4. Lowercase
5. Replace non-alphanumeric with separator
6. Collapse consecutive separators
7. Trim leading/trailing separators
8. Optionally limit length

Handling different character sets:

Latin with accents:
- cafécafe (strip diacritics)
- naïvenaive
- jalapeñojalapeno
- Zürichzurich

Cyrillic:
- Москваmoskva (transliteration)
- Санкт-Петербургsankt-peterburg

Greek:
- Αθήναathina (transliteration)

CJK (Chinese/Japanese/Korean):
- No clean romanization — options:
- Transliterate with Pinyin/Hepburn: 北京beijing, 東京tokyo
- Leave as Unicode in URL (modern approach, supports IDN)
- Use English alternative if provided

Arabic:
- القاهرةal-qahirah (transliteration)

Special characters:
- Spaces → separator
- &and (common convention), or separator
- Emoji → removed (URLs with emoji are unreliable)
- Quotes, apostrophes → removed
- Slashes, question marks, hashes → removed (URL special chars)
- Underscores: controversial — some keep, some replace with hyphen

Edge cases:

- Empty result: if input is all non-ASCII (all emoji or unknown chars), result is empty. Handle with fallback: post-{id}.
- Duplicate slugs: two posts with same title produce same slug. Most CMSs add suffix: my-post-2.
- Length limits: URLs should be under 2,000 chars. Slugs under ~80 chars. Truncate with care (do not cut words mid-way).
- Reserved words: admin, api, static, robots.txt — some CMSs reject these.

Separator conventions:

- Hyphen (-) — universal choice, readable, Google-preferred. Use this.
- Underscore (_) — works but less common for URLs. Google treats hyphen as word separator; underscore as word joiner. Hyphen for SEO.
- Plus (+) — legacy form-encoded style. Avoid.

SEO implications:

Google treats hyphens in URLs as spaces (my-new-postmy new post). Helps keyword matching in URLs. Use hyphens, not underscores, for SEO.

URL-safe characters per RFC 3986:

Unreserved: A-Z, a-z, 0-9, -, _, ., ~.
Reserved (need encoding): /, ?, #, &, everything else.

A proper slug uses only unreserved characters — never needs URL encoding.

Common problems and solutions

Duplicate slugs

Two posts with same title produce same slug — collides in database. Most CMSs append a number: my-post, my-post-2. Handle at application layer when saving.

Empty slug from all non-ASCII

Input like 🎉✨ or pure emoji produces empty slug. Have a fallback: post-{id} or date-{YYYY-MM-DD}.

Length exceeds URL limits

Extremely long slugs (500+ chars) cause issues. Modern URLs limit around 2,000 chars total, slugs should be under 80-100 for readability.

SEO penalty for keyword stuffing

Do not stuff keywords into slugs: best-cheapest-fast-durable-wireless-noise-cancelling-headphones-deal. Keep slugs natural, 3-8 words max.

Breaking changes to existing slugs

Changing a post's slug breaks existing links and SEO. Set up 301 redirects from old to new slug. Or keep old slug, add new as alias.

Language-specific transliteration

Pinyin for Chinese, Hepburn for Japanese, different schemes exist. Pick one standard and use consistently. User-confusing otherwise.

Reserved words

Some CMSs reject slugs like admin, api, feed, rss, robots-txt. Check your platform's reserved list before deploying.

Case sensitivity issues

Modern URLs are treated as case-sensitive (My-Post ≠ my-post). Always lowercase slugs to avoid ambiguity. Same slug stored in different cases = duplicate content.

Text to Slug Converter — comparisons and alternatives

Slug vs URL encoding: Slug is clean, human-readable (my-post-title). URL encoding escapes special chars as %20, %26 (my%20post%20title). Slugs better for SEO and UX; encoding only for runtime values.

Hyphen vs underscore: Google treats hyphens as word separators, underscores as word joiners. my-page = my page to Google; my_page = my_page. Use hyphens for SEO URLs.

ASCII-only vs Unicode URLs: ASCII (my-page) is universally supported. Unicode (my-página) works in modern browsers (IDN) but has compatibility issues with some tools, email clients, analytics. ASCII is safer.

Slug vs SEO keyword URL: Slug: straightforward representation of title. SEO-optimized URL: includes target keywords, may not match title exactly. Both valid; depend on SEO strategy.

Auto-generated vs manual slugs: Auto-generated (WordPress default) often good but may include stopwords (the, a) or be too long. Manual slugs are shorter and keyword-focused. Good editors review and customize before publishing.

Truncation strategies: Simple truncate at N chars may cut words. Better: truncate at last complete word under limit. Smart truncation preserves meaning.

Frequently asked questions about the Text to Slug Converter

What is a URL slug?

A slug is the human-readable, URL-friendly version of a title. 10 Best JavaScript Libraries for 2026 becomes 10-best-javascript-libraries-for-2026 — lowercase, hyphen-separated, ASCII characters only. Used in URLs, file names, database identifiers, and anywhere you need a clean identifier from free-form text.

Why use hyphens instead of underscores?

Google treats hyphens as word separators in URLs, which helps keyword matching (/my-new-post matches query my new post). Underscores are treated as word joiners (my_new_post is one word to Google). For SEO, always use hyphens in URL slugs.

What characters should I avoid in slugs?

Avoid: spaces (use hyphen instead), special characters (&, %, #, ?, /), punctuation (commas, periods, apostrophes), and emoji. Only keep: lowercase letters, numbers, hyphens, and possibly underscores. RFC 3986 unreserved characters: A-Z, a-z, 0-9, -, _, ., ~.

How do I handle non-English characters?

Two approaches: (1) Transliterate to ASCIIcafécafe, 北京beijing. Universal compatibility. (2) Preserve Unicode — modern browsers support IDN (Internationalized Domain Names). May not work in all tools, email clients, or analytics. ASCII is safer.

What should I do with duplicate slugs?

Two posts with same title will generate same slug. Standard solution: append a number (my-post-2). Most CMSs do this automatically. Or add post ID: my-post-123. Design a uniqueness strategy in your database.

How long should slugs be?

3-8 words is ideal — long enough to be descriptive, short enough to be memorable. Under 80 characters. Very long slugs (100+ chars) hurt readability and shareability. Strip stopwords (a, the, of) if needed to shorten.

Can I change an existing slug?

Yes, but add redirects. Changing a published slug breaks all existing links and external references. Set up 301 permanent redirect from old URL to new URL. Most CMSs handle this; manual for custom sites.

Is my text safe to convert?

Yes. Slug generation runs entirely in your browser. Text never uploads. Safe for confidential content (draft blog titles, internal document names, etc.).

Should slugs include stopwords?

Depends on length. /the-best-laptop-for-programmers is fine if you have room. For brevity, strip stopwords: /best-laptop-programmers. Matters more for URLs longer than 50 chars. SEO impact is minor either way.

What about slugs for database IDs?

Slugs + IDs together is a common pattern: /blog/123/my-post-title. Numeric ID guarantees uniqueness and fast lookup; slug helps SEO and readability. URL routing parses the ID for the query.

Additional resources

Advertisement

Related tools

All Text Tools

Learn more

Explore more tools

200+ free tools that run in your browser.

Browse all tools →