Hreflang Tag Generator

Technical SEO

Generate standardized language and regional alternate tags or XML sitemap headers to guide Google on regional site and multi-language structures.

boltLocal GenerationlockFree & Privatespeed0ms Latency
hreflang-config
Language / URL Mapping
alternate-tags.html
Add alternate URLs to generate codes.

What is a Hreflang Tag?

Hreflang tags are HTML attributes (rel="alternate" hreflang="x") used to tell search engines about different localized versions of a page. If you have pages targeting different languages or geographic regions, hreflang tags ensure search engines serve the correct localized URL to users (e.g., German speakers receive the German version). Correct configurations prevent duplicate content penalties and reduce bounce rates.

How to Implement Generated Hreflang Code

You can insert hreflang tags in one of three places: directly within the HTML <head> section of each page, inside HTTP headers, or within your XML sitemap. For best results, ensure your implementation is reciprocal: if page A links to page B via a hreflang tag, page B must link back to page A with its matching language code. Always define a 'x-default' fallback page for unmatched users.

Examples

Multilingual Targeting

Example Input

Targeting US English, British English, and German versions.

Sample Output

<link rel="alternate" hreflang="en-us" href="https://example.com/en" /> <link rel="alternate" hreflang="en-gb" href="https://example.com/uk" /> <link rel="alternate" hreflang="de" href="https://example.com/de" />

FAQ

What is the x-default hreflang value?

The x-default value tells search engines where to send visitors when no other specified language matches their browser settings. It is typically used for homepages or generic landing pages that offer global region selectors.

Can I use country codes alone in hreflang attributes?

No, you cannot specify a country code by itself. You must define a language code (using ISO 639-1 format), followed optionally by a country code (using ISO 3166-1 alpha-2 format). For example, 'en-us' is valid, but 'us' alone is not.

SEO Toolkit ReferenceAudit website health using our collections of sitemap, robots, redirect, and header checkers.

Related Resources