Convert any text to a URL-friendly slug. Choose hyphen, underscore, or dot separator — all three variants shown at once for easy comparison.
Slug appears as you type
A URL slug is the readable part of a page address that identifies a resource. In
https://example.com/blog/clean-web-addresses, clean-web-addresses is the
slug. This tool converts titles, headings, and labels into lowercase text that
is easier to read, share, and use in links.
The converter performs these steps in order:
é, ñ, and ü to their basic Latin
forms.For example, Crème brûlée: A Beginner's Guide! becomes
creme-brulee-a-beginners-guide.
| Separator | Example | Typical use |
|---|---|---|
| Hyphen | my-page-title | Public URLs and SEO |
| Underscore | my_page_title | Internal identifiers |
| Dot | my.page.title | Namespaced labels |
Hyphens are the recommended choice for public URLs because search engines recognize them as word boundaries. Keep slugs short, descriptive, lowercase, and stable after publishing.
Avoid dates, unnecessary stop words, and details likely to change. A slug such
as best-running-shoes remains useful longer than
best-running-shoes-2026-sale.
JavaScript
const slug = title
.normalize("NFKD")
.replace(/[\u0300-\u036f]/g, "")
.toLowerCase()
.replace(/[^a-z0-9\s_-]/g, "")
.trim()
.replace(/[\s_-]+/g, "-");
Python
import re
import unicodedata
def slugify(title):
text = unicodedata.normalize("NFKD", title)
text = "".join(c for c in text if not unicodedata.combining(c))
text = re.sub(r"[^a-z0-9\s_-]", "", text.lower()).strip()
return re.sub(r"[\s_-]+", "-", text)
PHP
$slug = strtolower($title);
$slug = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $slug);
$slug = preg_replace('/[^a-z0-9\s_-]/', '', $slug);
$slug = preg_replace('/[\s_-]+/', '-', trim($slug));
Use one canonical slug per page and redirect old slugs when a rename is necessary. Treat URLs as case-sensitive in application routing, even when a server normalizes them. Encode or reject unsupported characters rather than allowing malformed paths, and keep user-generated slugs unique within their collection.
Should I use hyphens or underscores? Use hyphens for public URLs. They make word boundaries clear to both readers and search engines.
Does this tool send text to a server? No. Conversion runs in the browser, so entered text stays on the current device.
Can I use generated slugs as file names? Yes. Lowercase, separator-based names work well for files, assets, and repository paths.
What happens to non-Latin characters? Common accented Latin characters are transliterated. Unsupported scripts and punctuation are removed, so review the result before publishing.
This tool is provided for general informational and utility purposes only. Results may be inaccurate, incomplete, outdated, or contain errors. Always verify results before relying on or using them.
Some tools may use AI, automated processing, third-party services, or server-side processing. Do not rely on these tools as a substitute for professional advice.
Use at your own risk. BestToolOnline makes no guarantees regarding the accuracy, reliability, completeness, availability, or suitability of results, to the maximum extent permitted by applicable law.
See our Terms of Service and Privacy Policy for complete details.