Skip to main content
KalkuNet

hreflang Tag Generator — ISO Code Validation, x-default and Google's Three Formats

Build hreflang annotations with ISO 639-1 / 3166-1 checks (en-UK → en-GB), x-default and self-reference checks, as HTML <link>, an XML sitemap or an HTTP Link header.

Runs in your browserWeb · SEO & Metadata

Language versions of the page

✓ id-ID — Indonesian (Indonesia)

✓ en-GB — British English

✓ en-US — American English

✓ x-default — default for other languages

Paste many lines at once
Format:

Put the same block in the <head> of every page in this group; that way each page refers to itself and to all its alternates.

When to use the hreflang Tag & ISO Region Generator

  • Codes checked against the official lists

    Languages are matched against ISO 639-1 and regions against ISO 3166-1. Common mistakes are explained with the fix: en-UK becomes en-GB, jp becomes ja-JP, en_US becomes en-US, in becomes id.

  • The three formats Google accepts

    Choose <link> tags in HTML, an XML sitemap with xhtml:link, or an HTTP Link header for files such as PDFs. The content is the same; one method is enough.

  • A complete group

    A missing x-default, duplicate codes, relative URLs and pages that do not list themselves are flagged, because Google ignores annotations that do not point back to each other.

  • Fast entry

    Add rows one by one, or paste a “code URL” list from a spreadsheet. URLs with spaces or non-Latin letters are encoded automatically.

Frequently asked questions

Indonesian: id or in?

id. The code in was replaced long ago in ISO 639-1; use id, or id-ID to name the country.

Is x-default required?

Not required, but recommended for a language picker or a default version for visitors whose language matches none of the versions.

Does hreflang replace the canonical?

No. Each language version keeps a canonical to itself; hreflang only says which version serves which language and region.

Can I use a country code alone, such as ID?

No. hreflang always starts with a language code; the region is only an addition, for example en-ID for English speakers in Indonesia.

Learn more