Barcode Extractor
Extract and decode barcodes from images. Supports EAN-13, UPC-A, Code 128, Code 39, ITF, and more. Upload, paste, or drag-and-drop.
Drop image here, click to browse, or Ctrl+V to paste
Supports JPG, PNG, BMP, WebP, GIF
About
Barcode misreads cost the retail and logistics industries billions annually in inventory discrepancies, shipping errors, and compliance failures. This tool extracts encoded data from barcode images by converting pixel patterns into bar-space width sequences, then matching those sequences against standardized encoding tables for formats including EAN-13, UPC-A, Code 128, Code 39, ITF, and Codabar. It applies adaptive thresholding and multi-angle scanline analysis to handle real-world image conditions: uneven lighting, rotation up to 15°, and low contrast. The extraction is performed entirely client-side. No image data leaves your browser.
Limitations: 2D barcodes (QR, Data Matrix) require separate tooling. Severely blurred or occluded barcodes below approximately 100px width may not resolve. The decoder assumes standard module widths per ISO/IEC 15420 (EAN/UPC) and ISO/IEC 15417 (Code 128). For thermal-printed labels with ink spread, results should be cross-verified against the check digit, which this tool validates automatically.
Formulas
The decoder converts pixel luminance into binary bar-space patterns. Grayscale intensity for each pixel is computed as a weighted sum per ITU-R BT.601:
where R, G, B are the red, green, and blue channel values (0 - 255). Adaptive thresholding uses a local window mean to binarize the scanline.
For EAN-13 and UPC-A, the check digit C is validated using the modulo-10 algorithm:
where di is the i-th digit, and wi alternates between 1 and 3 for EAN-13 (positions indexed from the rightmost digit).
For Code 128, the checksum uses modulo 103: the start code value plus each data character value multiplied by its 1-based position index, all reduced mod 103.
Bar width decoding normalizes measured pixel widths against the known module count per character. For EAN-13, each digit is encoded in 7 modules comprising 2 bars and 2 spaces, with width ratios compared against the L-code, G-code, and R-code lookup tables.
Reference Data
| Format | Standard | Characters | Length | Check Digit | Common Use |
|---|---|---|---|---|---|
| EAN-13 | ISO/IEC 15420 | Digits 0-9 | 13 | Modulo 10 | Global retail products |
| EAN-8 | ISO/IEC 15420 | Digits 0-9 | 8 | Modulo 10 | Small retail items |
| UPC-A | ISO/IEC 15420 | Digits 0-9 | 12 | Modulo 10 | North American retail |
| UPC-E | ISO/IEC 15420 | Digits 0-9 | 8 | Modulo 10 | Compressed UPC for small packages |
| Code 128 | ISO/IEC 15417 | Full ASCII (128 chars) | Variable | Modulo 103 | Shipping, logistics, GS1-128 |
| Code 39 | ISO/IEC 16388 | A - Z, 0-9, 7 specials | Variable | Optional Mod 43 | Automotive, defense (MIL-STD-1189) |
| ITF (Interleaved 2-of-5) | ISO/IEC 16390 | Digits 0-9 (pairs) | Even count | Optional Mod 10 | Carton labels, distribution |
| Codabar | ANSI/AIM BC3 | 0-9, 6 specials | Variable | Optional | Libraries, blood banks, FedEx airbills |
| Code 93 | AIM BC5 | Full ASCII | Variable | 2 check chars (Mod 47) | Canadian postal, logistics |
| MSI Plessey | Proprietary | Digits 0-9 | Variable | Mod 10 (Luhn) or Mod 11 | Warehouse shelf labeling |
| Pharmacode | Laetus | Numeric (3-131070) | Variable | None | Pharmaceutical packaging |
| GS1-128 | ISO/IEC 15417 + GS1 | Full ASCII + AIs | Variable | Mod 103 + AI validation | Supply chain, SSCC, expiry dates |
| ISBN-13 | ISO 2108 (EAN-13 subset) | Digits, prefix 978/979 | 13 | Modulo 10 | Book identification worldwide |
| ISSN | ISO 3297 (EAN-13 subset) | Digits, prefix 977 | 13 | Modulo 10 | Serial publications |