Skip to content
ToolsOnDuty - free online tools

Search tools

Loading tool search...

Web & SEO

Hreflang Generator

Generate alternate-language link tags from locale and URL pairs.

Free browser toolRuns in your browserNo sign-up
Alternate links
<link rel="alternate" hreflang="en-US" href="https://example.com/us/page">
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/page">
<link rel="alternate" hreflang="x-default" href="https://example.com/page">

About the Hreflang Generator

Hreflang Generator turns language or locale codes and absolute URLs into copy-ready rel=alternate link elements.

Every alternate page should normally list itself and all reciprocal alternatives, with x-default where appropriate.

Use one locale,URL pair per line with a single field-separating comma. The formatter inserts the supplied strings into quoted attributes; it does not validate codes/URLs or escape arbitrary quote characters. Review clean values and generated HTML before publishing.

There is no network fetch or reciprocal-cluster/canonical validation. Adding x-default or copying generated tags does not prove the target pages are equivalent, reachable, indexable or configured correctly.

Key features

  • Language-region code input
  • x-default support
  • Format supplied alternate URL values
  • Copy-ready HTML tags

How to use

  1. 1Enter one language code and absolute URL per line.
  2. 2Copy the generated link tags into every alternate page.
  3. 3Validate reciprocal links and canonical alignment.

Examples

Use the Hreflang Generator
Input: en-US,https://example.com/us x-default,https://example.com/
Output: <link rel="alternate" hreflang="en-US" href="https://example.com/us"> <link rel="alternate" hreflang="x-default" href="https://example.com/">

The tags format the supplied values. Build and verify the full reciprocal set separately, including each page's self-reference where appropriate.

Frequently asked questions

What is x-default?
It identifies a fallback page for users whose language or region does not match another alternate.
Must links be reciprocal?
Search engines generally expect each alternate to reference the others in the set.
Is my data uploaded?
No. Analysis and generation happen entirely in your browser.

Open a related tool to prepare your files or refine the finished result.