Barcode Scanning
This page describes an old version of the Barcode Scanning API, which was part of ML Kit for Firebase. Development of this API has been moved to the standalone ML Kit SDK, which you can use with or without Firebase.Learn more.
SeeBarcode Scanning for the latest documentation.

With ML Kit's barcode scanning API, you can read data encoded using moststandard barcode formats. Barcode scanning happens on the device, and doesn'trequire a network connection.
Barcodes are a convenient way to pass information from the real world to yourapp. In particular, when using 2D formats such as QR code, you can encodestructured data such as contact information or WiFi network credentials. BecauseML Kit can automatically recognize and parse this data, your app can respondintelligently when a user scans a barcode.
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.Key capabilities
| Reads most standard formats |
|
| Automatic format detection | Scan for all supported barcode formats at once, without having to specify the format you're looking for. Or, boost scanning speed by restricting the detector to only the formats you're interested in. |
| Extracts structured data | Structured data stored using one of the supported 2D formats are automatically parsed. Supported information types include URLs, contact information, calendar events, email addresses, phone numbers, SMS message prompts, ISBNs, WiFi connection information, geographic location, and AAMVA-standard driver information. |
| Works with any orientation | Barcodes are recognized and scanned regardless of their orientation: right-side-up, upside-down, or sideways. |
| Runs on the device | Barcode scanning is performed completely on the device, and doesn't require a network connection. |
Example results
![]() |
| ||||||
![]() |
| ||||||||||||||
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.

