Hreflang Tag Generator
Generate alternate-language link tags from locale and URL pairs.
Result
How to use
- Put one locale and full alternate URL on each line, separated by a space.
- Select Run tool to generate the output.
- Review the output before copying it.
How it works
Generate alternate-language link tags from locale and URL pairs. Validate locale shape and full URLs, then build one tag per locale.
Formula or processing rules
Validate locale shape and full URLs, then build one tag per locale.
Worked example
The sample creates alternates for en-US and x-default using the two supplied URLs.
| Measure | Value |
|---|---|
| Locale and full URL separated by a space, one pair per line | en-US https://example.com/en/ x-default https://example.com/ |
| Result | <link rel="alternate" hreflang="en-US" href="https://example.com/en/"> <link rel="alternate" hreflang="x-default" href="https://example.com/"> |
Before using the result
List the equivalent localized pages. Verify the locale on each line, add a self-reference, and check that each alternate lists the corresponding targets in return.
Pros and cons
Pros
Generate alternate-language link tags from locale and URL pairs. The sample provides an immediate check of the expected output.
Cons
Check supported locale codes and reciprocal links across the published page versions.
Limitations and troubleshooting
Use locale labels that match the intended language or region, and check that each URL resolves to the corresponding page.
Common issue and what to check
Resolve duplicate locale entries and incomplete URLs. Run a published-page check separately because the generator cannot verify reciprocal tags.
Check distinct alternate and preferred URLs
Frequently asked questions
Do all language versions need return links?
Check that the alternate versions reference one another where appropriate. Generating tags for one page does not publish return tags on the other versions.
What rule does the Hreflang Tag Generator apply?
Validate locale shape and full URLs, then build one tag per locale.
What should I see in the Hreflang Tag Generator example?
Yes. Select Try a sample to load the worked example and see the expected result.
What should I verify after using Hreflang Tag Generator?
Check supported locale codes and reciprocal links across the published page versions.
Is my input stored by the tool?
The transformation is computed in the open page. The tool does not save the submitted text.