hreflang Generator and Validator
Turn a list of languages and URLs into hreflang link tags, HTTP Link headers or sitemap entries, checking the language codes, absolute URLs and x-default.
Runs in your browser: input and output are never sent to the server, and the platform does not store your input.
Output
Fill in the fields on the left, then run.
How to use
- 1List each language version's code and URL on its own line, and set an x-default.
- 2Pick a format: <link> tags for HTML pages, HTTP headers for PDFs and other non-HTML files, sitemap entries for large sites.
- 3Put the same complete list on every page in it — including the line that points at itself.
FAQ
Why does every page need the full list?
hreflang is a reciprocal declaration. If page A says B is its English version, B must say A is its Chinese one, or Google ignores the whole set. The list must also include the self-referential line.
What is the difference between zh-TW and zh-Hant?
zh-TW is Chinese as used in Taiwan; zh-Hant is traditional Chinese regardless of region. Use zh-TW if the content is written for Taiwanese readers; zh-Hant covers Taiwan, Hong Kong and Macau together.
Why is en-UK wrong?
The region subtag must be an ISO 3166-1 country code, and the United Kingdom is GB, not UK. A line with the wrong code is ignored entirely.
Does hreflang replace canonical?
No — use both. Each language version should have its own canonical, with hreflang describing how they relate. Pointing every language's canonical at one page makes the other versions disappear.
Is my input uploaded?
No. Generation and validation run entirely in your browser; no sign-in and no quota.
