Generate hreflang

Generate reciprocal hreflang links for language and regional page variants.

freeworks offlinenothing uploaded
ToolHreflang Generator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Language and region codes become hreflang link elements or headers, with absolute alternate URLs and optional x-default. Each locale points to the complete alternate set, including itself.

  • BCP 47-style tags separate language and region.
  • x-default identifies a fallback page.

Worked example

English and Spanish alternate page tags
Generate hreflang tags linking English and Spanish versions of a page with x-default
Input
											URLs: en:https://example.com/
es:https://example.com/es/
Default lang: en
										
Output
												<!-- Hreflang tags -->
<link rel="alternate" hreflang="en" href="https://example.com/">
<link rel="alternate" hreflang="es" href="https://example.com/es/">
<link rel="alternate" hreflang="x-default" href="https://example.com/">
											

When to use this

Multilingual stores, translated docs, and international SEO audits generate hreflang.

Edge cases

  • en_UK is invalid; use hyphenated language-region syntax.
  • Missing reciprocal links weaken annotations.
  • A conflicting canonical can override localization signals.

References