Skip to content

Hreflang tag generator

List each language version of a page and get the hreflang block to place on all of them, as HTML tags or sitemap entries.

Runs in your browser. Everything happens in your browser. Nothing you enter is sent to NismaCloud.

e.g. en, en-GB, sq-AL, de-AT

Where to send visitors whose language you do not offer, often a language picker or your main version.

Output
hreflang.html
<link rel="alternate" hreflang="en" href="https://example.com/en/">
<link rel="alternate" hreflang="sq" href="https://example.com/sq/">
<link rel="alternate" hreflang="x-default" href="https://example.com/">

Put the same block on every page in the set. Each page lists all versions, including itself.

How to use it

  1. 1

    Add one row per language version with its language code and full URL.

  2. 2

    Set an x-default URL for visitors whose language you do not offer.

  3. 3

    Fix any warnings about codes, URLs or duplicates.

  4. 4

    Place the same block on every version, or use the sitemap format instead.

How hreflang works

Hreflang tells search engines that pages are translations or regional variants of each other, so a German searcher gets the German page. The annotations must be reciprocal: if page A points to page B, page B must point back to A, and every page must list itself.

Codes are a language (ISO 639-1, like “de”) optionally followed by a region (ISO 3166-1, like “de-AT”). A region alone (“AT”) is invalid.

Questions

HTML tags or sitemap?

Either works. Sitemaps are easier for large sites because the annotations live in one file instead of every page.

Is “en-UK” valid?

The format is valid but the region code for the United Kingdom is GB, so use “en-GB”.

Do I need x-default?

It is optional but recommended: it tells search engines which page to show when no listed language matches.

Updated:

A website with the SEO basics already done

NismaCloud sites generate titles, descriptions, canonicals, sitemaps and structured data for every page, in every language you publish.