HREF

Hreflang Generator

Generate hreflang alternate link tags

SEO & Schema
🔒 100% client-side — your data never leaves this page
Maintained by Evan•Updated: September 30, 2026
Options
Hreflang Input

Paste one `lang-region | URL` per line and generate hreflang tags first; x-default and HTTPS validation are available in Advanced mode.

Link Tags
Hreflang tags will appear here
🔒 Processed locally in your browser
Page reading mode

The full guide also includes pitfalls, worked examples, snippets, FAQs, and related tools for checking results or troubleshooting.

About this tool

Format language-code | URL rows as HTML alternate links. The default x-default option appends a fallback pointing to the first accepted URL when no x-default row is supplied. The HTTPS filter checks the URL prefix; it does not validate language codes, fetch pages or confirm reciprocal links. Review the alternate set and deploy it on each matching language version.

Production Snippets

Choose a fallback instead of inheriting the first row

text

en | https://example.com/en
zh | https://example.com/zh
x-default | https://example.com/languages

An explicit x-default row is retained. Without it, the enabled automatic option uses the first accepted URL, which may not be your language selector.

Suggested Workflow

Frequently Asked Questions

What belongs in each row?

Use a language code, optionally with a supported region, followed by | and an absolute URL, for example en-GB | https://example.com/uk. The tool preserves codes as entered and does not check a language/region registry or remove duplicates.

How is x-default chosen?

When its option is on and no x-default row exists, the first accepted URL becomes the fallback. Add an explicit x-default row to choose a language selector or another fallback. Turning the option off does not remove an x-default row you typed.

Where should the generated set be installed?

Each equivalent language or region page should reference itself and the other versions, with reciprocal links between alternates. This tool only creates text and cannot verify deployment or whether the pages are equivalent.

Does hreflang select the canonical page or redirect visitors?

No. It identifies language/region alternatives; canonical selection and redirects are separate. The HTTPS-only setting is this form’s default, not a guarantee that accepted URLs are valid or indexable.

Keep browsing