How to Generate a URL Slug From a Title (Including Vietnamese)
Turn any title into a clean, URL-safe slug — with correct handling of Vietnamese diacritics, including 'đ,' which isn't just an accented 'd.'
By QR Ivify Team
A blog post title, a product name, a page heading — turning it into a clean URL slug (my-blog-post-title instead of My Blog Post Title!) is something every CMS does automatically, until you need to generate one manually, or the automatic version mangles non-English text. Here's how slug generation actually works, and where it commonly goes wrong.
What Makes a Slug "Clean"
A URL-safe slug is lowercase, uses only letters, numbers, and a single separator character (usually a hyphen), and has no repeated or trailing separators. Getting from "Hello, World! This Is a Title." to hello-world-this-is-a-title means: lowercase everything, replace every run of non-alphanumeric characters with the separator, and trim any separator left dangling at the start or end.
The Vietnamese Problem
This is where a lot of slug generators quietly fail. Standard accent-stripping works by decomposing a character like "à" into its base letter ("a") plus a separate "combining accent mark," then dropping the accent mark — leaving "a." That works for most diacritics. It does not work for "đ" (and its uppercase "Đ"), because in Vietnamese, đ is its own distinct letter, not a "d" with an accent mark attached. Standard decomposition leaves đ completely untouched, and a slug generator that doesn't handle it explicitly ends up either keeping the raw đ character in the slug (breaking URL-safety) or dropping it as an unrecognized character (losing content).
QR Ivify's Slug Generator handles đ/Đ explicitly, converting them to d/D before the rest of the accent-stripping runs — so Vietnamese titles produce a correct, readable slug instead of a broken or lossy one.
Step by Step
- Open the Slug Generator.
- Type or paste a title.
- Choose a hyphen or underscore as the separator.
- The slug updates live — copy it once it looks right.
A Worked Example
Input: Xin chào các bạn! Đây là 100% Test.
Output: xin-chao-cac-ban-day-la-100-test
Every Vietnamese diacritic is stripped to its base Latin letter, "Đây" correctly becomes "day" (not "ây" or a broken character), the percent sign and punctuation become separators, and the whole thing collapses to one clean, readable slug.
Frequently Asked Questions
Does this handle Vietnamese titles correctly? Yes — Vietnamese diacritics (including "đ," which isn't just an accented "d") are correctly transliterated to plain ASCII letters rather than dropped or garbled.
Can I use an underscore instead of a hyphen? Yes — hyphens are the more common convention for URLs, but underscores are supported too.
What happens to numbers? Numbers are kept as-is — only letters and numbers survive; everything else becomes a separator.
Does this upload my text anywhere? No. The slug is generated entirely in your browser.
Try It
Need a clean URL slug from a title — including one with Vietnamese text? QR Ivify's free Slug Generator handles diacritics correctly. Need the title's word count for an SEO check too? Try Word Counter.
Related articles
How to Change Text Case Online — UPPERCASE, Title Case & More
Convert text between UPPERCASE, lowercase, Title Case, Sentence case, and more, without losing line breaks — and what actually separates Title Case from Capitalize Each Word.
How to Clean Up Messy Text (Extra Spaces, Blank Lines, Tabs)
Fix text that came through with irregular spacing, blank lines, or tabs — from pasting out of a PDF, a webpage, or a spreadsheet — with cleanup options you control individually.
How to Compare Two Texts and See What Changed
Compare two versions of a document, email, or config file line by line and see exactly what was added or removed — the algorithm behind it, explained simply.