Try It
Drop an image to scan barcodes and QR codes directly in your browser using WebAssembly.
Drop or paste an image here, or click to select
PNG, JPEG, GIF, WebP, BMP
Image
Results
No barcodes or QR codes found in this image.
Supported Formats
2D Codes
- QR Code
- SQ Code
EAN/UPC
- EAN-13 / EAN-8
- UPC-A / UPC-E
- ISBN-10 / ISBN-13
Code Family
- Code 128
- Code 93
- Code 39
- Codabar
Industrial
- Interleaved 2 of 5
- GS1 DataBar
Installation
Command-line Tool
Install the zedbarimg CLI tool (similar to zbarimg):
cargo install zedbar
Scan images from the command line:
zedbarimg image.png
zedbarimg --quiet barcode.jpg
Library Usage
Add zedbar to your Cargo.toml:
[dependencies]
zedbar = "0.2"
use zedbar::{Scanner, Image, DecoderConfig};
use zedbar::config::{QrCode, Ean13};
// Create a scanner with specific formats
let config = DecoderConfig::new()
.enable(QrCode)
.enable(Ean13);
let mut scanner = Scanner::with_config(config);
// Load an image (grayscale, 1 byte per pixel)
let mut image = Image::from_gray(&grayscale_data, width, height)?;
// Scan for barcodes
for symbol in scanner.scan(&mut image) {
println!("{:?}: {}", symbol.symbol_type(), symbol.text().unwrap());
}
See the API documentation for more details.
Command-line Tool
Install the zedbarimg CLI tool globally (similar to zbarimg):
npm install -g zedbar
Scan images from the command line:
zedbarimg image.png
zedbarimg --quiet barcode.jpg
Library Usage
Install from npm:
npm install zedbar
import { scanImageBytes } from 'zedbar';
import { readFileSync } from 'fs';
// Read and scan an image file directly
const imageBytes = readFileSync('barcode.png');
for (const { symbolType, text } of scanImageBytes(imageBytes)) {
console.log(`${symbolType}: ${text}`);
}
// Or use scanGrayscale if you already have grayscale data
import { scanGrayscale } from 'zedbar';
for (const { symbolType, text } of scanGrayscale(grayscaleData, width, height)) {
console.log(`${symbolType}: ${text}`);
}
The Node.js package uses WebAssembly under the hood, so it works on any platform without native dependencies.