# ZXing — Open-Source Barcode and QR Code Processing Library > A multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages and a standalone Android barcode scanner app. ## Install Save as a script file and run: # ZXing — Open-Source Barcode and QR Code Processing Library ## Quick Use ```gradle implementation 'com.google.zxing:core:3.5.3' implementation 'com.journeyapps:zxing-android-embedded:4.3.0' ``` ```java IntentIntegrator integrator = new IntentIntegrator(activity); integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE); integrator.setPrompt("Scan a QR code"); integrator.initiateScan(); ``` ## Introduction ZXing (pronounced "zebra crossing") is the most widely used open-source barcode scanning library in the Java ecosystem. Originally created at Google, it supports decoding and encoding of over a dozen barcode formats and serves as the foundation for barcode scanning in countless Android apps and server-side processing pipelines. ## What ZXing Does - Decodes 1D barcodes including UPC-A, UPC-E, EAN-8, EAN-13, Code 39, Code 128, and ITF - Decodes 2D barcodes including QR Code, Data Matrix, Aztec, and PDF 417 - Generates barcode images programmatically for embedding in apps or documents - Provides a standalone Android scanner app with camera preview and auto-focus - Offers a pure Java core with no native dependencies for cross-platform use ## Architecture Overview The core library is pure Java and processes barcode recognition through a pipeline of image binarization, format-specific detector, and decoder stages. The Reader interface abstracts format detection, allowing the MultiFormatReader to try multiple formats in priority order. The Android integration layer handles camera preview frames and feeds them to the core decoder on a background thread. ## Setup & Configuration - Add the zxing-core dependency for server-side or pure Java barcode processing - Use zxing-android-embedded for an integrated Android scanner with camera preview - Configure supported barcode formats via IntentIntegrator or DecodeHintType map - Adjust camera resolution and autofocus settings for scanning distance requirements - Use the BarcodeEncoder class for generating QR code or barcode bitmap images ## Key Features - Supports 15+ barcode formats covering retail, logistics, and identification use cases - Pure Java implementation with no JNI or native code for maximum portability - Battle-tested in production across thousands of apps over more than a decade - Barcode generation API for creating scannable images from arbitrary data - Modular design separating core decoding from platform-specific camera integration ## Comparison with Similar Tools - **ML Kit Barcode Scanning** — Google's ML-based scanner with better angle tolerance, but requires Google Play Services - **Dynamsoft Barcode Reader** — commercial SDK with higher accuracy on damaged barcodes; ZXing is free and open source - **CameraX MLKit** — Jetpack integration for barcode scanning; depends on ML Kit under the hood - **Scandit** — enterprise-grade commercial scanner; ZXing provides a solid free alternative for standard use cases - **ZBar** — C-based scanner with Python bindings; ZXing is Java-native and better suited for Android and JVM projects ## FAQ **Q: Is ZXing still actively maintained?** A: The core library is stable and receives occasional updates. Community forks like zxing-android-embedded provide active Android integration maintenance. **Q: Can I use ZXing for server-side barcode processing?** A: Yes. The core module is pure Java and works on any JVM without Android dependencies. **Q: How do I improve scan speed for QR codes?** A: Restrict the supported formats to only QR_CODE via DecodeHintType, which avoids trying all format decoders. **Q: Does it support scanning from image files?** A: Yes. Pass a BufferedImage or luminance source to the MultiFormatReader to decode barcodes from static images. ## Sources - https://github.com/zxing/zxing - https://github.com/journeyapps/zxing-android-embedded --- Source: https://tokrepo.com/en/workflows/asset-5942b2b3 Author: Script Depot