What is hreflang and when should you use it?

hreflang tells search engines that several canonical URLs are language or regional alternatives. It helps them show the suitable version to a user. It does not translate content, replace a canonical, or automatically redirect visitors.
Use it when equivalent pages exist for different languages or country variants, such as English for the United States and United Kingdom. Every page should reference itself and all alternatives with valid language or language-region codes, and the annotations should be reciprocal. An optional x-default can identify a fallback selector or default page.
Each referenced URL should be crawlable, indexable, and canonical in its own language. Keep the same cluster in HTML, HTTP headers, or XML sitemaps rather than publishing conflicting sets. Do not use hreflang for unrelated pages or minor navigation translations with unchanged main content.