Skip to main content
Premium Tool

URL Variant Generator

Generate all locale-based URL variants from a single canonical URL and produce the complete hreflang annotation set for every variant in one step.

Loading tool…

This page explains what the URL Variant Generator does, how to produce localized URL variants from a canonical URL, the step-by-step workflow, errors that arise from variant generation, and how this generator differs from a general hreflang tag generator.

What is a URL variant generator?

A URL variant generator is a hreflang tool that creates localized URL candidates from a canonical source URL. You provide one URL — typically your primary-language page — and a list of target locales, and the tool generates the expected URLs for each locale based on your site's URL pattern. It then produces the hreflang annotation set for the entire variant group.

This tool addresses a workflow gap that many international SEO teams encounter: you know what your English page URL looks like, you know your site uses a /{locale}/ subdirectory pattern, and you need to quickly generate the full set of expected alternate URLs and their hreflang tags. Doing this manually for every page is error-prone and slow. The URL variant generator automates the expansion.

The tool supports four URL pattern types: subdirectory (/en/, /es/), subdomain (en.example.com), ccTLD (example.com, example.de), and query parameter (?lang=en). It generates HTML <link> tags, HTTP Link: headers, XML sitemap xhtml:link elements, and JSON-LD.

How to use the URL variant generator

Follow this expansion workflow:

  1. Enter your canonical URL. Paste the absolute HTTPS URL of your primary-language page. This is the starting point from which all variants will be derived.
  2. Select your URL pattern. Choose how your site structures localized URLs: subdirectory, subdomain, ccTLD, or query parameter. The tool auto-detects the pattern from your canonical URL and lets you confirm or override.
  3. Define target locales. Enter the ISO 639-1 language codes (with optional ISO 3166-1 region codes) for every locale you want to generate variants for. The tool pre-fills common locales and lets you add or remove entries.
  4. Review generated variants. The tool expands your canonical URL into one variant per locale. For subdirectory patterns, /en/pricing becomes /es/pricing, /de/pricing, /fr/pricing, and so on. Review each generated URL and correct any that do not match your actual site structure — especially pages with translated slugs.
  5. Validate and generate hreflang output. The tool validates every variant URL for format correctness, checks for duplicate locales, generates self-references, and produces the hreflang set. Export in your preferred format.

Common errors and how to fix them

URL variant generation can introduce errors when the generated URLs do not match reality:

  1. Generated URLs that do not exist. If the tool generates /fr/pricing but your French pricing page is actually at /fr/tarifs (a translated slug), the generated URL points to a 404. Always verify that each generated variant URL matches the actual URL on your server. The tool flags this risk and prompts you to confirm each variant.

  2. Incorrect pattern detection. If your canonical URL is https://en.example.com/pricing and the tool detects a subdomain pattern, but your German site is at https://example.de/preise (a ccTLD with a translated path), the subdomain pattern generates incorrect variants. Override the auto-detected pattern and, if needed, manually edit individual variant URLs.

  3. Missing locale in the pattern. If your canonical URL is https://example.com/pricing with no locale indicator, the pattern detector cannot determine where the locale belongs. In this case, specify the pattern manually — for example, "subdirectory before the first path segment" — and the tool inserts the locale code accordingly.

  4. Duplicate locale codes from overlapping entries. If you enter both en and en-US as target locales and your URL pattern generates /en/pricing and /en-us/pricing, you have two English variants that may or may not represent the same content. The tool warns when locale entries overlap in language without differentiation in region.

  5. Protocol mismatches in ccTLD variants. When generating ccTLD variants, the tool assumes HTTPS for all domains. If one of your ccTLD domains does not support HTTPS, the generated variant URL is unreachable. The tool flags all non-HTTPS situations but cannot verify SSL certificate status.

How this tool is different

The URL variant generator automates the expansion from one URL to many:

For manually entering known URLs rather than generating them from patterns, use the hreflang tag generator. For auto-discovering which URLs are alternates of each other from a flat list, see the alternate mapping generator.

Frequently asked questions

  • What is a URL variant in the context of hreflang?
    A URL variant is a locale-specific version of a page — for example, example.com/en/pricing and example.com/de/pricing are variants of the same page.
  • How does the generator create variants from one URL?
    You provide a canonical URL pattern and a list of locale codes. The generator applies each locale to the pattern and produces every resulting URL.
  • What URL patterns does the generator support?
    It supports subdirectory patterns (/en/path), subdomain patterns (en.example.com), and TLD patterns (example.co.uk) with customizable templates.
  • Can I customize the URL template per locale?
    Yes. Override the default pattern for any locale that uses a different structure — for example, use a ccTLD for Germany while keeping subfolders for others.
  • Does the generator validate that variant URLs exist?
    It validates URL syntax. Optionally enable live checks to send HEAD requests and confirm each variant resolves to a 200 status.
  • How many locale variants can I generate at once?
    There is no practical limit. The generator handles dozens of locales and thousands of source URLs in a single batch.
  • What output does the generator produce?
    A complete hreflang annotation set for each source URL — available as HTML link tags, HTTP headers, XML sitemap entries, or a downloadable CSV.
  • Does it include x-default in the generated set?
    Yes. You designate one locale or a custom URL as x-default, and the generator includes it in every annotation set.
  • Can I preview the generated variants before exporting?
    Yes. The preview table shows every source URL, its generated variants, and any validation warnings before you commit to an export.
  • What if some locales share the same URL?
    The generator detects duplicate variant URLs across locales and warns you, because hreflang requires each locale to point to a distinct URL.

Related tools