navigator.languages returns an ordered array of BCP 47 language tags. Learn preference order, how it relates to navigator.language, Intl fallback formatting, languagechange, five examples, and try-it labs.
01
Kind
Read-only property
02
Returns
Array of strings
03
Baseline
Widely available
04
Order
Most preferred first
05
First item
navigator.language
06
Event
languagechange
Fundamentals
Introduction
Many users prefer more than one language: English first, then Spanish, then French. A single tag is not enough when your site ships several locales and needs a smart fallback chain.
navigator.languages returns that preference list as an array of BCP 47 strings. The first entry is the most preferred language — and MDN notes it matches navigator.language.
💡
Privacy note
MDN warns that for fingerprinting protection, some browsers may expose a shorter list (Safari often lists one language; Chrome incognito may too). Treat the array as a helpful hint, not a guaranteed full profile.
Concept
Understanding the languages Property
Think of it as an ordered “wishlist” of languages the user likes.
Array of BCP 47 tags — e.g. ["en-US", "zh-CN", "ja-JP"].
Preference order — index 0 is the top choice.
Link to language — navigator.language === navigator.languages[0] (typically).
Intl fallback — pass the array to Intl constructors for locale negotiation.
languagechange — fires on window when preferences change.
Accept-Language — HTTP header usually lists similar locales (with q values).
Foundation
📝 Syntax
General form of the property:
JavaScript
navigator.languages
Value
An array of strings (BCP 47 language tags), most preferred first.
Common patterns
JavaScript
// MDN-style listing:
console.log(navigator.language); // e.g. "en-US"
console.log(navigator.languages); // e.g. ["en-US", "zh-CN", "ja-JP"]
// Intl with preference-based fallback:
const date = new Date("2012-05-24");
const formattedDate = new Intl.DateTimeFormat(navigator.languages).format(date);
// React when the user changes preferred languages:
window.addEventListener("languagechange", () => {
console.log(navigator.languages);
});
Cheat Sheet
⚡ Quick Reference
Goal
Code
Read preference list
navigator.languages
Top preference
navigator.languages[0]
Same as language?
navigator.languages[0] === navigator.language
Intl with fallback
new Intl.DateTimeFormat(navigator.languages)
Listen for changes
window.addEventListener("languagechange", …)
Status (MDN)
Baseline Widely available
Snapshot
🔍 At a Glance
Four facts to remember about navigator.languages.
Returns
string[]
BCP 47 tags
Baseline
widely
Since ~Oct 2017
First item
language
Same preference
Event
languagechange
On window
Compare
📋 languages vs language
navigator.languages
navigator.language
Type
Array of strings
Single string
Meaning
Ordered preference list
Most preferred language
Relationship
language is the first element of languages
Best for
Fallbacks + Intl negotiation
Simple default locale
HTTP cousin
Accept-Language often mirrors the list
Hands-On
Examples Gallery
Examples follow MDN navigator.languages patterns. Prefer Try It Yourself to inspect your preference list and Intl fallback behavior.
📚 Getting Started
Read the array and compare it with navigator.language.
Example 1 — Read the Preference List
Log the array MDN-style alongside navigator.language.
navigator.languages is Baseline Widely available across modern browsers (MDN: since about October 2017). Use the ordered list for fallbacks and Intl negotiation, and remember privacy modes may shorten it.
✓ Baseline · Widely available
Navigator.languages
Read the preferred-language array, pass it to Intl for fallbacks, and listen for languagechange when settings update.
UniversalWidely available
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
languagesExcellent
Bottom line: Use navigator.languages for preference-ordered fallbacks. Use navigator.language when a single tag is enough.
Wrap Up
Conclusion
navigator.languages is the ordered list of preferred BCP 47 tags. Walk it for i18n fallbacks, pass it to Intl, and listen for languagechange when preferences update — while remembering the list may be shortened for privacy.
Baseline ordered preference list for i18n and Intl fallbacks.
5
Core concepts
🌐01
Returns
string[]
Type
📈02
Order
Best first
Prefs
💬03
First
= language
Link
📅04
Intl
Array fallback
Format
✅05
Status
Baseline
Wide
❓ Frequently Asked Questions
It is a read-only Navigator property that returns an array of BCP 47 language tags for the user’s preferred languages, ordered with the most preferred first.
No. MDN marks it Baseline Widely available (since about October 2017). It is not Deprecated, Experimental, or Non-standard.
navigator.language is the first element of navigator.languages. Use language for a single tag; use languages when you need the full preference list or Intl fallback.
Yes. MDN shows new Intl.DateTimeFormat(navigator.languages).format(date) so Intl can pick the first supported locale from the preference list.
When preferred languages change, a languagechange event fires on the Window. You can listen with window.addEventListener("languagechange", …) and re-read navigator.languages.
Not always. For privacy (reducing fingerprinting), some browsers may expose a shorter list — for example Safari often lists one language, and Chrome’s incognito mode may also limit the list.
Did you know?
MDN notes that some browsers add language-only fallbacks in the Accept-Language header (like en-US,en;q=0.9) even when navigator.languages is only ["en-US", "zh-CN"] — the header and the JS array are related, but not always identical.