Hreflang Tag Generator — Generate Hreflang Tags for Any Language and Region
Create valid, self-referencing hreflang tags for any number of language versions. Supports all ISO 639-1 language codes including Arabic regional variants.
Generated Hreflang Tags
Implementation Checklist
Paste the above tags into the <head> section of EACH page listed below. Check off each page as you add the tags.
What are Hreflang Tags?
Hreflang tags are HTML link elements placed inside the <head> of a webpage that tell Google which language and region a page is intended for. When a website has the same content available in multiple languages — such as Arabic and English — hreflang tags tell search engines which version to show to which user based on their location and browser language settings.
Without hreflang tags, Google attempts to guess the correct language version to show. This results in Arabic-speaking users seeing the English version, or users in Egypt seeing content intended for Saudi Arabia — both of which reduce click-through rates and increase bounce rates significantly.
Hreflang tags follow the ISO 639-1 language code standard. A language code such as "ar" targets all Arabic speakers globally, while a regional code such as "ar-EG" targets Arabic speakers specifically in Egypt. The special value "x-default" serves as a fallback for users whose language does not match any of the specified versions.
Every language version of a page must include hreflang tags pointing to all other versions — including itself. This self-referencing requirement is mandatory. Tags that are missing from even one version will cause Google to ignore the entire hreflang implementation.
Freekito's Hreflang Tag Generator creates complete, self-referencing hreflang tags for any number of language versions. It supports all ISO 639-1 language codes including all Arabic regional variants, and outputs ready-to-paste HTML or XML sitemap format.
How to Use This Tool
- 1. Click "+ Add language" to add a row for each language version of your page.
- 2. Select the language code from the dropdown — type to search by language name or code (for example, type "ar" to find Arabic variants).
- 3. Enter the full URL for that language version — URLs must begin with https://.
- 4. Repeat for every language version of the page.
- 5. Enter your x-default URL in the separate field at the bottom — this is the fallback page shown when no language matches.
- 6. Click "Generate Hreflang Tags."
- 7. Copy the generated tags and paste them inside the
<head>section of every language version of your page — not just one version.
Important: Every language version of your page must include all the generated tags — including the tag that points to itself. URLs must be absolute (include https://) — relative URLs will not work. Each language code can only appear once. Duplicate codes will be flagged as an error.
Frequently Asked Questions
What are hreflang tags and why do I need them?
Hreflang tags tell Google which language and region each version of your page is intended for. Without them, Google guesses which version to show to each user — and frequently guesses wrong. If your website has content in more than one language, hreflang tags are required for your international SEO to work correctly.
What is the x-default hreflang tag?
The x-default tag is a fallback that tells Google which page to show when no language version matches the user's browser settings. For example, if your site has English and Arabic versions but a French speaker visits, Google will show the x-default page. It is not a language — it is a catch-all. Always include it.
Do hreflang tags need to be on every page?
Yes. Every language version of a page must include the complete set of hreflang tags, including a tag pointing back to itself. If the English version includes hreflang tags but the Arabic version does not, Google will ignore the entire implementation. This self-referencing requirement is the most common mistake developers make.
How do I set up hreflang for an Arabic and English website?
Add two rows in the generator — one for your Arabic version using the code "ar" (or "ar-EG" for Egypt-specific Arabic) with its URL, and one for your English version using "en" with its URL. Add your x-default URL — usually the English version. Click generate, then paste the output into the <head> of both your Arabic page and your English page. Both pages must contain both tags.
What is the difference between "ar" and "ar-EG" in hreflang?
"ar" targets all Arabic speakers regardless of country. "ar-EG" targets Arabic speakers specifically in Egypt. Use "ar" if you have one Arabic version for all regions. Use country-specific codes like "ar-EG", "ar-SA", or "ar-AE" only if you have separate pages tailored to each country — different currency, dialect, or local content. Using country codes for a single shared Arabic page is unnecessary and adds complexity.
Where do hreflang tags go — in the HTML head or the XML sitemap?
Both locations are valid and Google accepts either. HTML head tags are easier to implement for most sites — paste them directly into the <head> section of each page. XML sitemap implementation is preferred for large sites with many pages because it avoids adding tags to every individual HTML file. Freekito generates both formats — use the toggle to switch between HTML and XML sitemap output.
Can hreflang tags be in the HTTP header instead of HTML?
Yes. For non-HTML files such as PDFs, hreflang can be implemented as an HTTP response header instead of an HTML tag. For standard web pages, the HTML head or XML sitemap methods are simpler and more widely supported.
How do I know if my hreflang tags are working?
After adding hreflang tags to your pages, check Google Search Console under the International Targeting report. Errors such as "no return tag" (missing self-reference) or "invalid language code" will appear there within a few days of Google recrawling your pages. Freekito validates your tags before generating them to prevent the most common errors.
Is the Hreflang Generator free?
Yes. Freekito's Hreflang Tag Generator is completely free with no account required. All tag generation happens in your browser — no data is sent to any server.