URL slug generator
A slug is the human-readable part of a URL derived from a title: “Parse the XML file from Aisha’s ERP API (v2)” becomes parse-the-xml-file-from-aishas-erp-api-v2. It is kebab-case plus everything a URL demands — punctuation removed, apostrophes handled rather than left as %27, accents and non-Latin scripts transliterated, and consecutive separators collapsed.
Transliteration is the part cheap slugifiers get wrong. A title in Arabic or with accented Latin characters either produces an empty slug, a string of percent-encoded bytes, or mangled output — none of which is readable or shareable. This generator transliterates, so a title in another script becomes a Latin slug that a person can read, type and paste into a message without it turning into gibberish.
The operational rule matters as much as the format: once a slug is published, it should not change. Editing a title and regenerating the slug breaks every existing link, every share and every search result — which is why systems that do it must also keep a permanent redirect from the old form. Stop-word removal and a length cap are useful for keeping slugs tidy, and both are toggles here rather than defaults, because a truncated slug that loses the distinguishing word is worse than a long one.
slug — worked through
Every line below is produced by the same converter that runs on this page, so the example and the tool cannot disagree.
| Input | slug | Note |
|---|---|---|
| parse xml file | parse-xml-file | The canonical shape of this style. |
| Parse the XML file from Aisha’s ERP API (v2) | parse-the-xml-file-from-aishas-erp-api-v2 | Default options: lowercase, hyphenated, transliterated. |
| Parse the XML file from Aisha’s ERP API (v2) | parse-xml-file-aishas-erp-api-v2 | Stop words removed and capped at 40 characters, cut at a word boundary. |
Where slug is the convention
| Ecosystem | What it applies to |
|---|---|
Blog & CMS URLs | The canonical use: /2026/07/parse-the-xml-file. Readable in a search result, and it survives being pasted into a chat message without escaping. |
Product & category paths | e-commerce paths built from names. These change most often, which is exactly where a permanent redirect table earns its keep. |
Anchors & fragment IDs | Heading anchors in documentation are slugs of the heading text, which is why changing a heading breaks deep links into a page. |
Filenames & keys | Slugs make safe filenames and object-storage keys — no spaces, no case sensitivity surprises, nothing needing shell quoting. |
The acronym trap
A slug lowercases everything, so acronyms simply become lowercase words: XML becomes xml, ERP becomes erp. That is correct for URLs — they are conventionally lowercase, and some servers treat paths case-sensitively while others do not, so mixed case is a source of duplicate-content bugs. Keep the acronym in the visible title and let the slug flatten it; do not try to preserve capitalisation in a URL path.
مرحبا بالعالم. The Unicode slug keeps the original script.FAQ
Should a URL slug use hyphens or underscores?
Hyphens. Search engines treat a hyphen as a word separator and an underscore as a joiner, so my_blog_post can be read as a single token. Hyphens are also the long-standing convention across the web.
What happens to accents and non-Latin text?
They are transliterated into Latin characters, so the slug stays readable and typeable. Percent-encoding the original bytes technically works but produces a URL nobody can read, share or type.
Should I change a slug when I edit the title?
Prefer not to. Every published link, share and search result points at the old slug. If you must change it, keep a permanent (301) redirect from the old one — permanently, not for a month.