Oh MyUtils

URL Slug Generator - Create SEO-Friendly URLs Online

Convert titles and text into clean, SEO-friendly URL slugs. Supports transliteration, stop word removal, and custom separators.

Mode
Separator
Settings
Max Length
0 = unlimited
Input Text
Generated Slug
URL Preview
...

Frequently Asked Questions

What is a URL slug generator?

A URL slug generator converts text, titles, or headings into URL-friendly strings called slugs. A slug is the part of a URL after the domain name that identifies a page in a human-readable format. For example, 'How to Build a Website in 2026' becomes 'how-to-build-a-website-in-2026'. Slugs use only lowercase letters, numbers, and hyphens.

How do I use this URL slug generator?

Type or paste any text into the input field. The tool instantly generates a URL-friendly slug in real-time. You can customize the output by selecting a separator, enabling transliteration, toggling stop word removal, or setting a maximum slug length. For batch processing, switch to Bulk mode and enter one title per line.

Is my text data safe?

All text processing is performed 100% client-side in your browser using JavaScript. No text is transmitted to any server. The tool works entirely within your browser, making it safe for converting proprietary product names, internal documentation titles, and confidential content.

Should I use hyphens or underscores in URL slugs?

Google officially recommends using hyphens (-) instead of underscores (_) to separate words in URLs. Google treats hyphens as word separators, meaning 'web-development' is interpreted as 'web development'. Underscores are not treated as separators — 'web_development' is treated as a single word.

What is transliteration and why is it important?

Transliteration converts accented characters into their closest ASCII equivalents. For example, 'café' becomes 'cafe', 'München' becomes 'muenchen'. This is important because URLs should contain only ASCII characters for maximum compatibility. Without transliteration, accented characters are percent-encoded, making URLs long and hard to read.

What are stop words and should I remove them?

Stop words are common, low-value words like 'a', 'the', 'is', 'and'. Removing them can make URLs shorter and more keyword-focused. For example, 'how-to-build-a-website' becomes 'build-website'. However, removal is not always desirable as it may affect readability or meaning.

How long should a URL slug be?

There is no strict limit, but shorter slugs perform better for SEO and user experience. A good rule of thumb is 3-5 keywords, typically 30-60 characters. This tool provides a max length option that truncates at word boundaries, so you never end up with a slug cut mid-word.

Code Examples

// URL Slug Generator
function generateSlug(input, separator = '-') {
  return input
    .trim()
    .normalize('NFD')
    .replace(/[\u0300-\u036f]/g, '')
    .toLowerCase()
    .replace(/[^a-z0-9\s]/g, '')
    .replace(/\s+/g, separator)
    .replace(new RegExp(`${separator}+`, 'g'), separator)
    .replace(new RegExp(`^${separator}|${separator}$`, 'g'), '');
}

console.log(generateSlug('How to Build a Website in 2026!'));
// Output: how-to-build-a-website-in-2026

console.log(generateSlug('Café de Paris - Menu & Réservations'));
// Output: cafe-de-paris-menu-reservations

Related Tools