<link rel="alternate" hreflang="x-default" href="https://example.com/" /> <link rel="alternate" hreflang="en-US" href="https://example.com/us/" /> <link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" /> <link rel="alternate" hreflang="fr-FR" href="https://example.com/fr/" /> <link rel="alternate" hreflang="de-DE" href="https://example.com/de/" />
| hreflang | URL | Status |
|---|---|---|
| x-default | https://example.com/ | Valid |
| en-US | https://example.com/us/ | Valid |
| en-GB | https://example.com/uk/ | Valid |
| fr-FR | https://example.com/fr/ | Valid |
| de-DE | https://example.com/de/ | Valid |
The Hreflang Tag Generator builds the hreflang annotations that tell Google which language and regional version of a page to show each user. You enter one row per version β a language/region code like en-US, fr-FR, or es-419 and the matching URL β and the tool outputs valid markup in whichever of the three formats Google accepts: HTML <link rel="alternate"> tags for the page <head>, xhtml:link entries for an XML sitemap, or an HTTP Link response header for non-HTML files like PDFs. Correct hreflang is what stops a French user landing on your English page and keeps your regional pages from competing with each other in search.
Hreflang is deceptively easy to get wrong. The codes follow the ISO 639-1 language and ISO 3166-1 region standards, not intuition β the United Kingdom is GB, not UK, and Spanish for Latin America is the UN M49 code es-419. Return tags must be reciprocal: if page A points to page B, page B has to point back. And most sites forget the x-default fallback for users whose language you do not target. This generator validates every code against the expected shape, flags codes that are not recognized language or region subtags, catches duplicates, checks that each URL is absolute, and reminds you about x-default and reciprocity before the markup ever reaches your site.
Everything runs in your browser. Your URL structure β which can reveal your entire international site architecture β is never uploaded, and the tool works offline once loaded. Pick a format, fill in your language versions, and copy the generated tags straight into your templates, sitemap, or server config. After deploying, confirm the setup with the hreflang report in Google Search Console.
Enter one row per version: a language/region code (en, en-US, fr-CA, zh-Hantβ¦) and the full URL of that version. Use the quick-pick codes if you are unsure of the format.
Add an x-default row pointing to your fallback URL (often a language selector or your main homepage) for visitors whose language you do not explicitly target.
Switch between HTML link tags for the <head>, xhtml:link entries for an XML sitemap, or an HTTP Link header. The tool validates codes and URLs and warns about duplicates and missing x-default.
Copy the tags and add the same complete set to every URL in the group so the annotations are reciprocal. Verify with the International Targeting report in Google Search Console.
HTML <link> tags for the page head, xhtml:link entries for an XML sitemap, and an HTTP Link header β every method Google supports
Checks each code against the ISO 639-1 language and ISO 3166-1 region shape and flags subtags that are not recognized standards
Warns when no x-default fallback is set and reminds you that hreflang must be reciprocal across every page in the group
Catches repeated language/region codes and rejects URLs that are not absolute http(s) links before they break your setup
Turn a list of URLs into a valid XML sitemap with lastmod, changefreq, and priority β ready to submit to Google Search Console. 100% client-side.
Generate SEO, Open Graph, and Twitter Card meta tags for any page, with live preview and length checks
Build valid schema.org JSON-LD for Organization, Article, Product, FAQ, LocalBusiness, Breadcrumb, and more β copy the ready-to-paste script tag. 100% client-side.
0 comments
No comments yet. Be the first to share your thoughts!