Barcode Reader Online β Decode EAN, UPC, CODE128, QR from an Image [2026]
You have a product photo and need to know what barcode is on it β the EAN-13 number, the UPC-A value, or the CODE128 string on a shipping label. This guide explains how barcode readers work when the input is an image rather than a live camera, what formats are supported, how ZXing decodes barcodes client-side with no upload, and how to get a reliable decode even from imperfect product photos.

Table of Contents
Barcode reader vs barcode scanner: what is the difference
The terms "barcode scanner" and "barcode reader" are often used interchangeably, but they describe two fundamentally different input methods β and choosing the wrong one is why people get stuck when they need to decode a barcode from a photo.
A barcode scanner reads barcodes from a live source β a laser beam sweeping across a physical barcode at a retail checkout, or a camera app on your smartphone pointed at a product. The input is a real-time stream of data from a physical barcode. The barcode must be present in front of the scanner, in the right orientation, at the moment of scanning.
A barcode reader (also called a barcode decoder) works with a static image file. You provide a JPEG, PNG, WebP, or any image that contains a barcode β a product photo, a screenshot of packaging, a scan of a receipt, or a cropped image from a PDF. The reader analyzes the pixel data and extracts the barcode value without any camera, scanner hardware, or live feed.
The decoding algorithm is identical in both cases. ZXing (Zebra Crossing) β the open-source library used by the SammaPix Barcode Reader β is the same library that powers Android's built-in barcode scanning. When you upload a product photo, ZXing applies the same detection and decoding logic it would apply to a live camera frame. The barcode in the image is decoded to the same result you would get by scanning the physical product.
The practical implication: if you have a clear photo of a product and need its barcode value β the 13-digit EAN number on the back of the box β you do not need the physical product in front of you. The image is enough.
Supported barcode formats: EAN, UPC, CODE128, QR and more
The SammaPix Barcode Reader uses ZXing, which supports all major 1D barcode formats used in retail, logistics, and industrial applications β plus QR codes. The format is detected automatically from the image. You do not need to specify which format the barcode uses before uploading.
Here is what each format encodes and where you encounter it:
- EAN-13: The 13-digit barcode on virtually every retail product sold in Europe, Asia, and most of the world. The 13 digits encode a country prefix, a company prefix, a product reference, and a check digit. This is the barcode you see on the back of food packaging, books (ISBN barcodes are EAN-13), cosmetics, and electronics.
- EAN-8: A shorter 8-digit variant of EAN-13, used on very small packaging where a full 13-digit barcode does not fit β lip balm tubes, small spice jars, and similar compact products. Assigned by GS1 on request.
- UPC-A: The 12-digit barcode standard in North America. Every product sold in US or Canadian retail stores has a UPC-A code. Structurally, UPC-A is a subset of EAN-13 β an EAN-13 with a leading zero is functionally the same as the UPC-A without it.
- UPC-E: A compressed 6-digit version of UPC-A, used on very small packaging in the US market. The full 12-digit value is recoverable from the abbreviated form.
- CODE128: A general-purpose barcode for alphanumeric data β letters, numbers, and special characters. Used in logistics, shipping labels, inventory management, and any system where the value is not a standardized retail product number. Compact and high-density.
- CODE39: An older alphanumeric format supporting uppercase letters and digits. Widely used in industrial, military, and healthcare applications. Longer than CODE128 for the same data, but supported by virtually all barcode scanners including older hardware.
- ITF (Interleaved 2 of 5): A 14-digit numeric barcode for outer shipping cartons, pallets, and cases. Printed directly on corrugated cardboard in warehouse and logistics environments. Decoding an ITF barcode from a photo of a cardboard box is a common use case.
- QR Code: The 2D matrix barcode for URLs, text, contact cards, and Wi-Fi credentials. Decodes from the same image upload as 1D barcodes. If an image contains both a 1D barcode and a QR code, ZXing detects whichever is more prominently positioned.
How ZXing decodes a barcode from an image (technical)
ZXing (Zebra Crossing) is an open-source barcode library originally written in Java and ported to JavaScript as zxing-js. It implements the decoding specifications for each barcode format (ISO/IEC 15417 for CODE128, ISO/IEC 16388 for CODE39, ISO/IEC 15420 for EAN/UPC, and others).
Here is what happens inside ZXing when you upload an image:
- Image rendering. The browser reads the image file and renders it to an HTML Canvas element. The Canvas exposes the raw pixel data as a flat RGBA array β four values per pixel (red, green, blue, alpha) for every pixel in the image.
- Grayscale conversion and binarization. ZXing converts the color image to grayscale and applies adaptive binarization β a process that determines a local threshold for each region of the image to distinguish dark bars from light spaces. This is why ZXing can decode barcodes with uneven lighting or slight shadows: it adapts the threshold locally rather than using a single global cutoff.
- Row scanning. For 1D barcodes, ZXing scans multiple horizontal rows across the binarized image. For each row, it measures the widths of alternating dark and light bands. The ratio of these widths encodes the barcode data according to the specific format specification.
- Format detection. ZXing tries to match the measured pattern against each supported format. For EAN-13, it looks for guard bars at the start, middle, and end. For CODE128, it identifies the start character pattern. The first successful match determines the format.
- Check digit verification. For EAN-13 and UPC-A, ZXing computes the expected check digit from the first 12 digits and compares it to the decoded 13th digit. A mismatch means a decode error. CODE128 uses a modulo-103 check character. CODE39 can optionally verify a modulo-43 check character.
- Result output. The decoded text value and detected format are returned. The entire process runs in your browser's JavaScript engine. No network request is made at any point.
ZXing's adaptive binarization is the key reason it outperforms simpler barcode readers on real-world product photos: lighting is rarely perfect, and a single global threshold would fail on images with shadows or gradient backgrounds. The local adaptation compensates for most real-world lighting conditions.
Decode a barcode from a product photo β free, no account
EAN-13, UPC-A, CODE128, CODE39, ITF, QR β all decoded in your browser via ZXing. No upload, no server, no signup. Copy the decoded value instantly.
When you need to read a barcode from an image
Camera-based scanning is convenient when you have the physical product in hand. But there are many everyday situations where you have an image of a barcode rather than the physical item:
- Product identification from a photo. A colleague or supplier sends you a product photo via email or WhatsApp. You need the EAN-13 or UPC-A number to look it up in a catalog, enter it into an inventory system, or verify it matches your database. The barcode is visible in the photo β but the physical product is not in front of you.
- Inventory audit from photos. You photographed shelves, products, or storage areas during an audit and now need to extract the barcode values from the photos on your desktop computer β without going back to rescan each item. Upload the photos one by one to decode the barcode values.
- Shipping label on a PDF or scan. You received a delivery confirmation or shipping document as a PDF with a CODE128 tracking barcode. You need the tracking number without manually reading the human-readable text below the barcode. Decode from the PDF page screenshot.
- Product listing verification. You are listing products on an e-commerce platform and want to verify that the EAN-13 barcode on the product matches the GTIN you entered. Take a photo of the product, decode the barcode, compare the value.
- Verifying generated barcodes. You generated a barcode using the SammaPix Barcode Generator and want to confirm it decodes to the correct value before printing it on labels. Upload the PNG or SVG-rendered image to the barcode reader and verify the decoded output.
- Desktop computer without a barcode scanner. You work on a desktop that does not have a mobile device or handheld scanner readily available. A browser-based barcode reader lets you decode barcodes from any image file without leaving your workstation.
Barcode format comparison table
When you decode a barcode from an image, the detected format tells you important context about the barcode β where it came from and what the value represents:
| Format | Data type | Typical source | What to do with the decoded value |
|---|---|---|---|
| EAN-13 | 13 digits | Retail product packaging (Europe, Asia, worldwide) | Look up in barcodelookup.com, Google, or Amazon. First 2-3 digits = country prefix. |
| EAN-8 | 8 digits | Small retail packaging | Search in product databases. Less common β smaller product range. |
| UPC-A | 12 digits | Retail product packaging (US, Canada) | Look up in Amazon.com or US product databases. Prepend 0 to convert to EAN-13. |
| CODE128 | Alphanumeric string | Shipping labels, internal inventory, tracking numbers | Enter into tracking system (UPS, FedEx, DHL) or internal inventory database. |
| CODE39 | Uppercase alphanumeric | Industrial, military, healthcare asset tags, library books | Look up in internal asset management system. Not in public product databases. |
| ITF | 14 digits | Outer shipping cartons, warehouse pallets | First digit = packaging level indicator (1=each, 2=inner pack, 3=case). Look up GTIN in GS1. |
| QR Code | URL, text, Wi-Fi, vCard, etc. | Marketing, menus, product pages, digital links | Open URL in browser, save Wi-Fi credentials, add contact to address book. |
How to decode a barcode from a photo, step by step
- Go to sammapix.com/tools/barcode-reader in any modern browser β Chrome, Firefox, Safari, or Edge. No account, no extension, no download required.
- Upload your image. Click the upload area or drag and drop the image file. JPEG, PNG, WebP, and other standard formats are supported. The image stays in your browser β it is not sent to any server. Alternatively, use the camera button to switch to live camera scanning mode if the barcode is physically accessible.
- Wait for ZXing to decode. The decoding is near-instant for clear images. The detected barcode format (EAN-13, CODE128, etc.) and the decoded value appear immediately below the image preview.
- Copy the decoded value. Click Copy to copy the barcode value to your clipboard. For EAN-13 and UPC-A, this is the number you can search in a product database. For CODE128, this is the tracking number, SKU, or inventory code.
- If detection fails, crop and retry. If the barcode is not detected, crop the image so the barcode fills most of the frame, then upload the cropped version. A barcode that occupies 10% of a large image may not decode reliably, but the same barcode cropped to fill 80% of the frame will decode correctly. See the troubleshooting section below for additional tips.
The entire process takes under 10 seconds for a clear barcode image. For batches of product photos, the best workflow is to keep each image cropped tightly to the barcode area before uploading.
After decoding: how to look up a product by barcode number
Once you have the decoded EAN-13 or UPC-A number, there are several reliable ways to identify the product:
- Google search. Paste the barcode number directly into Google. For well-known products, the product name and brand appear in the first results. This is the fastest method for common consumer goods.
- Amazon search. Paste the UPC-A or EAN-13 into the Amazon search bar. Amazon's product catalog is indexed by GTIN, so well-known products resolve directly to their product listing page.
- barcodelookup.com. A dedicated barcode-to-product database covering millions of retail products. Free lookups for common products; full database access requires a subscription. Covers EAN-13, UPC-A, and ISBN barcodes.
- Open Food Facts (for food products). world.openfoodfacts.org is a free, open database of food products indexed by EAN-13 barcode. It includes nutritional information, ingredients, and allergens β useful for food safety and dietary checking.
- GS1 Verified by GS1. The official GS1 product database (gepir.gs1.org) allows lookups of registered GTINs. It identifies the company that registered the barcode, though not always the specific product. Useful for supply chain verification and brand authentication.
CODE128 and CODE39 barcodes are internal or logistics codes and are not in public product databases. If you decode a CODE128 shipping number, look it up in the carrier's tracking system (UPS, FedEx, DHL, USPS). Internal SKU codes must be looked up in your own inventory system.
Decode any barcode format from a photo β no upload, no account
ZXing runs locally in your browser. EAN-13, UPC-A, CODE128, CODE39, ITF, QR. Copy the value, look it up in any database. Free.
Privacy: why no-upload matters for barcode decoding
Many barcode decoder tools online are server-based: you upload your image, it is processed on their server, and the result is returned. For consumer product photos this is usually harmless. But there are scenarios where uploading is a real privacy concern.
Product photos in business contexts often contain proprietary information. A photo of a supplier's shipping label may reveal your logistics partner, your order volume, or your internal SKU system. A photo of a pharmaceutical product may reveal the patient's medication. A photo of a document with a CODE128 reference may expose a contract number or a confidential reference code.
When you upload an image to a third-party server for barcode decoding, both the image and the decoded value pass through that server. You have no control over retention policies or access logs. Server-based tools that offer "no data storage" are making a claim you cannot verify.
Browser-based decoding via ZXing eliminates this entirely. The image is read by your browser from your local file system. ZXing processes the Canvas pixel data in your browser's JavaScript engine. The decoded barcode value appears on screen. No network request is made. You can verify this in browser DevTools (F12, Network tab) β watch for outgoing requests while uploading and decoding. There are none.
Troubleshooting: when detection fails
ZXing is robust, but there are conditions that prevent reliable decoding. Here is how to diagnose and fix the most common issues:
| Problem | Likely cause | Fix |
|---|---|---|
| No barcode detected | Barcode too small relative to image size | Crop the image so the barcode fills 50-80% of the frame, then re-upload. |
| Decode fails on a clear image | Heavy JPEG compression artifacts around bar edges | Use a PNG screenshot or a higher-quality JPEG. Avoid double-JPEG (screenshotting a JPEG already on screen). |
| Wrong value decoded | Check digit mismatch due to blur or artifacts | Get a sharper image. Blur on individual bar edges causes misreads even when the barcode looks OK to the eye. |
| Fails on a photo at an angle | Perspective distortion beyond ZXing's correction range | Use a photo editor to correct perspective, or find a more frontal view of the barcode. |
| Low contrast barcode | Dark background, colored barcode, or faded print | Increase contrast in any image editor before uploading. ZXing works best on dark-on-white barcodes. |
The most reliable barcode images for decoding are screenshots rather than photos β they have no perspective distortion, no blur, no JPEG artifacts, and the barcode is rendered at screen resolution. If you can take a screenshot rather than photographing a screen, do so.
Related tools
- Barcode Reader: the tool covered in this article. Decode EAN-13, EAN-8, UPC-A, UPC-E, CODE128, CODE39, ITF, and QR from any image. ZXing runs locally. No upload, no account.
- Barcode Generator: generate a barcode from any value β CODE128, EAN-13, EAN-8, UPC-A, CODE39, ITF-14. Download PNG or SVG. No upload, no account. See barcode generator guide.
- QR Code Reader: decode any QR code from an image or live camera. Uses jsQR running locally. No upload, no account. See QR code reader guide.
- How to scan a barcode from a picture: step-by-step guide for the specific scenario of reading a barcode from a product photo or screenshot β the most common reason people need a barcode reader rather than a scanner app.
- PDF to Image: extract pages from a PDF as images. Useful when a barcode you need to decode is embedded in a PDF document β convert the page to an image and upload it to the barcode reader.
All your barcode tools β all in your browser
Decode barcodes from images, generate barcodes for labels, read QR codes from screenshots β without uploading anything anywhere. No server. No signup. No watermark.
FAQ
What is the difference between a barcode reader and a barcode scanner?
A barcode scanner uses a live camera or laser to read a physical barcode in real time β the handheld device at a retail checkout or the camera app on your phone pointed at a product. A barcode reader (also called a barcode decoder) works with a static image file: a product photo, a screenshot of packaging, or any JPEG or PNG on your device. Both use the same underlying decoding algorithm β ZXing, for example, powers both the live camera scanner on Android and the image-based reader on SammaPix. The difference is the input source: live feed vs. image file.
What barcode formats does the SammaPix Barcode Reader support?
The SammaPix Barcode Reader uses ZXing (Zebra Crossing), which supports the following 1D formats: EAN-13, EAN-8, UPC-A, UPC-E, CODE128, CODE39, ITF (Interleaved 2 of 5), and Codabar. It also decodes QR codes from the same image upload. This covers the vast majority of product barcodes on retail packaging, shipping labels, inventory tags, and asset stickers.
Can I read an EAN-13 barcode from a product photo?
Yes, as long as the barcode is clearly visible in the photo. The best results come from a photo taken directly in front of the barcode (not at an angle), in good lighting, with the barcode in sharp focus. ZXing can tolerate some perspective distortion and minor blur, but extreme angles or heavy motion blur will cause detection failure. If the photo is borderline, try cropping to show primarily the barcode area and re-uploading the cropped image. For most clear product photos taken with a modern phone, EAN-13 and UPC-A decoding is reliable.
Does the barcode reader upload my image to a server?
No. ZXing is a JavaScript library that runs entirely in your browser. The image you upload is processed locally using Canvas pixel data β no file or barcode value is sent to any server. You can verify this by opening browser DevTools (F12), going to the Network tab, and watching for outgoing requests while you upload an image and decode a barcode. You will see no network requests carrying your image data. This is important when the product or image contains proprietary information you would prefer to keep off third-party servers.
What is the difference between a 1D barcode and a QR code?
A 1D barcode (EAN-13, UPC-A, CODE128) is a horizontal strip of parallel bars encoding a short numeric or alphanumeric string. It is read by a horizontal laser or camera sweep. Retail products, shipping labels, and inventory tags use 1D barcodes. A QR code is a 2D matrix that encodes much more data β URLs, full text, contact cards, Wi-Fi credentials β in a square grid that can be read from any angle. The SammaPix Barcode Reader decodes both from the same image upload. The format is detected automatically.
Can I use the barcode reader to look up a product from its barcode number?
The barcode reader decodes the numeric or text value encoded in the barcode β for example, 4006381333931 for a Stabilo pen. It does not automatically look up the product in a database. Once you have the decoded EAN-13 or UPC-A number, you can search it in barcode lookup services such as barcodelookup.com, buycott.com, or by searching the number directly in Google or Amazon. Product databases vary in completeness, particularly for regional or less common products.
Why would I need to read a barcode from an image rather than using my phone camera?
There are several practical scenarios where image-based reading is necessary. You received a product photo via email or WhatsApp and need the barcode value without having the physical product. You photographed packaging or a store shelf and want to decode barcodes from the photos on your desktop computer. The barcode is on packaging in a PDF or document you received. You are auditing inventory and have a batch of product photos and need to extract barcode values without scanning each item physically. A colleague sent a screenshot of a product label and you need to identify the product. In all these cases, a browser-based barcode reader that accepts image files solves the problem without needing a hardware scanner or smartphone.
What should I do if the barcode reader cannot detect the barcode in my image?
Detection failures are almost always caused by image quality issues. Try these steps in order: First, crop the image so the barcode fills most of the frame β ZXing performs better on barcodes that occupy a significant portion of the image. Second, check the contrast: the dark bars should be clearly darker than the white spaces, with no heavy shadows across the barcode. Third, check for blur: even slight blur on the bar edges can prevent decoding β try a sharper photo or higher-resolution screenshot. Fourth, check for perspective angle: if the barcode is photographed at a steep angle (more than about 20-30 degrees off-center), try to find a more frontal view or use photo editing to correct the perspective. Fifth, check for partial coverage: make sure all bars are visible with clear quiet zones (the white margins on each side of the barcode). If all else fails, the barcode may have print damage, low contrast due to fading, or the image quality is too low for any decoder to recover.