All tools

Slug Generator & URL Sanitizer

Convert titles and messy text into clean, SEO-friendly URL slugs with accent normalization, emoji stripping, and bulk generation.

Options

Separator

Max slug length

All slug generation runs locally in your browser. No text is uploaded or stored.

Slug will appear here…

All slug generation, normalization, and export happen entirely in your browser. No text, titles, or filenames are sent to CodeAva servers. The tool is safe to use with draft content, internal product names, and unreleased page titles.

What a slug is and why clean URLs matter

A slug is the human-readable part of a URL that identifies a specific page. In https://example.com/blog/my-article-title, the slug is my-article-title. Clean slugs are lowercase, use hyphens to separate words, contain only alphanumeric characters, and avoid special symbols, emojis, and repeated separators. They make URLs readable to humans, predictable for developers, and consistent for systems that handle routing, caching, and indexing.

Clean URLs matter for both readability and maintainability. A URL like /products/caf%C3%A9-menu-%F0%9F%8D%95 is harder to share, harder to type, and more likely to break in copy-paste workflows than /products/cafe-menu. Percent-encoded characters in URLs also complicate analytics, logging, redirect rules, and canonical management. Normalized slugs reduce these problems consistently.

Automated sanitization helps both publishers and developers because manual slug creation is error-prone at scale. Content teams pasting titles from spreadsheets, developers generating routes from database records, and marketers creating campaign URLs all benefit from a consistent, reliable slugification pipeline that handles accents, emojis, punctuation, and edge cases the same way every time.

Why should I use hyphens instead of underscores in URLs?

Hyphens have been the conventional word separator in web URLs since the early web and remain the standard for user-facing paths. They separate words clearly without the visual ambiguity of underscores, which can be hidden by underline styling in some hyperlink renderings. For SEO and readability, a lowercase hyphen-separated slug is the safest and most widely compatible default. Underscores are a reasonable choice for filenames, Python modules, and database identifiers — contexts where hyphens may be interpreted as subtraction operators — but they are not the recommended format for browser-facing URLs.

Good vs bad URL slug examples

Original titleUnsanitized / poor URLClean slug
New Café Menu! ☕New-Café-Menu!-☕new-cafe-menu
What is an API?What_is_an_API?what-is-an-api
File: User DataFile:-User-Datafile-user-data
Wait, what? 10 Ways to Build a SaaS in 2026! 🚀Wait,-what?-10-Ways-to-Build-a-SaaS-in-2026!-🚀10-ways-to-build-a-saas-in-2026

JavaScript slugify snippet for developers

For programmatic use in Node.js, Next.js, or the browser, this function covers the core cases: diacritic normalization, symbol removal, and hyphen collapsing. The built-in tool is more convenient for bulk workflows and edge-case cleanup.

function createSlug(text) {
  return text
    .toString()
    .normalize('NFD')                    // decompose accented chars
    .replace(/[\u0300-\u036f]/g, '')    // strip combining diacritics
    .toLowerCase()
    .trim()
    .replace(/[^a-z0-9 -]/g, '')        // keep alphanum, spaces, hyphens
    .replace(/\s+/g, '-')               // spaces to hyphens
    .replace(/-+/g, '-')                // collapse repeated hyphens
    .replace(/^-+|-+$/g, '');           // trim leading/trailing hyphens
}

// Examples:
createSlug('New Café Menu! ☕');
// → 'new-cafe-menu'

createSlug('Wait, what? 10 Ways to Build a SaaS in 2026! 🚀');
// → 'wait-what-10-ways-to-build-a-saas-in-2026'

This snippet does not handle emoji removal, stop-word stripping, or max-length truncation — the tool above handles all of these automatically.

What this tool helps with

Good uses

  • Converting blog titles into CMS URL slugspaste a post title and get a clean slug to use as the URL path in WordPress, Contentful, Sanity, or any other CMS — without manual editing.
  • Cleaning product and category URLs for e-commercenormalize accented brand or product names, strip punctuation, and generate consistent path segments for product catalogues.
  • Sanitizing filenames or path segmentsconvert uploaded file names, heading text, or user-generated labels into safe, filesystem-compatible path components.
  • Bulk-generating slugs from spreadsheet title listspaste a full column of post titles in Bulk mode, review the slug table, and download as CSV to paste back into your spreadsheet — ready for import.
  • Normalizing multilingual text into ASCII-friendly outputaccented characters from French, Spanish, German, Portuguese, and other Latin-script languages are automatically normalized to ASCII equivalents.
  • Removing punctuation, emojis, and unsafe URL charactersthe sanitization pipeline handles the full range of common title punctuation, symbols, and emoji in one pass without manual find-and-replace.

Limitations to know

  • Generating non-ASCII slugs for international URLsthis tool targets ASCII-safe slugs. If you need to preserve native-script characters in URLs (e.g. Arabic, Chinese, Japanese), you will need a separate approach for IRI-compliant paths.
  • Using stop-word removal when clarity mattersremoving stop words can produce slugs that are harder to read. A title like 'The Art of War' becomes 'art-war' — shorter, but potentially less clear. Review the output before publishing.
  • Assuming slugs never need redirects after creationonce a slug is live and indexed, changing it requires a 301 redirect. Use this tool to get the slug right before publishing, not after.

How to generate and use URL slugs

  1. 1

    Paste your title or list of titles

    Use Single mode for one-at-a-time conversion or Bulk mode for pasting a list of titles, one per line. Bulk mode is ideal for converting a spreadsheet column into slugs.

  2. 2

    Choose separator, stop words, and max length

    Hyphen is the default and recommended separator for web URLs. Enable stop-word removal for shorter slugs, and review the output to ensure it stays readable. Set a max length if your CMS enforces a limit.

  3. 3

    Review the live output and audit messages

    The slug updates in real time. Audit messages confirm how many characters were normalized or removed, and flag any slugs that are empty or unusually long.

  4. 4

    Copy or download the results

    Copy the single slug, or in Bulk mode copy all slugs, copy as CSV with original titles, or download as .txt or .csv. The CSV format pastes directly back into Google Sheets or Excel.

  5. 5

    Paste the slug into your CMS or router

    Use the slug as the URL path in your CMS, Next.js dynamic route, sitemap, or redirect config. Ensure it matches the canonical URL of the page exactly to avoid case-sensitivity issues.

Common issues and how to fix them

Slug comes out empty for emoji-heavy or symbol-only titles

A title containing only emojis, punctuation, and symbols produces an empty slug because all characters are stripped. Add at least one word or alphanumeric component to the title before slugifying. The audit panel will flag this case.

Accented characters appear percent-encoded in the URL bar

This happens when the raw accented string is used as a URL without normalization. This tool's NFD normalization converts characters like é to e, ü to u, and ñ to n before generating the slug, producing clean ASCII-safe output that never percent-encodes.

Duplicate hyphens appear in the output

This usually happens when the original title has multiple consecutive punctuation marks, symbols, or spaces — each of which gets replaced by a separator. The sanitization pipeline collapses consecutive separators into one, so this should not appear in tool output. If you are applying slugify logic manually, add a step to replace /-+/g with '-'.

Stop-word removal makes the slug unreadable or ambiguous

Stop-word removal is a useful shortening technique but can remove words that carry meaning in context. 'Art of War' becomes 'art-war', which is shorter but may look incomplete. Toggle stop-word removal off if the shorter slug loses important context. The toggle is off by default.

The slug is too long for the CMS or URL length limit

Most CMSs and URL routing systems work best with slugs under 75 characters. Use the max-length option to truncate at a word boundary. Alternatively, use stop-word removal and review whether any non-essential words can be removed from the title before slugifying.

Uppercase paths causing duplicate content on case-sensitive servers

Linux servers are case-sensitive, so /Blog/My-Post and /blog/my-post are treated as different URLs. This tool always outputs lowercase slugs. Ensure your CMS and routing configuration enforce lowercase-only URL paths consistently, and add canonical tags to consolidate any case variants that already exist.

Frequently asked questions