Skip to content

Hreflang Generator

Build correct hreflang annotations for your international or multi-language pages. Add each URL with its language and (optional) region, then generate an HTML <link> block or an XML sitemap alternate block - ready to paste straight into your site.

Add URL + language/country

CSV columns: url,lang,country

Output

HTML: paste the block into your shared <head> template. XML: paste the block inside each <url> and ensure <urlset> declares xmlns:xhtml="http://www.w3.org/1999/xhtml".

What is Hreflang?

Hreflang is an HTML attribute used to tell search engines which language and regional version of a webpage should be shown to users in different locations. It helps Google and other search engines serve the right version of your content to the right audience, avoiding duplicate content issues and improving the user experience.

For example:

When properly implemented, hreflang tags:

You can add hreflang annotations in three main ways:

  1. HTML <head> - Adding <link rel="alternate" hreflang="..."> tags to each page.
  2. HTTP Headers - Useful for non-HTML content like PDFs.
  3. XML Sitemaps - Declaring language and regional alternates directly in your sitemap.

For this to work, hreflang must be reciprocal, meaning that each version of a page must list the others (including itself) in its hreflang set.

Get in touch

Send me a message and I'll reply within 24 hours.