Skip to Content
Platform.Ontology

Language Detector API

Guesses the language of text on the device.

Works without askingOn-device AIBuilt in AIWeb browsersWhile you use it

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

BrowserStatusFirst versionReleasedNote
ChromeSupported1382025-06-24Availability may be subject to geographical restrictions.
EdgeSupported1482026-05-07None
FirefoxNot supportedNot availableNot listedNone
SafariNot supportedNot availableNot listedNone
Safari on iPhoneNot supportedNot availableNot listedNone
Chrome on AndroidNot supportedNot availableNot listedNone
Samsung InternetNot supportedNot availableNot listedNone

How a site asks for it

APILanguageDetector.create(); d.detect(text)
Permissions policylanguage-detector
Browser compat keysapi.LanguageDetector
How access is grantedgesture
What the user seesModel download on first use
Needs a secure context (HTTPS)Yes
Needs a user gestureYes
How long it lastsPer origin
How to take it backSite settings
Inside an iframeSame as top level; cross-origin iframes need a permissions policy where listed

Typical flow

  1. Call the API
  2. Browser applies its access rules
  3. Page receives the result

Data you get

What comes back: Guesses the language of text on the device.
Shape: object
How often: on demand

FieldTypeUnitRangePrecision
detectedLanguagestringNoneBCP 47Not listed
confidencefloatNone0 to 1Not 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

TypeExampleApps
socialA social site spots a post in Spanish and shows a Translate button for an English reader.X
messagingA web chat detects a friend's message language and offers a translation.WhatsApp Web
gamesA browser game chat guesses the language of players and routes them to the right room.None named
shoppingA store marks reviews by language so you can filter to those you can read.Amazon
newsA news reader picks the right text to speech voice for each article.None named
educationA learning site checks that an answer is in the right language for the lesson.Duolingo
securityA 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

Good uses and abuse

Legitimate uses

  • Routing translation

Known abuse

  • None

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility3 of 5How useful it is to honest apps
Friction2 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2025-06, Chrome 138: Stable (Edge 148)

Sources

How well checked: Checked against real behavior.

On this page