hreflangタグジェネレーター
Generators言語バージョンのリストを正しいhreflangセットに変換 — ロケールの正規化、重複検出、x-defaultの処理 — HTMLのlinkタグまたはXMLサイトマップブロックとして出力します。
One row per language version: a locale like en or de-AT and its absolute URL.
The page for users whose language does not match any row — usually the default version.
(ドキュメントは英語)
What it does
The Hreflang Tag Generator turns a table of language versions into a correct hreflang set. Type locales loosely — en-us normalizes to en-US, PT-br to pt-BR — and the tool validates the rest: each locale must be ll or ll-CC, every URL must be absolute http(s), and no locale may appear twice. Add an x-default URL for visitors whose language matches none of the rows. The output comes in two shapes: HTML <link rel="alternate"> tags for your <head>, or xhtml:link lines for an XML sitemap entry.
Everything runs 100% client-side.
How to use it
- Add one row per language version: locale on the left, absolute URL on the right.
- Optionally set the x-default URL — it is emitted last.
- Switch the output between HTML and Sitemap and copy the block.
Examples
en→https://example.com/,de-de→https://example.com/de/, x-defaulthttps://example.com/→ three link tags, withde-DEnormalized and x-default last.- Rows
enandEN→ the output listsRow 2: locale "en" is already used.and emits nothing until the duplicate is gone.
Good to know
- Google’s hreflang grammar accepts two-letter language codes, optionally with a two-letter region — script subtags and three-letter codes are rejected rather than guessed at.
- The sitemap block belongs inside a
<url>entry, next to the<loc>tag — the tool indents it accordingly. - Every error names its row number, so long tables stay fixable.