Text Recognition
This page describes an old version of the Text Recognition API, which was part of ML Kit for Firebase. The functionality of this API has been split into two new APIs (learn more):
- On-device text recognition is part of the new standalone ML Kit SDK, which you can use with or without Firebase.
- Cloud text recognition is part ofFirebase ML, which includes all of Firebase's cloud-based ML features.

With ML Kit's text recognition APIs, you can recognize text in anyLatin-based language (and more, with Cloud-based text recognition).
Text recognition can automate tedious data entry for credit cards, receipts, andbusiness cards. With the Cloud-based API, you can alsoextract text from pictures of documents, which you can use to increaseaccessibility or translate documents. Apps can even keep track of real-worldobjects, such as by reading the numbers on trains.
If you're a Flutter developer, you might be interested inFlutterFire, which includes a plugin for Firebase's ML Vision APIs.
This is a beta release of ML Kit for Firebase. This API might be changed in backward-incompatible ways and is not subject to any SLA or deprecation policy.Choose between on-device and Cloud APIs
| On-device | Cloud | |
|---|---|---|
| Pricing | Free | Free for first 1000 uses of this feature per month: seePricing |
| Ideal use cases | Real-time processing—ideal for a camera or video feed Recognizing sparse text in images | High-accuracy text recognition Recognizing sparse text in images Recognizing densely-spaced text in pictures of documents See theCloud Vision API demo. |
| Language support | Recognizes Latin characters | Recognizes and identifies a broad range of languages and special characters |
Example results
Sparse text

| Recognized Text | |
|---|---|
| Text | Wege |
| Blocks | (1 block) |
| Block 0 | |
|---|---|
| Text | Wege der parlamentarischen Demokratie |
| Frame | (117.0, 258.0, 190.0, 83.0) |
| Corner Points | (117, 270), (301.64, 258.49), (306.05, 329.36), (121.41, 340.86) |
| Recognized Language Code | de |
| Lines | (3 lines) |
| Line 0 | |
|---|---|
| Text | Wege der |
| Frame | (167.0, 261.0, 91.0, 28.0) |
| Corner Points | (167, 267), (255.82, 261.46), (257.19, 283.42), (168.36, 288.95) |
| Recognized Language Code | de |
| Elements | (2 elements) |
| Element 0 | |
|---|---|
| Text | Wege |
| Frame | (167.0, 263.0, 59.0, 26.0) |
| Corner Points | (167, 267), (223.88, 263.45), (225.25, 285.41), (168.36, 288.95) |
Document text

| Recognized Text | |
|---|---|
| Text | DR. SEWARD'S DIARY 361... (full text) |
| Blocks | (1 block) |
| Block 0 | |
|---|---|
| Text |
... (full text) |
| Confidence | 0.98 |
| Frame | (25.0, 21.0, 359.0, 583.0) |
| Recognized Language Code | en |
| Paragraphs | (10 paragraphs) |
| Paragraph 1 | |
|---|---|
| Text | " No , " she said quite simply , " it will not be necessary . You can tell them just as well . I must go with you on your journey . " |
| Confidence | 0.98 |
| Frame | (29.0, 110.0, 355.0, 44.0) |
| Recognized Language Code | en |
| Words | (34 words) |
| Word 7 | |
|---|---|
| Text | simply |
| Confidence | 0.99 |
| Frame | (179.0, 110.0, 37.0, 15.0) |
| Recognized Language Code | en |
| Symbols | (6 symbols) |
| Symbol 0 | |
|---|---|
| Text | s |
| Confidence | 1.00 |
| Frame | (179.0, 110.0, 3.0, 15.0) |
| Recognized Language Code | en |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-21 UTC.