SEO Tool
Hreflang Tag Generator
HTML hreflang tags for multilingual pages. Use it online on EasyTools99.
Tool area
Everything runs in the browser.
Reference results
| Input | Result |
|---|---|
Language = it
URL = https://example.com/it/visite/ | <link rel="alternate" hreflang="it" href="https://example.com/it/visite/"> |
Language = en-GB
URL = https://example.com/en-gb/visits/ | <link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/visits/"> |
Language = x-default
URL = https://example.com/visits/ | <link rel="alternate" hreflang="x-default" href="https://example.com/visits/"> |
Language = en-CA
URL = https://example.com/en-ca/registration/ | <link rel="alternate" hreflang="en-CA" href="https://example.com/en-ca/registration/"> |
Language = fr-CA
URL = https://example.com/fr-ca/inscription/ | <link rel="alternate" hreflang="fr-CA" href="https://example.com/fr-ca/inscription/"> |
Language = it-IT
URL = https://example.com/it/calendario/ | <link rel="alternate" hreflang="it-IT" href="https://example.com/it/calendario/"> |
How it works
The generator inserts a language code and an absolute URL into an alternate link element. Use a language code for a translation with a general audience, and add a region when a separate page genuinely serves that market. Generate a line for every equivalent URL and place the full set in the head of each version, including its own line. An x-default line can point to a language chooser for visitors whose preferences have no listed match.
Worked examples
- A museum publishes the same tour in Italian and English. An editor makes the lines for the two tour pages and compares their source before release so that each lists itself and its counterpart. The museum can then link to each tour from the appropriate listings page without mixing up the tour URLs.
- A ticket seller has a general English page and opens a British edition with different availability and booking arrangements. The publisher assigns en-GB only to the British edition and leaves the general language code on the original page. The two editions can then show their own booking details while staying in the same group.
- A travel site uses a language chooser to handle visitors without a matching edition. Its developer adds the chooser as x-default, then selects several languages to check that it opens the matching tour in each edition. A generic homepage would lose that connection to the tour.
Common mistakes
- A country code on its own leaves out the language. In en-GB the first part is English and the second part identifies the region.
- A relative path or a staging URL leaves the published counterpart unclear. Copy the complete final URL from the live version.
- Publishing the tags on just one version leaves the alternate links incomplete. Inspect the other editions for the corresponding return links.
FAQ
Should I include a link to the current page?
Yes. Include each page's own URL in the group along with all the equivalent versions. Compare the sets after publishing them.
Can I link different topics because they use different languages?
Choose pages that serve the same purpose. A ticket page and a general contact page belong to different groups even if a visitor can navigate between them.
Does the tool test the destination?
It generates a line of HTML from the two inputs. Check the status, final URL and return links on the published pages separately.
