← Back to DevKit

URL Slug Generator

SLUGIFY · DEV TOOLS

Turn titles or filenames into URL-friendly slugs: lowercase, spaces to dashes and special characters stripped — ready for routes and anchors.

Input text
CJK
Separator
Slug result
Percent-encoded (final URL form)
Produce URL-friendly slugs of lowercase letters, digits and dashes — for routes, anchors and filenames. CJK can be converted to pinyin (dictionary lazy-loaded, polyphones resolved by common word usage), kept, or dropped; multi-line input converts line by line.

>_ USAGE GUIDE

Paste a title, filename, or any string, and generate a URL-friendly slug in one click: optionally lowercase it, turn spaces into dashes (-), and strip special characters. The output is ready to use as a route path, page URL, anchor, or file alias.

A slug is the readable identifier in a URL, such as hello-world in https://example.com/blog/hello-world. A good slug is short, lowercase, word-separated by dashes, and free of spaces and special characters — easier for humans to read and for search engines to understand. Doing it by hand is error-prone; a one-click tool is far more reliable.

  1. Turn a title into a slug: convert "Hello World! Getting Started" into a URL path like hello-world-getting-started
  2. Turn a filename into an alias: strip spaces, uppercase, and special characters to get something URL-safe
  3. Apply a consistent rule: toggle lowercase and special-character removal so generated slugs match your site's convention

Processing happens entirely in your browser — the title is never uploaded to any server.

>_ FAQ

Q1 · What exactly is a slug, and how does it relate to filenames and URLs?

A slug is the readable text segment in a URL that identifies a piece of content, usually derived from the title — for example how-to-install-git in …/posts/how-to-install-git. It replaces hard-to-remember IDs or query strings with a link that is readable, shareable, and good for SEO. Most CMS and blogging systems generate a slug from the title on publish.

Q2 · What rules make a good slug?

The common best practices: all lowercase; use dashes - rather than underscores or spaces to separate words (Google treats a dash as a word separator but an underscore as a joiner, so dashes are friendlier for SEO); remove punctuation and special characters; and keep it short while including the core keyword. For Chinese content, many sites keep the original (percent-encoded) text or apply their own transliteration/pinyin rule.

Q3 · Why convert to lowercase and replace spaces with dashes?

URLs are usually case-insensitive in principle, but case inconsistency in paths leads to duplicate content or 404s (servers differ in case sensitivity), so normalizing to lowercase prevents mismatched links. Spaces must be percent-encoded as %20 in URLs — ugly and error-prone — while a dash reads cleanly and acts as a word separator for SEO. Hence "lowercase plus dashes" is the industry default.

Q4 · How are special characters and non-ASCII text handled?

Typically in two groups: safe Latin letters and digits are kept and lowercased; spaces become dashes; punctuation such as ! @ # $ % & * ( ) is removed. Chinese gets three strategies: "Pinyin" (e.g. a Chinese title becomes vue3-zuheshi-api-shizhan, polyphones resolved by common word usage, dictionary shipped with the page and never leaves the browser), "Keep" (CJK characters retained, percent-encoded in the final URL — handy on intranets), and "Drop" (pure ASCII output). There is also a separator toggle (dash/underscore), a numeric-suffix deduper (appends -2 style suffixes when the same title is used twice), and a percent-encoded preview of the final URL so you can see exactly what the link will look like.

Q5 · Does changing a slug break links I have already published?

Yes. Once a slug changes, the old URL stops working. In production the practice is to avoid changing slugs after publishing; if you must, configure a 301 redirect from the old path to the new URL so users and search engines do not hit dead links. Settling the slug up front — short, keyword-bearing, spec-compliant — minimizes later migration cost.

Embed code

Paste the code below into your page to embed this tool as an iframe (nav and footer auto-hidden).

Heightpx
This tool runs entirely in your browser — input never leaves your device. Press Ctrl K to switch tools anytime.