Canonical & Hreflang Tag Generator

Tell search engines which language or country each version of a page is for. Everything runs in your browser; nothing you enter is uploaded or stored.

  • Free, no sign-up
  • Runs in your browser
  • Verified
Use the address of the page the tags will be pasted into. It is different on each version.
Codes: an ISO 639-1 language such as en, optionally with an ISO 3166-1 region such as GB, or x-default.

How to use it

  1. Enter every version of the page, one per line, as a language code, a | sign and the full address.
  2. Optionally enter this page’s canonical address.
  3. Copy the tags into the <head> of every version of the page.

How it works

Each line becomes a link element with rel="alternate" and an hreflang value. Language codes are tidied (language in lowercase, region in uppercase). According to Google’s documentation (read on 2026-11-22, last updated 2026-09-21): alternate URLs must be fully qualified including http or https; each language version must list itself and all other versions; links must be reciprocal; only ISO 639-1 language codes and ISO 3166-1 Alpha 2 region codes are supported (so es-419 is not); and x-default can mark the page for visitors whose language is not listed.

Examples

  • en-GB | https://example.com/uk/ becomes <link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />.

Limitations

  • This tool only writes the tags. It cannot check that every page actually links back, or that the pages exist.
  • Hreflang is a hint; search engines may ignore it. The canonical tag is also a hint.
  • The canonical address should be the page’s own address, and not point to a different version unless you intend that.

References

Last verified . See our Accuracy & Editorial Policy. Found a problem? Email [email protected].