Hreflang generator
Turn a list of localized URLs into hreflang link tags, with x-default advice, duplicate and reciprocity checks, plus a reference table of ISO 639-1 and ISO 3166-1 codes.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Language/region and URL list
Generates tags and check results only — no URL is ever requested.
hreflang tags
Localized versions parsed:3
<link rel="alternate" hreflang="en" href="https://example.com/en/" /> <link rel="alternate" hreflang="zh-Hans" href="https://example.com/zh/" /> <link rel="alternate" hreflang="ja" href="https://example.com/ja/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />- x-default is missing: <link rel="alternate" hreflang="x-default" href="https://example.com/" />
The reciprocity check infers a page’s own hreflang from the first path segment of its URL (/en/, /zh-hant/). URLs without a language prefix have to be verified by hand.
Code reference
af Afrikaans 南非荷兰语 am Amharic 阿姆哈拉语 ar Arabic 阿拉伯语 az Azerbaijani 阿塞拜疆语 be Belarusian 白俄罗斯语 bg Bulgarian 保加利亚语 bn Bengali 孟加拉语 ca Catalan 加泰罗尼亚语 cs Czech 捷克语 cy Welsh 威尔士语 da Danish 丹麦语 de German 德语 el Greek 希腊语 en English 英语 es Spanish 西班牙语 et Estonian 爱沙尼亚语 eu Basque 巴斯克语 fa Persian 波斯语 fi Finnish 芬兰语 fil Filipino 菲律宾语 fr French 法语 ga Irish 爱尔兰语 gl Galician 加利西亚语 gu Gujarati 古吉拉特语 he Hebrew 希伯来语 hi Hindi 印地语 hr Croatian 克罗地亚语 hu Hungarian 匈牙利语 hy Armenian 亚美尼亚语 id Indonesian 印尼语 is Icelandic 冰岛语 it Italian 意大利语 ja Japanese 日语 ka Georgian 格鲁吉亚语 kk Kazakh 哈萨克语 km Khmer 高棉语 kn Kannada 卡纳达语 ko Korean 韩语 lo Lao 老挝语 lt Lithuanian 立陶宛语 lv Latvian 拉脱维亚语 mk Macedonian 马其顿语 ml Malayalam 马拉雅拉姆语 mn Mongolian 蒙古语 mr Marathi 马拉地语 ms Malay 马来语 my Burmese 缅甸语 ne Nepali 尼泊尔语 nl Dutch 荷兰语 no Norwegian 挪威语 pa Punjabi 旁遮普语 pl Polish 波兰语 pt Portuguese 葡萄牙语 ro Romanian 罗马尼亚语 ru Russian 俄语 si Sinhala 僧伽罗语 sk Slovak 斯洛伐克语 sl Slovenian 斯洛文尼亚语 sq Albanian 阿尔巴尼亚语 sr Serbian 塞尔维亚语 sv Swedish 瑞典语 sw Swahili 斯瓦希里语 ta Tamil 泰米尔语 te Telugu 泰卢固语 th Thai 泰语 tr Turkish 土耳其语 uk Ukrainian 乌克兰语 ur Urdu 乌尔都语 uz Uzbek 乌兹别克语 vi Vietnamese 越南语 zh Chinese 中文 zu Zulu 祖鲁语
What this tool does
- After shipping localized versions of a site, generate the whole hreflang block in one go instead of hand-writing tags and missing a locale.
- Audit an existing hreflang list: spot a missing x-default, duplicated declarations, or a declared code that contradicts the URL’s language prefix.
- Look up ISO 639-1 and ISO 3166-1 alpha-2 codes so you never ship a combination like en-UK again.
Example
Input
en https://example.com/en/ zh-Hans https://example.com/zh/
Output
<link rel="alternate" hreflang="en" href="https://example.com/en/" /> <link rel="alternate" hreflang="zh-Hans" href="https://example.com/zh/" />
The same input also reports “x-default is missing” and suggests <link rel="alternate" hreflang="x-default" href="https://example.com/" />.
Frequently asked questions
Does every localized page need the full list of hreflang tags?
Yes. Google expects each language version to list every version, including a self-referencing tag. Declaring only part of the set turns the others into one-way references, which is treated as an error.
Where should x-default point?
x-default points at a language selector or the default version — usually the site root or an unlocalized landing page. It is not a language, so you should not declare a language code alongside it.
Why does the tool say reciprocity may be broken?
An offline tool cannot fetch the other pages, so it infers each page’s own hreflang from the first path segment of its URL (/en/). A page served at /en/ but declared as fr is almost certainly missing its self-reference. URLs without a language prefix are skipped and need a manual check.
Why is en-UK flagged?
UK is a common shorthand for the United Kingdom but is not an ISO 3166-1 alpha-2 code; en-GB is correct. The tool checks both parts against the common code tables and warns instead of silently accepting them.
Do the generated tags trigger any request or upload?
No. Everything is parsed and assembled locally in your browser, no URL you type is ever requested, and the list never leaves the page.
Keywords:hreflanghreflang generatoralternate hreflangx-defaulti18n seomultilingual seohreflang 生成多语言 SEO国际化标签ISO 639-1ISO 3166-1x-default 建议