Tools

Hreflang Generator

Build a hreflang tag block for multilingual pages, without formatting mistakes.

Why does hreflang matter for a multilingual website?

If your site has an Indonesian and an English version of the same page, hreflang tags tell Google which version to show a searcher based on their language or region. Without correct hreflang tags, Google can show the wrong language version, or even treat the two pages as duplicate content.

Frequently asked

Questions about the Hreflang Generator

Is x-default required?

It's not required, but recommended — x-default points to a fallback version for visitors whose language doesn't match any of the versions you've listed.

What format should the language codes use?

Use ISO 639-1 codes (e.g. "id", "en"), optionally combined with an ISO 3166-1 country code if needed (e.g. "en-us", "en-gb").

Do hreflang tags need to be reciprocal?

Yes, this is required — if page A points to page B via hreflang, page B must point back to page A too. Otherwise Google may ignore the tags entirely.

Can I put hreflang in my sitemap.xml instead of the HTML?

Yes, that's a valid alternative — actually recommended for large sites, so you don't add overhead to every single HTML page.

My site only has one language — do I need this tool?

No. Hreflang exists specifically for sites with multiple language versions of the same page — if your site only has one language, there's no "other version" to compare against, so this tag simply doesn't apply to you.