hreflang Generator
List your language codes and the URL of each page in every language. The tool checks the codes against ISO standards, makes every version list all the others (reciprocity), and outputs the format you need. Background: the international SEO and hreflang article.
- You have regional versions like "de-DE" but no generic "de". Consider also marking one version as plain "de" for speakers in other countries.
<!-- Page group 1: add to the <head> of every one of these pages:
https://www.ornek.com/
https://www.ornek.com/en/
https://www.ornek.com/de/ -->
<link rel="alternate" hreflang="tr" href="https://www.ornek.com/" />
<link rel="alternate" hreflang="en" href="https://www.ornek.com/en/" />
<link rel="alternate" hreflang="de-DE" href="https://www.ornek.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://www.ornek.com/" />
<!-- Page group 2: add to the <head> of every one of these pages:
https://www.ornek.com/hakkimizda
https://www.ornek.com/en/about
https://www.ornek.com/de/uber-uns -->
<link rel="alternate" hreflang="tr" href="https://www.ornek.com/hakkimizda" />
<link rel="alternate" hreflang="en" href="https://www.ornek.com/en/about" />
<link rel="alternate" hreflang="de-DE" href="https://www.ornek.com/de/uber-uns" />
<link rel="alternate" hreflang="x-default" href="https://www.ornek.com/hakkimizda" />
<!-- Page group 3: add to the <head> of every one of these pages:
https://www.ornek.com/iletisim
https://www.ornek.com/en/contact -->
<link rel="alternate" hreflang="tr" href="https://www.ornek.com/iletisim" />
<link rel="alternate" hreflang="en" href="https://www.ornek.com/en/contact" />
<link rel="alternate" hreflang="x-default" href="https://www.ornek.com/iletisim" />How to use it
- In the first box, write the language codes in column order, e.g. "tr, en, de-DE, x-default". Use a language code (ISO 639-1) with an optional country code (ISO 3166-1), never a country on its own.
- In the second box, put one page per row and its language versions in the same column order. Copying columns from Excel or Google Sheets works as-is (tab-separated). Leave a cell empty if a page has no version in that language.
- Fix any red errors. Pick the output format: HTML tags for each page's <head>, an XML sitemap, or HTTP headers for PDFs and other non-HTML files. Use only one method per site.
- After publishing, check a few pages in the source code and watch Search Console for errors.
Frequently Asked Questions
Which method should I use: HTML, sitemap or HTTP header?
Google treats all three as equivalent. HTML tags are easiest on small sites; a sitemap is easier to manage on large sites because it keeps the markup out of page templates. HTTP headers are for non-HTML files such as PDFs. Use one method consistently.
What is x-default for?
x-default marks the page to show users whose language or region does not match any of your versions, typically a language selector or your main international page. It is optional but recommended.
Why do I get "en-UK is not valid"?
The ISO code for the United Kingdom is GB, so the correct value is en-GB. Similarly, EU is not a country code, and JP, CN and KR are country codes, not language codes (ja, zh and ko are).
Does hreflang need canonical tags too?
Yes, each language version should have a self-referencing canonical pointing to itself, not to another language. Pointing all versions to one canonical tells Google they are duplicates. The technical SEO guide covers canonicals.


