# HTML lang attribute

> The lang attribute on the `<html>` element declares the language of a page. Screen readers, translation tools and search engines rely on it.

- **Check ID:** S16
- **Area:** [SEO](https://be1st.ai/glossary/seo)
- **Tool:** [SEO + Security + Performance](https://be1st.ai/tools/ssp-audit)
- **Page:** https://be1st.ai/glossary/seo/html-lang-attribute

## Why it matters

The lang attribute helps search engines serve the page to the correct language audience. Screen readers use it to select proper pronunciation. Without it, search engines may serve the page to the wrong audience.

## In practice

A Slovak website without lang='sk' may be shown by Google to German or Czech users. Global companies like IKEA set the lang attribute on every language version of their site (lang='sk', lang='cs', lang='de').

## How be1st checks it

Checks for the presence of the lang attribute on the HTML element (e.g., `<html lang='en'>`). This attribute defines the language of the page content for search engines and assistive technologies. The check compares the declared language with the actual language of the text and warns when they disagree (e.g. lang='en' on a Slovak site).

[SEO + Security + Performance](https://be1st.ai/tools/ssp-audit), SEO tab.

Every check ends as: Pass, Warning, Fail.

## Sources

- [HTML lang Global Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/lang) (MDN Web Docs)
- [Lighthouse SEO Audits](https://web.dev/articles/pass-lighthouse-seo-audit) (web.dev)

## Related terms

- [Favicon](https://be1st.ai/glossary/seo/favicon): A favicon is the small icon of a website that browsers show in tabs and bookmarks and Google shows next to the site name in results.
- [Status code and broken links](https://be1st.ai/glossary/seo/status-code-and-broken-links): An HTTP status code is the server's three-digit answer to a request, such as 200 (OK) or 404 (not found). A broken link points to a page that answers with an error.
- [robots.txt](https://be1st.ai/glossary/seo/robots-txt): robots.txt is a plain text file at the root of a website that tells crawlers which parts of the site they may and may not visit.
- [sitemap.xml](https://be1st.ai/glossary/seo/sitemap-xml): An XML sitemap is a file that lists the important URLs of a website, so search engines can find them without relying on links alone.
- [HTTPS (SEO)](https://be1st.ai/glossary/seo/https): HTTPS is the encrypted version of HTTP. It protects data between the browser and the server, and browsers mark sites without it as not secure.
- [WWW consistency](https://be1st.ai/glossary/seo/www-consistency): WWW consistency means a website answers on one host name only, either with www or without it, and redirects the other version there.
