User Rating 0.0
Total Usage 0 times
Category Media Tools

Drop image here, click to browse, or Ctrl+V to paste

Supports JPG, PNG, BMP, WebP, GIF

Is this tool helpful?

Your feedback helps us improve.

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.

barcode extractor barcode reader barcode scanner EAN-13 decoder UPC reader Code 128 image barcode barcode from image

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:

L = 0.299 R + 0.587 G + 0.114 B

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:

C = (10 (n1i=0 di wi) mod 10) mod 10

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

FormatStandardCharactersLengthCheck DigitCommon Use
EAN-13ISO/IEC 15420Digits 0-913Modulo 10Global retail products
EAN-8ISO/IEC 15420Digits 0-98Modulo 10Small retail items
UPC-AISO/IEC 15420Digits 0-912Modulo 10North American retail
UPC-EISO/IEC 15420Digits 0-98Modulo 10Compressed UPC for small packages
Code 128ISO/IEC 15417Full ASCII (128 chars)VariableModulo 103Shipping, logistics, GS1-128
Code 39ISO/IEC 16388A - Z, 0-9, 7 specialsVariableOptional Mod 43Automotive, defense (MIL-STD-1189)
ITF (Interleaved 2-of-5)ISO/IEC 16390Digits 0-9 (pairs)Even countOptional Mod 10Carton labels, distribution
CodabarANSI/AIM BC30-9, 6 specialsVariableOptionalLibraries, blood banks, FedEx airbills
Code 93AIM BC5Full ASCIIVariable2 check chars (Mod 47)Canadian postal, logistics
MSI PlesseyProprietaryDigits 0-9VariableMod 10 (Luhn) or Mod 11Warehouse shelf labeling
PharmacodeLaetusNumeric (3-131070)VariableNonePharmaceutical packaging
GS1-128ISO/IEC 15417 + GS1Full ASCII + AIsVariableMod 103 + AI validationSupply chain, SSCC, expiry dates
ISBN-13ISO 2108 (EAN-13 subset)Digits, prefix 978/97913Modulo 10Book identification worldwide
ISSNISO 3297 (EAN-13 subset)Digits, prefix 97713Modulo 10Serial publications

Frequently Asked Questions

The tool supports all major 1D barcode symbologies: EAN-13, EAN-8, UPC-A, UPC-E, Code 128 (including GS1-128), Code 39, ITF (Interleaved 2-of-5), and Codabar. These cover over 95% of barcodes encountered in retail, logistics, healthcare, and library systems. The native BarcodeDetector API (available in Chromium-based browsers) may additionally detect Code 93 and other formats.
The decoder requires a minimum barcode width of approximately 100 pixels for reliable extraction. Critical factors include contrast ratio between bars and spaces (minimum 40% difference recommended per ISO/IEC 15416 print quality standard), image sharpness (Gaussian blur with sigma above 2 pixels will degrade results), and even lighting across the barcode region. The tool applies adaptive thresholding to compensate for uneven illumination gradients up to approximately 30% variation across the symbol width.
Yes. The extraction engine scans at multiple angles: 0°, ±5°, ±10°, ±15°, and 90° (for vertically oriented barcodes). This covers the vast majority of real-world label photos. Barcodes rotated beyond ±15° from horizontal or vertical may require the image to be pre-rotated before uploading. Perspective distortion (keystoning) from angled photography is not corrected; photograph barcodes as perpendicular to the camera plane as possible.
No. All processing occurs entirely within your browser using Canvas pixel manipulation and JavaScript. The image never leaves your device. No network requests are made during extraction. This makes the tool suitable for sensitive inventory labels, medical specimen barcodes, or proprietary product codes where data confidentiality matters.
A check digit mismatch means the extracted digit sequence fails its format's validation algorithm (e.g., modulo 10 for EAN/UPC). This typically indicates partial barcode damage, ink spread on thermal labels altering bar widths, or low image resolution causing adjacent bars to merge. The tool still reports the raw extracted value so you can identify which digit is suspect. For EAN-13, the check digit is position 13 - compare it against manual calculation using the alternating weight-1/weight-3 sum method.
UPC-A is a 12-digit subset of EAN-13. Every UPC-A code can be represented as EAN-13 by prepending a leading zero. The encoding structure is identical: 7 modules per digit, same guard patterns, same modulo-10 check digit algorithm. If the tool reports a 13-digit EAN-13 starting with 0, the underlying code is effectively a UPC-A barcode. Country prefixes 000-019 and 060-139 are assigned to the United States and Canada.