🧰Locly

Hreflang Tag Generator

Generate hreflang tags for HTML, sitemaps or HTTP headers

en | https://example.com/ en-GB | https://example.com/uk/

About This Tool

Hreflang Tag Generator builds HTML head tags, XML sitemap xhtml:link entries, or HTTP Link headers from pasted language|URL lines, with x-default and code checks (including en-UK β†’ en-GB). No network requests β€” paste only. Runs locally in your browser.

How to Use

  1. Paste language | URL lines
  2. Optionally set x-default
  3. Generate and pick HTML, sitemap, or header output
  4. Fix any validation warnings
  5. Copy the tags

Common Use Cases

  • SEO: Publish alternate language annotations
  • Migrations: Rebuild hreflang after URL changes
  • Sitemaps: Emit xhtml:link blocks
  • Headers: Produce Link values for CDNs
  • QA: Catch bad region codes like en-UK

FAQ

Q1: Why is en-UK wrong β€” should it be en-GB?

Language tags use ISO region codes. United Kingdom is GB, not UK, so British English is en-GB.

Q2: Does this crawl my site?

No. Paste language codes and absolute URLs only β€” no network requests are made.

Q3: What formats can I export?

HTML link tags for <head>, xhtml:link entries for XML sitemaps, or an HTTP Link header.

Q4: Is my data uploaded?

No. Everything runs locally in your browser and is never uploaded.

Q5: What is x-default?

An optional fallback locale for users whose language is not listed in your hreflang set.

Related Tools