SEO Tools

hreflang Tag Generator


Generate valid hreflang tags for your multilingual pages in seconds โ€” free, accurate, and processed entirely in your browser.

Add one row per language (and optional region) with the exact, absolute URL of that page. Pick a language, optionally a country/region, then the tag builds automatically.

Page URL Language (ISO 639-1) Region (ISO 3166-1, optional)
The fallback page for unmatched languages (usually a language selector or your primary market).
Use HTML tags in each page's <head>, or the sitemap form inside each <url> entry.

๐Ÿ’ก hreflang quick rules

  • Tags must be bidirectional: if page A points to B, B must point back to A.
  • Every set should reference itself (a self-referencing hreflang for its own language).
  • Use language only (en) or language + region (en-GB), never region alone.
  • Always use absolute URLs with the protocol, e.g. https://example.com/de/.
  • Add one x-default for users whose language you don't target.

The hreflang Tag Generator creates valid hreflang annotations that tell Google and other search engines which language and regional version of a page to show each user. Add your localized URLs, pick a language (and optional region) for each, and copy ready-to-use tags โ€” everything runs in your browser, with no data sent to any server.

What is hreflang and why does it matter?

hreflang is an HTML attribute that maps a page to its alternates in other languages or regions. When you run the same content in, say, English, Spanish, and German, hreflang stops those versions from competing with each other and makes sure a searcher in Mexico lands on your Spanish page instead of the English one. Done right, it improves international rankings, reduces duplicate-content confusion, and lifts click-through by serving the correct locale in search results.

How to generate hreflang tags

  1. Add one row for every localized URL, using the full absolute address such as https://example.com/de/.
  2. Choose the language for each row, and a country or region only if you target a specific market โ€” for example en-GB versus en-US.
  3. Optionally enable an x-default row for visitors whose language you do not target.
  4. Pick the output format: HTML <link> tags for the page <head>, or the xhtml:link form for an XML sitemap.
  5. Copy the generated tags and add them to every version of the page, including the page pointing to itself.

The three rules that keep hreflang working

  • Bidirectional: if page A references page B, page B must reference page A, or Google ignores the annotation.
  • Self-referencing: each page must include a tag pointing to itself in its own language.
  • Absolute URLs and valid codes: use ISO 639-1 language codes and optional ISO 3166-1 region codes, and never a region on its own.

Once your tags are set, it is worth confirming the rest of your on-page signals line up: generate your title and description tags with the Meta Tags Generator, then preview how each localized page will appear in results using the Google SERP Preview before you publish.

Where to place your hreflang annotations

You can implement hreflang in three places โ€” the HTML <head>, the HTTP header (for non-HTML files like PDFs), or an XML sitemap. Large multilingual sites usually prefer the sitemap approach because it keeps every mapping in one file; build that file with the XML Sitemap Generator and reference all locales inside each <url> entry. Whichever method you choose, make sure none of your language folders are accidentally disallowed in the file you create with the Robots.txt Generator, and back your international pages with correct structured data from the Schema Markup Generator so search engines and AI answer engines understand the entity behind every version.

Common hreflang mistakes to avoid

Most hreflang problems come down to a handful of errors: missing return links, using an underscore (en_US) instead of a hyphen (en-US), pointing to redirected or non-canonical URLs, or forgetting the self-reference. This generator flags duplicates and non-absolute URLs as you type so you can catch those issues before they reach production.

Frequently Asked Questions

Do I need hreflang if my site is only in one language?

No. hreflang is only needed when you publish the same or equivalent content in more than one language or regional variation. A single-language site does not need it.

What is the x-default hreflang value?

x-default marks the fallback page shown to users whose language or region you do not explicitly target โ€” typically a language selector or your primary market's homepage. It is optional but recommended for global sites.

Should I use language only or language plus region?

Use language only (like en) when the content suits all speakers of that language. Add a region (like en-GB) only when you have genuinely different content for that market, such as different pricing, spelling, or shipping.

Where do hreflang tags go?

Place them in the HTML head of each page, in the HTTP header for non-HTML files, or inside an XML sitemap. Pick one method and apply it consistently across every localized URL.

Why is Google ignoring my hreflang tags?

The most common cause is missing return links: every page in the set must reference every other page, including itself. Broken or redirecting URLs, wrong region codes, and mixing implementation methods can also cause Google to drop the annotations.