Specify the language of the page

Specify the default language of a web page in the code. For example, software can determine the language of the web page. If there are several languages on a page, use the language that is most common.

Reading software reads a web page. The pronunciation of the words depends on the language of the page. If no language or a wrong one is specified in the code, reading software may read the content incorrectly or unclearly. The default language of the browser is then used and it does not always match the language of the content.

Add the lang attribute to the html element to set the language of a web page. Use the correct language code in this attribute. A language code consists of a two letters.

It looks like this in the code:


Each language has its own designation. For Dutch it is ‘nl’ (lang=”nl”), for English it is ‘en’ (lang=”en”), for German it is ‘de’ (lang=”de”). View all language codes on IANA Language Subtag Registry.

In a CMS, the language of a website can be specified in the settings.