← Back to release summary

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

Ecosystem

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

View on chromestatus.com