Crawl and indexing
hreflang Tag Generator
Turn a list of language and country versions into hreflang tags, with the codes checked against ISO 639-1 and ISO 3166-1.
Runs in your browser; nothing is uploaded. · Free, no account · 3 min
List every version of the page, itself included. Add x-default for the fallback.
Importing a saved run into your account is coming soon. Until then, your last runs stay in this browser only, and you can download your files.
How to use
- Write one line per version: the code, then the full URL, such as ar-EG https://example.com/ar-eg/.
- Include the page itself, every other version, and an x-default line for the fallback.
- Choose the output: HTML tags for the head, an HTTP header, or XML sitemap entries.
- Put the same block on every version of the page, then check the set with the hreflang Validator.
What it checks and how it works
The output follows Google's documentation on localized versions: every version lists itself and all the others, alternate URLs are fully qualified, and the value is an ISO 639-1 language code with an optional ISO 3166-1 alpha-2 region, or x-default. Codes are checked against the iso-639-1 and i18n-iso-countries packages, and the tool fixes letter case (language lower-case, region upper-case) and replaces underscores with hyphens.
A code that is not in those lists, such as es-419, is flagged because Google states it supports only ISO 639-1 languages and ISO 3166-1 alpha-2 regions. hreflang is a hint for matching users to versions; it does not move rankings between versions.
Sources
- Google Search Central: Tell Google about localized versions of your page opened 29 Oct 2026
Related tools
hreflang Validator
Paste the hreflang tags of your pages and see missing return links, bad codes and inconsistent sets.
Canonical Tag Generator
Enter a page URL and get the canonical form of it, as a link tag and an HTTP header.
sitemap.xml Generator
Turn a list of URLs into a valid sitemap.xml, with Arabic paths encoded and the protocol limits checked.
URL Encoder and Decoder
Encode Arabic URLs as UTF-8 percent-encoding, or decode them back to readable text.
Go further with Zaher: Read: Arabic and English content for AI search
Questions
About this tool
ar for Arabic in general, or a language and country such as ar-EG for Egypt, ar-SA for Saudi Arabia and ar-AE for the UAE. Use a country code only when you have a version written for that country.
It is optional. Google describes it as the fallback for users whose language you do not list, such as a language selector page.
Use one of three equal methods: link tags in the head of every version, an HTTP Link header (for PDFs and other files) or xhtml:link entries in a sitemap. Pick one method and keep it consistent.
Get started today
Find out where your brand stands in AI. Free.
Run a free AI visibility analysis on your domain. No credit card, results in minutes. See what AI engines say about your brand today.
Brands already measuring their AI visibility with Zaher.


