Language Detector API
Guesses the language of text on the device.
In one line
Can guess the language of text on your device, without sending it away
Guesses the language of text on the device.
Local detection with confidence scores.
What it can and can't do
What the user does: You tap a button like Translate this page or Detect language
It can
- Guess the language of a text snippet with a confidence score
- Choose the right language before translating
- Download the small model the first time
It cannot
- Start without a click or tap on the page
- Send the text to a server for this check
- Work in Firefox, Safari or on Chrome for Android
- Be sure with very short or mixed language text
How it differs between platforms: Chrome and Edge on computers only.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 138 | 2025-06-24 | Availability may be subject to geographical restrictions. |
| Edge | Supported | 148 | 2026-05-07 | None |
| Firefox | Not supported | Not available | Not listed | None |
| Safari | Not supported | Not available | Not listed | None |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Not supported | Not available | Not listed | None |
| Samsung Internet | Not supported | Not available | Not listed | None |
How a site asks for it
| API | LanguageDetector.create(); d.detect(text) |
| Permissions policy | language-detector |
| Browser compat keys | api.LanguageDetector |
| How access is granted | gesture |
| What the user sees | Model download on first use |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | Yes |
| How long it lasts | Per origin |
| How to take it back | Site settings |
| Inside an iframe | Same as top level; cross-origin iframes need a permissions policy where listed |
Typical flow
- Call the API
- Browser applies its access rules
- Page receives the result
Data you get
What comes back: Guesses the language of text on the device.
Shape: object
How often: on demand
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
detectedLanguage | string | None | BCP 47 | Not listed |
confidence | float | None | 0 to 1 | Not listed |
Technical limits
- Desktop only
The story
What it is
A page can guess which language a piece of text is written in, without sending it away.
For you
You do not see it. The site may offer to translate a message or page because it spotted another language. It works without sending your text to a server.
For makers
Makers use it to route text to the right translator, show the right keyboard or tag content. Doing it on device saves cost and keeps text private. The small model may need a download first.
Where you see it
| Type | Example | Apps |
|---|---|---|
| social | A social site spots a post in Spanish and shows a Translate button for an English reader. | X |
| messaging | A web chat detects a friend's message language and offers a translation. | WhatsApp Web |
| games | A browser game chat guesses the language of players and routes them to the right room. | None named |
| shopping | A store marks reviews by language so you can filter to those you can read. | Amazon |
| news | A news reader picks the right text to speech voice for each article. | None named |
| education | A learning site checks that an answer is in the right language for the lesson. | Duolingo |
| security | A moderation tool detects language before checking a post against the right rules. | None named |
Risks
- Can guess wrong
- Needs a model download
What the platform says
- Google Chrome: Language Detector API. Detects the language of text on the device, so sites can offer the right translation without a cloud call.
Good uses and abuse
Legitimate uses
- Routing translation
Known abuse
- None
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 2 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2025-06, Chrome 138: Stable (Edge 148)
Sources
How well checked: Checked against real behavior.