This translation has not been editorially reviewed yet. The German version is authoritative. Deutsche Fassung →
SEO
What is the language declaration in a website's HTML for?
The language declaration in HTML — the lang attribute — tells programs what language a page's text is written in. It sits right at the start of the source code, and is invisible to visitors. Screen readers choose their pronunciation based on this declaration: if it's missing, German text sometimes gets read out with English pronunciation rules, and is barely understandable.
Screen readers choose their pronunciation based on the language declaration
Blind and severely visually impaired people have websites read out by a screen reader. To do so, the program has to know what language it's speaking: the German word "Kunde" sounds completely different when pronounced by English rules. This is exactly the information the language declaration in the source code provides. If it says "de" for German, the program reads with German stress and pronunciation. If the declaration is missing, the program falls back to a default setting — often English. German text then gets pronounced word for word in English, and is tiring to incomprehensible even for experienced listeners.
Search engines and translators use the declaration too
The language declaration doesn't just help with reading aloud. Search engines use it as one of several signals to match a page to the right language region — a page marked up as German belongs in German-language search results. Browsers offer the right translation based on the declaration: if a French-speaking user visits your German page, their browser can correctly suggest "Translate from German". And hyphenation programs break words according to the rules of the declared language. Our check verifies on every page whether the declaration is present; its absence counts as a moderate shortcoming, and is fixed with a single word in the source code.
- Ask your agency to check whether the language declaration is set in every page's source code — "de" for German pages.
- For multilingual websites, make sure every language version carries its own, correct declaration.
- Also mark longer foreign-language passages within a page with their own language.
- Add the language declaration to the sign-off checklist for every new website.
FAQ
What is the lang attribute in HTML?
An invisible declaration at the start of the source code that names the language of a page's text — "de" for German, "en" for English. Screen readers choose their pronunciation based on it, browsers offer translations based on it, and search engines match the page to the right language region. Our check verifies the declaration on every page examined.
What happens on a website with no language declaration?
Screen readers then fall back to a default setting, often English, and read German text out with English pronunciation — tiring to incomprehensible for blind visitors. On top of that, search engines lack a signal for language matching, and browsers have a harder time offering the right translation. The fix consists of a single word in the source code.
Does the language declaration also affect accessibility?
Yes, the declaration is one of the basic requirements for accessible websites, since screen readers choose the wrong pronunciation without it. That's why it appears in two audit areas of our examination: search engine suitability and accessibility. Setting it improves both results with a single move.