A decade of Canvas at your command — powered by our custom AI engineStart Building →

SEO Tool

Hreflang Tag Generator

Generate hreflang HTML link tags and XML sitemap tags for international SEO. Add multiple language and country targets, configure x-default, and copy ready-to-paste markup for your multilingual website.

How to use this tool

  1. 1

    Enter your base page URL — the canonical URL of the page you're adding hreflang to.

  2. 2

    Add language and country targets. Select the language (e.g. English), country (e.g. US), and the URL for that specific version.

  3. 3

    Use 'Any' for country when the page targets a language without a specific region (e.g. Spanish for all Spanish-speaking countries).

  4. 4

    Enable x-default to specify the fallback page for users whose language/region doesn't match any target.

  5. 5

    Click 'Generate Hreflang Tags' to create both HTML link tags and XML sitemap tags.

  6. 6

    Copy the HTML tags into your <head> section, or use the XML version in your sitemap.

Frequently Asked Questions

What are hreflang tags?

Hreflang tags are HTML link elements that tell search engines which language and regional version of a page to show to users in different countries. They use the format <link rel="alternate" hreflang="en-US" href="..."> where the hreflang value combines an ISO 639-1 language code with an optional ISO 3166-1 Alpha-2 country code. Google and Yandex use hreflang; Bing uses the content-language meta tag instead.

What is x-default hreflang?

The x-default hreflang tag specifies the default page to show when no other language/region variant matches the user's browser settings. It's typically pointed at your English-language or international version of the page. Google recommends including x-default on every page that has hreflang annotations. Format: <link rel="alternate" hreflang="x-default" href="https://example.com/page">.

Where do I place hreflang tags?

Hreflang tags can be implemented in three ways: 1) HTML link tags in the <head> section of each page (most common), 2) HTTP headers (for non-HTML files like PDFs), or 3) XML sitemap using xhtml:link elements. For most websites, HTML link tags are the simplest. For large sites with thousands of pages, the XML sitemap method is more efficient. Every page must reference itself and all its alternate versions.

Build SEO-optimised websites with Canvas Builder

Canvas Builder generates production-ready HTML pages with proper meta tags, schema markup, and semantic structure built in.

Try Canvas Builder