Preferences

Privacy is important to us, so you have the option of disabling certain types of storage that may not be necessary for the basic functioning of the website. Blocking categories may impact your experience on the website. More information

Accept all cookies

Free Hreflang Tag Generator - Build Correct Multilingual Tags

Generate hreflang tags for free. Build valid annotations for every language and region version of a page, with x-default, correct codes and reciprocal links.

Thibault Besson-Magdelain fondateur de Sorank

About Author

Thibault Besson-Magdelain

Founder of Sorank, 5+ years of experience in SEO, GEO enthusiast.

Learn everything to know on Hreflang Tag Generator !

Created on
14/9/26
Last update :
14/9/26
Hreflang tag generator producing link annotations for several language and region versions of a page including x-default

Hreflang is the annotation that tells search engines which version of a page belongs to which audience. Get it right and a French reader lands on the French page instead of the English one. Get it wrong and engines ignore the whole set, which is the most common outcome: the annotation is easy to write and easy to break.

The Sorank Hreflang Tag Generator builds the full block for you from your list of URLs, with the codes validated and x-default handled.

The rules that break sets

  • Annotations must be reciprocal. If the English page points to the French one, the French page must point back to the English one. A one way reference is discarded.
  • Every set must include itself. Each page lists all versions, including its own.
  • Codes follow standards, not intuition. Language codes come from ISO 639-1 and region codes from ISO 3166-1 alpha-2. The language comes first, the region second, and the region alone is never valid.
  • Only one x-default. It marks the page to serve when no other version matches the visitor.
  • URLs must be absolute and canonical. Pointing at a URL that then redirects, or at a page whose canonical names a different address, invalidates the annotation.

The mistakes that cost the most

  • Using a country code as a language: uk is not English, it is Ukrainian. The United Kingdom is en-GB.
  • Pointing at the wrong protocol or host: mixing http and https, or www and non www, across a set.
  • Annotating pages that are not translations of each other, such as a category page in one language and an article in another.
  • Forgetting x-default on sites that have a language selector, which leaves engines to guess what to show an unmatched visitor.

Where to put the tags

Three placements are valid, and one is enough. In the head of each page as link elements, which is the most common. In the HTTP response headers, which is the option for PDFs and other non-HTML files. Or in an XML sitemap, which keeps large sites manageable because the whole set lives in one file instead of being repeated on every page.

Whichever you choose, use it consistently. Mixing placements across a site is a reliable way to end up with sets that disagree.

After you publish

Check the annotations from the live pages rather than from your source files, since templates and edge rules often rewrite URLs. Then watch which version actually appears in results for each market. Hreflang is a hint about which version to show, not a ranking instruction: it does not make a page rank in a country where it has no other reason to.

Frequently asked questions

What does x-default do?

It marks the page to serve when none of the other versions match the visitor's language or region. A language selector or an international English page are the usual choices. A set may contain only one x-default, and it is optional, though it is recommended whenever visitors can arrive from unlisted markets.

Do hreflang tags improve rankings?

No. They tell engines which version of a page to show a given audience, which improves the match between searcher and page and reduces the risk that two versions compete with each other. Ranking still depends on the usual factors for each market.

Should the tags go in the head, the headers or the sitemap?

Any of the three works. Head links are the most common, headers are the answer for non-HTML files such as PDFs, and the XML sitemap is the practical choice on large sites because the whole set lives in one file. Pick one method and use it consistently.

Other Free SEO Tools