← Chrome 161 reference · All APIs

v161 · web ai · android · enabled by default

Translator API on Android

Brings the on-device Translator Web API to Chrome for Android (including Chrome Custom Tabs) in Chrome 161, matching the desktop WebIDL surface shipped in Chrome 138 while introducing mobile-specific runtime guardrails — a per-origin isolated_app utility process, a 2-service concurrency cap, 1-minute idle model unloading, a 256 KiB per-call input limit, storage and metered-network availability gates, and Android support for the TranslatorAPIAllowed enterprise policy.

Limited availability — Chromium-only built-in AI API (not Baseline; Chrome for Android joins desktop Chrome 138 & Edge 148 in Chrome 161)

  • Chrome Desktop · 138
  • Chrome Android · 161 (including Custom Tabs)
  • Edge Desktop · 148
  • Firefox · No support (Mozilla position: Negative)
  • Safari · No support (WebKit position: No signal)

The translator web-feature is Limited availability on webstatus.dev (checked 2026-11-24). BCD api/Translator.json currently still records chrome_android: false (freshness gap vs. the Chrome 161 milestone listing), and MDN’s Translator reference does not yet document Android Custom Tabs, Android memory/storage/metered-network guardrails, or TranslatorAPIAllowed.

at a glance

Shipped inChrome 161 on Android (including Chrome Custom Tabs) — filed under “Enabled by default” in the milestone=161 listing; Android WebView and iOS are null (not supported) in the ChromeStatus API record. Desktop Chrome shipped separately in M138.
Runtime flag & policyFinch feature TranslationAPI (in runtime_enabled_features.json5; Android constants in components/on_device_translation/features.cc). Administrators can disable the API and block model downloads via TranslatorAPIAllowed on Android.
SpecificationWeb Machine Learning CG — Translator and Language Detector APIs (Community Group Draft); supporting types in Writing Assistance APIs
Explainer & docswebmachinelearning/translation-api explainer · Chrome for Developers guide · MDN Translator (desktop)
Intent & bugblink-dev Intent thread · crbug 428227642
Web platform testsexternal/wpt/ai/translator/ plus Android unit tests and mock-engine browser tests (known WPT flakiness bugs: crbug 479913865, crbug 510552929, crbug 525227294)
ChromeStatus5106126157905920 — Translator API on Android

why it exists

Mobile web applications previously had to send user text to cloud translation endpoints or bundle heavy client-side ML weights, adding latency, data usage, and privacy exposure. Shipping Translator on Chrome for Android (including Chrome Custom Tabs) pairs with the Language Detector API on Android (M157) so mobile sites can detect and translate text locally with offline support once language packs are cached, while Chromium enforces strict mobile memory, storage, input-size, and metered-network guardrails so on-device translation does not destabilize phones.

Source: ChromeStatus summary & motivation (5106126157905920); Chrome case study.

Syntax & WebIDL

Chrome for Android exposes the identical Translator WebIDL surface already shipped on desktop Chrome 138:

// Verbatim from Web Machine Learning CG Translator API specification
[Exposed=Window, SecureContext]
interface Translator {
  static Promise<Translator> create(TranslatorCreateOptions options);
  static Promise<Availability> availability(TranslatorCreateCoreOptions options);

  Promise<DOMString> translate(
    DOMString input,
    optional TranslatorTranslateOptions options = {}
  );
  ReadableStream translateStreaming(
    DOMString input,
    optional TranslatorTranslateOptions options = {}
  );

  readonly attribute DOMString sourceLanguage;
  readonly attribute DOMString targetLanguage;

  Promise<double> measureInputUsage(
    DOMString input,
    optional TranslatorTranslateOptions options = {}
  );
  readonly attribute unrestricted double inputQuota;
};
Translator includes DestroyableModel;

dictionary TranslatorCreateCoreOptions {
  required DOMString sourceLanguage;
  required DOMString targetLanguage;
};

dictionary TranslatorCreateOptions : TranslatorCreateCoreOptions {
  AbortSignal signal;
  CreateMonitorCallback monitor;
};

dictionary TranslatorTranslateOptions {
  AbortSignal signal;
};

// Supporting types from Writing Assistance APIs
enum Availability {
  "unavailable",
  "downloadable",
  "downloading",
  "available"
};

[Exposed=Window, SecureContext]
interface CreateMonitor : EventTarget {
  attribute EventHandler ondownloadprogress;
};
callback CreateMonitorCallback = undefined (CreateMonitor monitor);

interface mixin DestroyableModel {
  undefined destroy();
};

In Blink’s translator.idl, Translator is exposed on Window via TranslationAPI (and on Worker only when the separate experimental TranslationAPIForWorkers flag is enabled). This reference documents all five parts of the Chrome 161 Android contract: Translator.availability(), Translator.create() & downloads, translate() & translateStreaming(), quota, metadata & destroy(), and Android runtime guardrails & enterprise policy.

Source: Translator API spec (fetched 2026-11-24); Writing Assistance APIs supporting types; Blink translator.idl.

Translator.availability(options)

Inputs. Requires a TranslatorCreateCoreOptions dictionary containing BCP 47 Unicode locale identifiers for sourceLanguage and targetLanguage (canonicalized in Blink via ValidateAndCanonicalizeUnicodeLocaleId).

Outputs. Returns a Promise<Availability> resolving to one of four enum values without triggering a model download:

Availability states returned by Translator.availability() on Chrome for Android
ValueMeaning on Android
"available"The bundled translation library and required language pack(s) are already on-device and ready for immediate Translator.create().
"downloadable"The language pair is supported, device storage and network checks pass, and calling Translator.create() (with user activation) will download the language pack(s) via Component Updater.
"downloading"Required language pack(s) are currently downloading in the background.
"unavailable"Returned when the language pair is unsupported, the translator permissions policy is blocked, TranslatorAPIAllowed enterprise policy disables the API, or Android storage, device-resource, or metered-network guardrails block downloading/running the model (without revealing whether packs are installed).
Source: Translator API spec; Blink translator.cc; ChromeStatus 5106126157905920.

Translator.create(options) & download monitoring

Inputs. Accepts TranslatorCreateOptions: required sourceLanguage and targetLanguage strings, optional signal (AbortSignal to cancel download/creation and bind session abort), and optional monitor callback receiving a CreateMonitor whose downloadprogress event reports download progress (e.loaded normalized from 0 to 1).

Outputs & behavior. Returns a Promise<Translator>. On Android, the translation library is bundled with Chrome while language packs download on demand via Chromium’s Component Updater (CRX3- and SHA-256-verified) after sticky user activation. Always check Translator.availability() first and invoke Translator.create() inside a user gesture when a download is required.

Source: Translator API spec; Blink create_translator_client.cc; ChromeStatus ergonomics & security notes.

translate(input, options) & translateStreaming(input, options)

Inputs. Both instance methods take a DOMString input (unmatched UTF-16 surrogates are replaced before IPC in Blink) and optional { signal } (TranslatorTranslateOptions).

Outputs. translate() returns a Promise<DOMString> resolving to the full translated string. translateStreaming() synchronously returns a ReadableStream of string chunks suitable for progressive UI rendering of longer passages. On Android, single-call inputs exceeding the 256 KiB engine budget (kTranslationAPIMaxInputSizeBytes) fail with a standard spec-defined error (QuotaExceededError), so callers should chunk large documents (for example by paragraph or sentence) before translating.

Source: Translator API spec; Blink translator.cc; Chromium features.cc.

Quota, metadata, destroy() & lifecycle

Attributes & methods.

Lifecycle & idle unloading. On Android, Chromium automatically unloads idle translation models after 1 minute (kTranslationAPIModelIdleUnloadTimeout) and shuts down idle utility services after 1 minute (kTranslationAPIServiceIdleTimeout). Applications keeping a Translator reference across long pauses should expect transparent reload latency or recreate the translator if the service was reclaimed.

Source: Blink translator.cc; Chromium features.cc; ChromeStatus 5106126157905920.

Android runtime guardrails & enterprise policy

Chrome for Android enforces stricter mobile resource limits than desktop Chrome, verified directly in components/on_device_translation/features.cc and ChromeStatus 5106126157905920:

Android vs. Desktop default guardrails in Chromium components/on_device_translation/features.cc
Guardrail / FeatureParamChrome for Android (M161)Chrome Desktop (M138+)Developer impact
TranslationAPIMaxServiceCount2 concurrent service processes10 concurrent service processesEach per-origin isolated_app utility process holds ~79–84 MiB per loaded language pair; call destroy() when switching pairs.
TranslationAPIModelIdleUnloadTimeout1 minuteDisabled (0)Idle models unload automatically after 60s to reclaim mobile RAM.
TranslationAPIMaxInputSizeBytes256 KiB (~40,000 English words)0 (unbounded)Oversized single calls reject with QuotaExceededError; chunk large inputs.
TranslationAPIServiceIdleTimeout1 minute1 minuteIdle utility process exits after 60s.
Storage & metered-network checksEnforced before pack downloadDesktop disk-space checksInsufficient storage or metered-network restrictions report "unavailable" without leaking installed packs.
Chrome Custom TabsSupportedN/AWorks inside Android Custom Tabs as well as standard Chrome tabs.
TranslatorAPIAllowed policySupported on AndroidSupported on desktopWhen disabled by enterprise policy, API is unavailable and model downloads are prevented.
Source: Chromium components/on_device_translation/features.cc; ChromeStatus 5106126157905920; Chrome Enterprise TranslatorAPIAllowed.

Errors & failure modes

Standard spec-defined rejection errors surfaced on Chrome for Android
ErrorWhen it occursRecovery
TypeError / RangeErrorMissing required sourceLanguage / targetLanguage, or invalid BCP 47 language tag rejected by Unicode locale canonicalization.Validate and normalize BCP 47 language codes before calling.
NotAllowedError (DOMException)The translator permissions policy is disallowed (e.g., cross-origin iframe without allow="translator"), or Translator.create() requires a download without user activation.Add allow="translator" where appropriate and trigger Translator.create() inside a user gesture.
NotSupportedError (DOMException)Unsupported language pair, disabled by TranslatorAPIAllowed policy, or device/storage/metered-network checks prevent creation.Check Translator.availability() first and fall back to server/UI alternative.
QuotaExceededError (DOMException)Input exceeds Android’s 256 KiB per-call input budget (TranslationAPIMaxInputSizeBytes) or concurrency/resource quota is exceeded.Split text into smaller UTF-8 chunks (≤ 256 KiB, ideally a few KiB per call) and call destroy() on unused translators.
AbortError (DOMException)AbortSignal passed to create(), translate(), or translateStreaming() aborted, or destroy() was called mid-flight.Handle cancellation cleanly and avoid retrying aborted user actions.
Source: ChromeStatus interop notes (5106126157905920); Blink translator.cc & create_translator_client.cc.

Context, exposure & permissions policy

Translator requires a SecureContext (HTTPS or localhost) and is exposed on Window (including top-level pages, Android Chrome Custom Tabs, and iframes granted the translator permissions policy — default allowlist 'self'). Cross-origin iframes must opt in via allow="translator" and an appropriate Permissions-Policy: translator=(...) response header. Exposure in Web Workers is not enabled by default (gated by TranslationAPIForWorkers). Android WebView does not expose the API.

Source: Translator API spec §3.5 Permissions policy; Blink translator.idl; ChromeStatus 5106126157905920.

Examples

Live example from the Chrome Platform Showcase (HEAD-checked 200 on 2026-11-24): probes Translator.availability() without auto-downloading models. Sibling interactive concept demos (all verified 200): download on a constrained device, memory and input limits, failure and policy gates, and offline chat composer.Source: chrome-platform-showcase

Android-safe availability check, user-activated creation, chunked translation, and cleanup

// Stay well below Android's 256 KiB TranslationAPIMaxInputSizeBytes cap.
const MAX_ANDROID_CHUNK_BYTES = 16 * 1024;
const encoder = new TextEncoder();

async function translateSafely(text, sourceLanguage, targetLanguage, onProgress) {
  if (typeof Translator === "undefined") {
    throw new Error("Translator API is not supported in this browser");
  }

  const pair = { sourceLanguage, targetLanguage };
  const state = await Translator.availability(pair);
  if (state === "unavailable") {
    // Could be unsupported pair, low storage, metered network, or TranslatorAPIAllowed policy.
    throw new Error(`Translation unavailable for ${sourceLanguage} -> ${targetLanguage}`);
  }

  const controller = new AbortController();
  const translator = await Translator.create({
    ...pair,
    signal: controller.signal,
    monitor(m) {
      m.addEventListener("downloadprogress", (e) => {
        onProgress?.(Math.round(e.loaded * 100));
      });
    },
  });

  try {
    // Chunk input to avoid QuotaExceededError on Android's 256 KiB input budget.
    if (encoder.encode(text).byteLength <= MAX_ANDROID_CHUNK_BYTES) {
      return await translator.translate(text, { signal: controller.signal });
    }
    const paragraphs = text.split(/\n{2,}/);
    const out = [];
    for (const part of paragraphs) {
      out.push(await translator.translate(part, { signal: controller.signal }));
    }
    return out.join("\n\n");
  } finally {
    // Release the ~79-84 MiB language pair promptly under Android's TranslationAPIMaxServiceCount (2).
    translator.destroy();
  }
}
Source: Translator API spec; Chromium features.cc.

Streaming translation output with translateStreaming()

// Call inside a click/tap handler so downloads have sticky user activation.
async function streamTranslation(input, sourceLanguage, targetLanguage, targetEl) {
  const translator = await Translator.create({ sourceLanguage, targetLanguage });
  try {
    targetEl.textContent = "";
    const stream = translator.translateStreaming(input);
    for await (const chunk of stream) {
      targetEl.textContent += chunk;
    }
  } finally {
    translator.destroy();
  }
}
Source: Translator API spec; Chrome for Developers Translator API guide.

Browser compatibility

Translator support combining BCD api/Translator.json, ChromeStatus 5106126157905920, and webstatus.dev (checked 2026-11-24). BCD has not yet recorded Chrome for Android 161.
BrowserSupportEvidence / notes
Chrome (Android)161Enabled by default on Android (including Chrome Custom Tabs) in the milestone=161 listing and ChromeStatus 5106126157905920. BCD still lists chrome_android: false (freshness gap).
Chrome (Desktop)138Shipped in M138 per BCD api/Translator.json (BCD notes availability may be subject to geographical restrictions).
Android WebViewNowebview is null in ChromeStatus 5106126157905920 and false in BCD.
Edge148 (desktop)Desktop Edge 148 per BCD and Microsoft Edge docs; Edge on Android status unknown.
FirefoxNoUnsupported in BCD; Mozilla’s standards position is Negative (mozilla/standards-positions#1015).
SafariNoUnsupported in BCD; WebKit standards position has No signal (WebKit/standards-positions#339).
Source: BCD api/Translator.json; ChromeStatus API record; webstatus.dev translator.

Security and privacy

Source: ChromeStatus security & privacy notes (5106126157905920); Chrome Enterprise TranslatorAPIAllowed; Translator API spec.

Specifications

see also