Should I separate the words in my URL with hyphens or underscores?
For URLs people see, the hyphen is the common convention on the web, and the search engines' own URL-structure guidance is worth checking for their current advice. The underscore suits systems or file names that specifically require it. The slug generator supports both; whichever you choose, keep to it, because changing URLs after publishing needs redirects.
The difference on one example
An English product title in Latin mode:
arabic-coffee-500g
arabic_coffee_500g
The first line uses the hyphen, the default; the second is after choosing 'Underscore _'. Both are 18 characters. The same option works in Arabic mode: قهوة عربية 500 غرام becomes قهوة_عربية_500_غرام with the underscore.
So the difference is not length or letters. It is how the URL reads, to the eye and to software.
Why the hyphen is the usual choice
- When a link is shown underlined in a message or an email, the underscore disappears into the underline, so arabic_coffee_500g looks as if its words are separated by spaces or run together. A hyphen stays visible.
- Most store platforms and blogging systems use hyphens in their default URLs, so your slugs match the rest of your store.
- Some tools and software treat a hyphen as a word break and an underscore as part of a word. We cannot say for certain how every search engine handles this today, so check the search engine's own URL guidance if it matters to you.
When to choose the underscore
When the system that will receive the result asks for it: image or document file names in an internal system that uses underscores, identifiers in a database or a spreadsheet, or a shared folder with an agreed naming rule. There, consistency with the system matters more than the general convention.
The steps
- Open the URL slug generator and type the title.
- Under 'Separator', choose 'Hyphen -' or 'Underscore _'.
- Keep 'Collapse repeated separators into one' and 'Trim separators from both ends' on; they work with whichever separator you pick.
- Copy the result.
More important than the choice: sticking to it
A store with half its URLs hyphenated and half underscored confuses anyone typing a link by hand and anyone managing the site. Choose one separator for every page URL and write it into your team notes. If you already have published URLs with the other separator, do not change them just for tidiness: every changed URL needs a permanent 301 redirect from old to new, or old visits land on a page that no longer exists.
Once your URLs are settled, add them to your sitemap with the XML sitemap generator, exactly as published.
Common questions
Can I use another separator, such as a dot?
No. The tool supports the hyphen and the underscore only.
Do spaces and symbols in the title turn into my chosen separator?
Yes. Everything that is not a letter or a digit becomes the chosen separator, then repeated separators are collapsed.
Does the encoded form change with the separator?
No. Neither the hyphen nor the underscore is encoded; each stays one character in the encoded form.
