SchemaValid
ENDE

Hreflang Generator

Generate valid, reciprocal hreflang tags for all your language and regional versions. This free hreflang tag generator outputs HTML link tags, XML sitemap entries or an HTTP header — and everything runs in your browser.

Try an example

Language versions

The version shown when no other language matches the visitor — usually your default or an international landing page.

Bulk import

Paste one entry per line: either a bare URL, or a code and URL separated by a comma (e.g. en-US, https://example.com/us/). Up to 50 rows.

Check these before publishing

  • Add at least two complete versions (language + URL) — hreflang always describes a set of alternates.

Add at least two language versions with a URL to see the generated hreflang markup here.

Everything runs locally in your browser. The URLs and language codes you enter are never uploaded, stored, or tied to an account.

How reciprocal linking works

hreflang only works when the annotation is bidirectional: if your English page points to the German one, the German page has to point back — and every page must also reference itself. Miss a return link and search engines quietly drop the whole cluster. This generator always emits the complete set, so the same block is valid on every page in the group.

ENhreflang="en"DEhreflang="de"FRhreflang="fr"x-default
  • Reciprocal link (both directions)
  • Self-reference
  • x-default fallback

Language codes, regions and formats

A language code alone (like en) targets a language wherever it is spoken. Add a region (like en-US or en-GB) only when the content genuinely differs by market — different currency, spelling or offers. Over-segmenting with regions you do not actually serve just creates maintenance work.

The three output formats are equivalent; pick the one that fits your setup. HTML link tags go in the head area of each page and are the most common choice. XML sitemap entries keep the annotations out of your markup and scale well for large sites. HTTP headers are the way to annotate non-HTML files such as PDFs.

For the authoritative rules, see Google's documentation on telling Google about localized versions of your pages: Google Search Central – localized versions.

Frequently asked questions

Do I need hreflang on every page?
Only on pages that genuinely have alternate language or regional versions. A page that exists in one language does not need hreflang. Where alternates do exist, annotate each of them — and each version must list every other version plus itself.
What is x-default and when should I use it?
x-default marks the page shown when none of your specific language-region versions fit the visitor. It is optional but recommended when you have a language selector, an international landing page, or a sensible default like your English site. If every likely visitor is already covered by a specific version, you can skip it.
What is the difference between en and en-US?
en targets the English language regardless of country. en-US targets English speakers specifically in the United States. Use a bare language code unless the content really differs by region — for example separate prices, shipping or spelling for the US and UK. Adding regions you do not serve differently just adds overhead.
Why does Search Console report "no return tags"?
That error means page A points to page B, but page B does not point back to A. hreflang annotations must be reciprocal. Because this generator builds the complete two-way set for every version, using its output on all listed pages avoids that error by design.
Does the casing of the ISO codes matter?
Search engines treat hreflang values case-insensitively, but the widely used convention is a lowercase language code and an uppercase region, joined by a hyphen — en-US, not EN-us or en_us. This tool normalizes to that convention automatically.
Should I use HTML tags or the XML sitemap method?
Both are valid and you should use only one to avoid conflicting signals. HTML link tags in the head area are simplest for small sites. The XML sitemap method keeps annotations out of your pages and is easier to maintain at scale. HTTP headers exist mainly for non-HTML files like PDFs.
Are hreflang tags a ranking factor?
No. hreflang does not boost rankings on its own. It tells search engines which language or regional version to show a given user, which improves the experience and can reduce the wrong version outranking the right one — but it is a targeting signal, not a ranking signal.
Are my URLs sent to a server?
No. This generator runs entirely in your browser. The URLs and codes you enter are never transmitted, logged, or stored, so you can safely use it for staging or unpublished pages.

Related tools