Modern Niche World MNW

Hreflang Tag Generator

List each language or regional version of a page with its address, plus an x-default. Every code is checked against the standards before the tags are written.

Versions of the page

    Codes: a two-letter language (ISO 639-1), optionally a hyphen and a two-letter region (ISO 3166-1), such as fr, en-GB or es-ES. Up to 300 rows.

    Everything happens on this page, on your device: nothing you type is sent or saved, and no address is visited or checked online.

    Tell search engines which page is for which language

    When a page exists in several languages, or in versions for different countries, hreflang annotations tell search engines which version to show to whom, so a visitor in Lyon gets the French page and one in Leeds the British one. They’re easy to get wrong: one mistyped code or a page that doesn’t list the others, and they can be ignored. This tool checks the set, then writes it.

    How to use it

    1. Add a row for each version: its language code and its full address.
    2. Add an x-default address for everyone else, if you have one.
    3. Fix anything in red. Each row shows what its code means, so a wrong code stands out.
    4. Choose link tags, a sitemap or a Link header, then copy or download the result.

    What it checks

    • Codes against the standards: the language must be one of the ISO 639-1 two-letter codes, and the region one of the ISO 3166-1 country codes. Common mistakes get their own message: en-UK, a country code as the language, an underscore, a three-letter code.
    • Look-alikes: uk is Ukrainian and ca is Catalan, so they’re pointed out when used without a region.
    • Repeats: each language and region can have only one address.
    • Addresses: each must be a full address starting with https:// or http://, as Google requires.
    • x-default and generic versions: a missing x-default is flagged, and so is a set like en-US and en-GB with no plain en.

    Good to know

    • The same block goes on every page. Each version lists all the others and itself, so you never need a different set per page.
    • Codes are tidied to the usual style, with the language lowercase and the region in capitals: en-gb becomes en-GB.
    • Script codes, as in sr-Latn, are let through but not checked against a list.
    • Use each page’s real address, the one in its canonical tag, written the same way on every page, with or without www and a final slash.
    • Nothing is checked online. The tool can’t tell whether a page exists or links back; check that on your site.
    • Accents in an address? The URL Encoder shows how it’s percent-encoded; the Link header uses that form.

    Frequently asked questions

    Why does every page list itself?
    Google’s guidance asks for it: each language version should list every version, itself included. If the French page points to the German one, the German page must point back, or search engines may ignore the pair. That’s why the same block goes on every page in the set.
    What is x-default for?
    It names the page for visitors whose language or region isn’t in your list, such as a language chooser or your main page. It’s optional, but Google recommends it. It can be the same address as one of your languages.
    Why is en-UK an error?
    The region part must be an ISO 3166-1 country code, and the code for the United Kingdom is GB, so English for the United Kingdom is en-GB. The tool checks every language and region against the standard lists and explains each mistake it finds, such as a country code used as a language.
    Which of the three outputs should I use?
    Use one method per page, whichever suits your site. Link tags go in the head section of each HTML page. A sitemap keeps the annotations out of your pages, which helps on big sites. The HTTP Link header is for files that have no head section, such as PDFs, and is set in your server’s configuration.