What is Chrome's built-in Translator API?

The Translator API is an experimental web platform feature that lets a webpage translate text directly in the browser, using a locally bundled AI model managed by the user agent. Instead of sending text to a remote translation service, the browser exposes a JavaScript interface (window.Translator) that creates short-lived translator sessions for a given source/target language pair and returns translated strings asynchronously.

The companion Language Detector API (window.LanguageDetector) inspects a string and returns a ranked list of likely BCP-47 language tags with confidence scores. Together, the two APIs allow a page to detect the language of arbitrary input and then translate it without any network round-trip after the initial model download.

Because the model runs on the user's device, translations work offline once downloaded, sensitive text never leaves the machine, and there are no per-request API costs. The trade-off is that availability depends on the browser, the operating system, and whether the requested language pair has been downloaded.

Tool description

This playground is a hands-on environment for testing the Translator and Language Detector APIs in your own browser. It connects an input area, a target language selector, and an output area to the underlying Translator.create() / translate() calls, and surfaces the model's availability state and download progress while you experiment.

The source language defaults to "Auto detect", which routes the input through LanguageDetector first and then forwards the detected language to the translator. You can also pin the source language explicitly to skip detection.

Examples

Source (auto-detected) Target Output
Bonjour, comment ça va ? English Hello, how are you?
Guten Morgen, wie geht es dir? Spanish Buenos días, ¿cómo estás?
今日は良い天気ですね。 English The weather is nice today.

Features

  • Auto language detection — uses the Language Detector API to identify the source language before translating.
  • Bidirectional language picker — swap source and target with a single click and re-translate.
  • Live availability state — shows whether the requested model is available, downloadable, downloading, or unavailable.
  • Download progress bar — streams downloadprogress events from the translator/detector while the model is fetched.
  • On-device, offline translation — once the model is downloaded, no network requests are made to translate.

Use cases

  • Previewing localized copy — paste a string and instantly see how it reads in another language while drafting UI text.
  • Verifying browser support — check whether a specific source/target pair is available before shipping a feature that depends on the Translator API.
  • Quick offline translation — translate snippets while disconnected, after the relevant language pack has been downloaded.

Requirements

  • A browser that implements the Translator and Language Detector APIs. As of writing, this is Chrome 138+ and Chromium-based browsers (e.g. Opera 122+) on desktop. Edge, Firefox and Safari are not yet supported.
  • A secure context (HTTPS or localhost).
  • Transient user activation — the APIs only allow create() after a recent user gesture, which is why translation runs on input rather than on page load.
  • Sufficient disk space and bandwidth for the initial language model download. Subsequent translations reuse the cached model.

How it works

  1. On mount, the tool checks for window.Translator and window.LanguageDetector. If either is missing, a warning is displayed and the input is disabled.
  2. When you type, the input is debounced and the source/target pair is resolved (running LanguageDetector.detect() first if the source is auto).
  3. Translator.availability({ sourceLanguage, targetLanguage }) is called to query the model state for that pair.
  4. Translator.create() is invoked with a monitor callback that listens for downloadprogress events and updates the progress bar.
  5. translator.translate(text) returns the translated string, which is rendered in the output area.
  6. The translator and detector instances are released via destroy() after each call to free resources.

Supported languages

The picker exposes a curated list of common BCP-47 language tags that Chrome's bundled model supports or commonly tests, including:

en, es, fr, de, it, pt, nl, pl, ru, uk, tr, ar, hi, bn, ja, ko, zh, zh-Hant, vi, th, id, sv, no, fi, da, el, he, cs, ro, hu.

The actual set of usable pairs depends on what the underlying browser model has downloaded or can download. Pairs reported as unavailable cannot be translated in your current browser.

Limitations

  • The APIs are experimental and the surface may change between browser versions.
  • Translation quality is determined by the browser-provided model and is not guaranteed to match dedicated cloud translation services.
  • Some language pairs may require an intermediate pivot through English or may simply be unavailable.
  • The first translation for a new language pair can be slow because of the model download.
  • The APIs are not currently exposed to web workers and may be gated behind a Permissions Policy (translator, language-detector) on cross-origin iframes.

FAQ

Why does the output stay empty? The Translator API is probably not implemented in your browser. Open the page in Chrome 138+ on desktop and reload.

Why is "Downloading model…" shown? The first time you use a language pair, the browser downloads a model package. The progress bar reflects the downloadprogress events emitted by Translator.create().

Does my text leave the device? No. After the model is downloaded, translation happens entirely on-device. The tool itself does not send your input anywhere.

Why does "Auto detect" sometimes fail? If the input is too short, ambiguous, or in a script the detector hasn't seen, LanguageDetector.detect() may return und (undetermined). Pick the source language manually in that case.