Text Detection API
- Category
- Device
- Type
- New or changed feature
- Status
- In developer trial (Behind a flag) (Chrome 168)
- Intent stage
- Start prototyping
WPT details: https://wpt.fyi/results/shape-detection
Summary
The Text Detection API enables web applications to detect and recognize text within images, video frames, canvas elements, and camera streams. As part of the WICG Shape Detection API family, it exposes a modern asynchronous interface (`TextDetector.create()` and `detect()`) that returns recognized text along with enclosing bounding boxes and oriented corner coordinates. This provides web developers with fast, zero-payload optical character recognition directly within the browser while keeping user image data private.
Motivation
Web applications increasingly need to extract text from images, camera feeds, and video frames for use cases such as document and receipt scanning, real-time sign and menu translation, form autofill, and accessibility tools that make text inside images readable for screen readers. Today, web developers face significant tradeoffs between two approaches: 1. Cloud vision services: Uploading images over the network introduces latency, recurring server and API costs, failure in offline or low-connectivity environments, and data privacy concerns when handling sensitive documents. 2. Client-side libraries (e.g. WebAssembly): Shipping full OCR runtimes and models adds megabytes of payload to web page downloads, slows initial load times, and heavily taxes device CPU, memory, and battery. Providing a native Text Detection API directly in the browser resolves these tradeoffs. It eliminates the need for web applications to distribute heavy OCR models over the network and protects user privacy by processing images directly within the browser boundary without transmitting media to third-party endpoints.
Standards & signals
- Specification: https://wicg.github.io/shape-detection-api/text.html
- Firefox: No signal — Marcos expressed support on behalf of Mozilla the WICG Discourse thread however the official standards position decision[1] was to defer. [1]: https://github.com/mozilla/standards-positions/issues/21
- Safari: No signal
- Web developers: No signals
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=556760835
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=shape-detection
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Text%20Detection%20API
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Text%20Detection%20API
- Baseline status: https://webstatus.dev/?q=Text%20Detection%20API
Samples: https://paul.kinlan.me/detecting-text-in-an-image/ https://web.dev/shape-detection/#textdetector
Explainers: https://github.com/WICG/shape-detection-api/blob/main/text_detection_explainer.md