Command Palette

Search for a command to run...

HR

Hreflang Generator

Free hreflang generator for multilingual and multi-region sites - build hreflang tags as HTML link tags, XML sitemap entries, or an HTTP header. Validates codes and x-default. Runs client-side.

Language versions
Output format
hreflang tags5 versions
<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 must be reciprocal: every page in the set must link back to all the others, including itself.
hreflangURLStatus
x-defaulthttps://example.com/ Valid
en-UShttps://example.com/us/ Valid
en-GBhttps://example.com/uk/ Valid
fr-FRhttps://example.com/fr/ Valid
de-DEhttps://example.com/de/ Valid
Category:seo
Mode:Offline
Version:1.0.0
Access:Free

What is the Hreflang Generator?

Hreflang Generator interface on Toolz.dev - Free hreflang generator for multilingual and multi-region sites - build hreflang tags as HTML link tags, XML sitemap entries, or an HTTP header. Validates codes and x-default. Runs client-side.

The Hreflang 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 this hreflang tag generator 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, check a few pages with the URL Inspection tool in Google Search Console or a site crawler that reports hreflang errors.

A short run shows what this hreflang tags generator catches. Enter x-default for https://example.com/, en-us for https://example.com/us/, en-UK for https://example.com/uk/ and fr-FR for /fr/. The output has three link tags: en-us is rewritten as en-US, en-UK is kept but flagged because UK is not a common ISO 3166-1 region code (the United Kingdom is GB), and fr-FR is dropped with the error that the URL must be an absolute http(s) URL. Fix those two rows and the set is ready to copy.

How to use the Hreflang Generator?

1

Add your language versions

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.

2

Include an x-default

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.

3

Choose an output format

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.

4

Copy and deploy reciprocally

Copy the tags and add the same complete set to every URL in the group so the annotations are reciprocal. Spot-check the live pages with URL Inspection in Google Search Console or a crawler that reports hreflang errors.

Key Features

Three Output Formats

HTML <link> tags for the page head, xhtml:link entries for an XML sitemap, and an HTTP Link header - every method Google supports

Language & Region Validation

Checks each code against the ISO 639-1 language and ISO 3166-1 region shape and flags subtags that are not recognized standards

x-default & Reciprocity Reminders

Warns when no x-default fallback is set and reminds you that hreflang must be reciprocal across every page in the group

Duplicate & URL Checks

Catches repeated language/region codes and rejects URLs that are not absolute http(s) links before they break your setup

Frequently Asked Questions

An hreflang tag tells search engines which language and regional version of a page to show a given user. It uses the rel="alternate" hreflang="x" annotation, where x is a language code (optionally with a region), so a Spanish speaker in Mexico can be served your es-MX page instead of your English one. Hreflang helps international sites avoid duplicate-content problems and rank the right page in each market.

Comments

0 comments

0/2000 characters

No comments yet. Be the first to share your thoughts!

hreflang tag generatorhreflang generatorhreflang tags generatorhreflang tagsinternational seomultilingual seox-default hreflanghreflang sitemaprel alternate hreflanglanguage region tags