Window navigator.language
Example
Get the browser language:
let language = navigator.language;
Try it Yourself »
More "Try it Yourself" examples below.
Description
The language
property returns the browser language.
The language
property is read-only.
Syntax
navigator.language
Return Value
Type | Description |
A string | The browser language: Examples: "en", "en-US", "de", "fr". |
More Examples
Display all navigator properties:
let text = "<p>Browser CodeName: " + navigator.appCodeName + "</p>" +
"<p>Browser Name: " + navigator.appName + "</p>" +
"<p>Browser Version: " + navigator.appVersion + "</p>" +
"<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>" +
"<p>Browser Language: " + navigator.language + "</p>" +
"<p>Browser Online: " + navigator.onLine + "</p>" +
"<p>Platform: " + navigator.platform + "</p>" +
"<p>User-agent header: " + navigator.userAgent + "</p>";
Try it Yourself »
Browser Support
navigator.language
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |