Hreflang Tag Generator
Generate alternate-language link tags from locale and URL pairs.
Result
How to use Hreflang Tag Generator
- Enter the values in the order shown in the input label or try the built-in sample.
- 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.
Troubleshooting
Check the input format and compare your case with the built-in sample. Check supported locale codes and reciprocal links across the published page versions.
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.
Frequently asked questions
How do I use the text I get back?
Copy the output into the document, list, or compatible tool where you need it.
How does the transformation work?
Validate locale shape and full URLs, then build one tag per locale.
Can I try a sample first?
Yes. Select Try a sample to load the worked example and see the expected result.
What should I check before using the result?
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.