Skip to content

This translation has not been editorially reviewed yet. The German version is authoritative. Deutsche Fassung →

Checking html lang: marking up the page's language

The lang attribute on the html element names the page's language. Search engines use it for classification, screen readers for pronunciation. The check verifies whether it's set and contains a valid language code.

  • The effort is one attribute, the effect is substantial: with no value set, a screen reader may read German text aloud using English pronunciation rules — at that point, it's no longer understandable.
  • On multilingual websites, the most common mistake is that the second language version inherits the first one's value. This nearly happened to us ourselves when building the English version.

FAQ

Which language code is correct?

The code for the text's actual language, "de" or "de-AT", say. Regional suffixes are allowed, but only make sense if the version genuinely differs by region.

What about individual foreign-language sections?

They get their own lang attribute on the surrounding element. That's a separate WCAG criterion, covered on the page about page language in the Accessibility audit area.

Deutsche Fassung — mit allen Prüfpunkten dieses Themas