Tool

What the Hreflang Tag Generator does

Hreflang Tag Generator: generates Alternates from One per line: language-REGION | URL. Example: the sample loaded on the page gives alternates 4.

The inputs are One per line: language-REGION | URL; the output is Alternates. Values update as you type, so comparing options is a matter of editing one field.

Typical users are anyone tuning a snippet. What Google displays is rarely exactly what you wrote, and the difference costs clicks.

There is no account, no upload and no server round trip, because the page does the work itself.

The field reference, the method and a worked example using the default inputs follow the tool itself.

What do the Hreflang Tag Generator fields mean?

The Hreflang Tag Generator uses 1 input. Sensible defaults are loaded up front, which means you can change one number at a time instead of filling the whole form first.

FieldWhat to enterDefault
One per line: language-REGION | URL paste or type any amount of text en-us | https://example.com/ en-gb | https://example.com/uk/ de-de | https://example.com/de/ x-default | https://example.com/

How does the Hreflang Tag Generator work?

Alternates ← f(One per line: language-REGION | URL)

Each output is derived from the inputs above in a single pass; there is no hidden state carried between runs, so the same inputs always give the same generated output.

An empty or malformed field stops the calculation rather than being treated as zero.

Worked example

These are the values the Hreflang Tag Generator loads by default, and the result it produces from them. These are the exact values loaded when the page opens, and the answer they produce.

Inputs
One per line: language-REGION | URLen-us | https://example.com/ en-gb | https://example.com/…
Result
Alternates4

The reciprocity rule that trips up almost every implementation

hreflang has one structural requirement that is simple to state and easy to violate at scale: every page in a language/region set must link to every other page in that set, including a link back to itself.

Worth knowing

  • If page A points to page B via hreflang but B does not point back to A, Google treats the relationship as unconfirmed and may ignore the annotation for that pair entirely. A one-directional hreflang link is effectively a broken one.
  • This becomes a real maintenance problem at scale: adding a new regional page means updating the hreflang block on every existing page in the set, not just the new one, and a step missed in that process silently breaks reciprocity.
  • x-default names the fallback for visitors whose language or region is not explicitly covered. It is optional but strongly recommended. Without it, Google has to guess which variant to show an unmatched visitor.
  • Codes should follow ISO 639-1 for language, optionally paired with ISO 3166-1 for region (en-gb, not en-uk): a country code where a language code is expected is a common, easy typo.
  • hreflang URLs must be absolute, and like canonical tags, hreflang is a strong signal rather than an absolute directive: inconsistent signals elsewhere (a canonical tag pointing cross-language, for instance) can undermine it.

How to use it

  1. Paste your content into One per line: language-REGION | URL.
  2. There is nothing to click. The answer keeps pace with your edits.
  3. Read Alternates in the results panel.
  4. Print gives a tidy version without the navigation, which is handy for attaching to a file.

What this tool does not do

  • This inspects the markup you supply; it cannot see server headers or your live rankings.
  • Search engines weigh hundreds of signals. No single on-page check predicts position.
  • There is no history: reload the page and the previous run is gone.

Frequently asked questions

Just One per line: language-REGION | URL. Nothing starts empty, so the quickest approach is to replace the one number you actually care about.

With the values loaded when the page opens, alternates comes out as 4. Overwrite any of the starting values and the result follows.

No. Disconnect from the internet and it still works; that is the simplest proof there is no server call.

No payment and no login. Advertising covers the running costs.

There is no estimation step. The result is computed, not inferred.

YoursTools Team
Product & Engineering

Builds and maintains every calculator on YoursTools.