In 2024, developers made around one billion contributions to open-source and public GitHub repositories. Free and open-source software is more attractive than ever. Barcode scanning software is no exception.
In this article, we take a closer look at two popular open-source Capacitor barcode scanner libraries: capacitor-barcode-scanner and capacitor-mlkit.
No time to read? Let’s start with the key findings:
📌 TL;DR
- capacitor-barcode-scanner: Android (ZXing or ML Kit), iOS (VisionKit), Web (html5-qrcode)
- capacitor-mlkit: Android (ML Kit), iOS (ML Kit), Web (Barcode Detection API)
- capacitor-barcode-scanner scans all common 1D and 2D barcodes, but support varies depending on the engine used.
- capacitor-mlkit supports fewer barcode types on iOS, and generally lacks support for GS1 DataBar codes.
Both libraries offer scanning from a live camera stream and from image files.
- capacitor-barcode-scanner features omnidirectional scanning, autofocus, camera switching, and torch toggle configuration.
- capacitor-mlkit provides the same and adds support for multi scanning and defining a region of interest.
- capacitor-barcode-scanner includes a default scanning UI with limited customization.
- capacitor-mlkit offers a pre-built UI (limited to scanning one barcode at a time) but also lets you build your own.
Both libraries are under active development, but deeper fixes and feature additions are dependent on underlying API roadmaps.
- capacitor-barcode-scanner sees consistent community interaction with frequent bug reports and feature requests.
- capacitor-mlkit has a more active community, with a discussion tab in its repository and a Discord channel. Priority support requires a subscription.
- capacitor-barcode-scanner offers sparse documentation. There are some discrepancies with the actual implementation.
- capacitor-mlkit provides more detailed documentation, which also includes guides and sample apps.
- capacitor-barcode-scanner
- Scanner does not resolve on close
- Issues on specific Android devices
- Autofocus issues on iOS
- Rotating the device breaks the UI on iOS
- capacitor-mlkit
- Difficulty scanning PDF417 codes
- Difficulty scanning tiny barcodes
- Scanning multiple barcodes can return incorrect results
Comparison: capacitor-barcode-scanner vs. capacitor-mlkit
Platform support
capacitor-barcode-scanner is a barcode scanner plugin developed by the Ionic team. It is the successor of the popular but deprecated barcode-scanner library. The underlying scanning libraries vary by platform:
- On Android, you can choose between ZXing or Google’s ML Kit.
- On iOS, the library uses Apple’s VisionKit.
- On Web, it uses the html5-qrcode library.
capacitor-mlkit is an unofficial plugin built on the Google ML Kit Barcode Scanning API. It is available for Android, iOS, and Web. On iOS, it’s worth noting that the plugin only supports CocoaPods for dependency management. In browsers that support it, the plugin uses the Barcode Detection API.
Supported barcodes
Both libraries support the most common 1D and 2D barcode formats, including QR, EAN, and UPC codes. This excludes more niche symbologies like Micro QR Code, MicroPDF417, or MSI Plessey.
The exact barcode support varies depending on the platform and the underlying scanning engine (see the detailed table below).
On Web and on Android with ZXing, capacitor-barcode-scanner supports UPC/EAN extensions, MaxiCode, and GS1 DataBar (Expanded). When using ML Kit on Android, none of these formats are available.
On iOS, only GS1 DataBar (Expanded) is supported; MaxiCode and UPC/EAN extensions are not. Additionally, the scanner can read UPC-A barcodes but will return them as EAN‑13 – a limitation of VisionKit.
On Android and iOS, capacitor-mlkit inherits its barcode support from ML Kit. On Web, it relies on html5-qrcode, which supports the same symbologies as ZXing.
While ML Kit supports fewer barcode types overall, it can parse structured data for certain barcode types. This includes barcodes containing driver’s license data, email addresses (MAILTO), URLs (MEBKM), GPS coordinates (GEO), and Wi-Fi network parameters (WIFI).
See the table below for a side-by-side comparison of supported barcodes per library and platform.
| Barcode type | capacitor-barcode-scanner – Android/ZXing | capacitor-barcode-scanner – Android/ML Kit | capacitor-barcode-scanner – iOS | capacitor-barcode-scanner – Web | Capacitor-mlkit – Android/iOS | capacitor-mlkit – Web |
| UPC-A | ✅ Yes | ✅ Yes | ⚠️ Decoding issue | ✅ Yes | ✅ Yes | ✅ Yes |
| UPC-E | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| UPC-A/EAN Extension | ✅ Yes | ❌ No | ❌ No | ✅ Yes | ❌ No | ❌ No |
| EAN-8 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| EAN-13 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| ITF (Interleaved 2 of 5) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| Code 39 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| Code 93 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| Code 128 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| Codabar | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes | ✅ Yes |
| MSI Plessey | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No |
| Intelligent Mail barcode (IMb) | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No |
| GS1 DataBar | ✅ Yes | ❌ No | ❌ No | ✅ Yes | ❌ No | ❌ No |
| GS1 DataBar Expanded | ✅ Yes | ❌ No | ❌ No | ✅ Yes | ❌ No | ❌ No |
| GS1 DataBar Limited | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No |
| QR Code | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| Micro QR Code | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No |
| Data Matrix | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| Aztec | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| PDF417 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| MicroPDF417 | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No |
| MaxiCode | ✅ Yes | ❌ No | ❌ No | ✅ Yes | ❌ No | ❌ No |
| Pharmacode | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No |
Capabilities
Both libraries let you scan barcodes from the camera live stream and from image files.
Key features of capacitor-barcode-scanner include omnidirectional scanning, autofocus, switching between front and back cameras, and a torch toggle. One of its major limitations is that the scanner can only decode one barcode at a time.
capacitor-mlkit offers the same capabilities, but can read multiple barcodes at once. Additionally, it lets you define a region of interest.
Customizability
capacitor-barcode-scanner provides a default scanning UI. This makes integration straightforward, but customization is rather limited.
capacitor-mlkit, too, offers an out-of-the-box interface, but it’s worth noting that in this case, the scanner can’t scan multiple barcodes. In addition, on Android, the pre-built UI is only available on devices that have Google Play Services installed.
If you want to build your own UI or scan several barcodes in a row, you can do so with startScan() and stopScan().
Under the hood, both plugins leverage APIs for barcode processing. Since the underlying models cannot be customized, developers can’t modify their scanning logic or optimize performance for specific use cases.
Maintenance and updates
capacitor-barcode-scanner and capacitor-mlkit are under active development, with regular updates and pull requests being merged frequently.
However, deeper fixes and feature additions are dependent on the development roadmaps of the underlying APIs, as the core scanning behavior cannot be changed at the plugin level.
Community and support
capacitor-barcode-scanner is maintained by OutSystems within the Ionic ecosystem. The repository sees consistent community interaction with developers actively submitting bug reports and feature requests.
Similarly, capacitor-mlkit is managed by Capawesome, and has an active community. Developers can ask questions in the GitHub repository discussions tab, or in the Discord community. Capawesome also provides priority support as part of a paid subscription offer.
Developer resources
capacitor-barcode-scanner has a dedicated section with API references in the official Capacitor docs. However, developers have flagged discrepancies between the documentation there and the actual implementation. Resources are otherwise sparse.
capacitor-mlkit provides more extensive documentation, including integration guides and a demo app.
See the table below for links to relevant developer resources.
| capacitor-barcode-scanner | capacitor-mlkit |
| GitHub repository npm package Documentation Integration tutorial | GitHub repository npm package Documentation Integration tutorial |
License and cost
capacitor-barcode-scanner is under an MIT license. You can use the library in any project – including commercial and closed-source – with almost no restrictions other than keeping the original copyright notice.
capacitor-mlkit is under an Apache 2.0 license, which is also permissive but adds a few requirements: You must provide attribution and note major changes. Apache 2.0 also includes a built-in patent grant license from contributors. It is still fully usable in commercial and closed-source projects.
While both libraries are open source and free, it is worth considering the time spent on maintenance and debugging when issues arise.
Limitations
When using either capacitor-barcode-scanner or capacitor-mlkit, it is important to understand that limitations and problems often have their source in the underlying API rather than the plugin wrapper.
capacitor-barcode-scanner
Scanner does not resolve on close
When the barcode scanner is opened and the user closes it using the close button, the scanBarcode() call does not properly resolve. Because the awaited promise never returns a value, the code remains stuck at the await line – and so the camera streaming continues running in the background.
Android device-specific issues
The on-screen scan button may behave inconsistently across devices. In particular, developers flag that the button is visually cropped or partially cut off on certain Android devices, including the Pixel 5, Samsung Galaxy S23 Ultra and S24 Ultra.
On devices such as the Samsung Galaxy A53, the scanner opens the camera but never returns a result when scanning QR codes. The issue does not occur on iOS, non-Samsung Android devices, or emulators. Developers have attempted to resolve it by using the .ALL type hint and switching between ZXing and ML Kit, but without success.
Autofocus issues on iOS
On iPhone 15 devices, developers have encountered barcode scanning issues due to unreliable camera autofocus. A temporary workaround is to toggle the flashlight on and off, which forces the camera to refocus and restores normal scanning behavior.
Rotating device breaks scanning UI
On iOS devices, the scanner works when opened in a fixed orientation, but using adaptive orientation causes layout misalignment and often stops barcode detection if the device is rotated mid-scan. This occurs on multiple iPhone models, including the iPhone 14 Pro and 16 Pro Max.
capacitor-mlkit
Difficulty scanning PDF417 codes
While standard PDF417 barcodes scan reliably, the scanner struggles with more complex codes, such as those on US driver’s licenses. Scanning failures are likely caused by the default square detection area, the wide shape of the barcodes, and focus issues when the camera is held farther away.
Difficulty scanning tiny barcodes
The plugin may have difficulties scanning small barcodes. A developer flags unreliable scanning of tiny Code 128 barcodes both via the live camera and from image files. The plugin maintainer pointed out the issue is likely due to ML Kit’s detection limitations, rather than a bug in the plugin itself. The developer raised this in the ML Kit repository; but the ML Kit developers closed the issue without solving it.
Scanning the same barcode returns multiple results
When scanning multiple barcodes – especially long, complex, or stacked ones like IMEIs or serial numbers – the scanner may return multiple, incorrect, or partial results for the same barcode. This is particularly noticeable when barcodes are close together or only partially in the camera frame.
What library should I choose?
If you’re looking for a straightforward, “plug-and-play” solution with a pre-built interface, capacitor-barcode-scanner is a good choice. The plugin allows you to customize basic elements like text instructions or a single action button without writing any custom CSS. Developers point out that this is a simplified version of barcode-scanner, rather than a full replacement.
If you need more customization and features like multi scanning, capacitor-mlkit is the preferred free option. Developers can’t modify the decoding behavior, but they can build their own UI around the scanner. Unlike capacitor-barcode-scanner, barcode support is consistent between Android and iOS. However, be aware that GS1 DataBar codes are not included.
While both libraries are appropriate for experiments or small projects, they lack professional reliability and comprehensive support. For business applications, consider commercial alternatives.
Commercial Capacitor barcode scanner: Scanbot SDK
Scanbot SDK provides a commercial-grade barcode scanning library for Capacitor.
The Scanbot Barcode Scanner SDK lets you add fast and reliable barcode scanning to your mobile or web app. Integration is straightforward thanks to its ready-to-use UI components.
Besides enterprise-grade performance, Scanbot SDK differentiates itself from free alternatives with reliable customer support and ongoing maintenance and development. Since the SDK ships with its own proprietary barcode scanning engine, bug fixes and feature additions can be delivered independently of the roadmap of any scanner API.
The Scanbot Barcode Scanner SDK offers:
Broad platform support: Web, Android, iOS, React Native, Flutter, .NET MAUI, Capacitor, Compose Multiplatform, Windows, Linux, Cordova, and Xamarin.
Comprehensive barcode support:
- 1D barcodes: EAN, UPC, Code 128, Code 11, Code 25, Code 32, Code 39, Code 93, Codabar, MSI Plessey, Standard 2 of 5, ITF, IATA 2 of 5, GS1-128, GS1 DataBar, GS1 DataBar Expanded, GS1 DataBar Limited, Pharmacode
- 2D barcodes: Aztec, QR Code, Micro QR Code, rMQR Code, PDF417, MicroPDF417, Data Matrix, GS1 Data Matrix, GS1 DataBar Composite, GiroCode, Swiss QR Code
- Postal symbologies: MaxiCode, Royal Mail Mailmark, USPS Intelligent Mail Barcode, RM4SCC Barcode, Australia Post 4-State Customer Code, Japan Post 4-State Customer Code, KIX
- Data parsers: GS1 barcodes, AAMVA barcodes on IDs and DLs, BCBP codes on boarding passes, HIBC barcodes, SEPA QR Codes, vCard QR Codes
️Advanced scanning modes: Single Scanning, Multi Scanning, Batch Scanning, Find & Pick, Scan & Count, AR Overlays.
Enterprise-grade performance: Reliably scan barcodes – even in challenging conditions like low light, damaged barcodes, or at angles.

Conclusion
Open-source solutions are appealing because they are free to use. However, this advantage often comes with hidden costs. Maintenance, manual debugging, and limited or missing professional support can quickly consume development time. Even when support exists, many issues cannot be resolved because they originate in proprietary APIs.
In cross-platform environments, open-source scanners commonly rely on different underlying libraries. This can lead to inconsistent behavior across platforms: features or barcode formats may work on iOS but not on Android. When core technologies are closed systems (like ML Kit and VisionKit), scanning behavior cannot be adjusted or optimized for specific use cases.
With a paid solution like the Scanbot SDK, teams gain professional support, ongoing maintenance, and automatic updates aligned with new OS releases. They also follow defined release schedules and offer greater predictability, whereas open-source projects may become inactive or abandoned over time.
Commercial solutions offer feature parity across platforms and flexible integration options. The Scanbot SDK offers RTU UI components for quick, plug-and-play integration, as well as Classic UI components that allow for more detailed customization when required.
Finally, SDK vendors address security and compliance requirements more reliably. They invest in secure development practices and alignment with industry standards, which can be difficult to ensure in community-driven projects.
While open-source software is well suited for personal projects and experimentation, the Scanbot SDK is the better choice for production environments where reliability is key.
FAQ
Why can’t I scan inverted codes on Android with capacitor-barcode-scanner?
When using ZXing as your decoder, the scanner will scan black codes on a light background only.
Try switching to ML Kit as the decoder, as it should be able to scan inverted codes.
Can I scan multiple barcodes at the same time with the Scanbot SDK?
Yes. The Scanbot Barcode Scanner SDK provides pre-built scanning modes for specific use cases, including multi scanning. Read more about the setup in this blog post.