About this tool
Upload an image with a one-dimensional barcode to read its type and value. Supports Code 128, Code 39, Code 93, EAN, UPC, ITF and Codabar — handy for reading product or tracking numbers without a scanner.
Typical uses
- Read the EAN on a product packaging photo
- Extract a tracking number from a shipping label screenshot
- Check that a barcode you generated reads correctly
How to use
Upload a sharp image containing a complete one-dimensional barcode.
Read its detected format and value, then copy the result if needed.
Images are limited to 30 MB. Supported common formats include Code 128, Code 39, Code 93, EAN, UPC, ITF and Codabar.
Supported formats and what the result shows
Decoding runs in your browser with ZXing’s JavaScript port (@zxing/browser 0.1.5) with nine one-dimensional formats enabled. The table shows real results: each example value from this site’s batch barcode generator was turned into bars and read back with a reader set up the same way. The “Format” column is the reader’s internal name, shown as is.
| Generator format | Value entered (→ with check digit) | “Format” shown | Decoded text |
|---|---|---|---|
| Code 128 | DOC80-12345 | CODE_128 | DOC80-12345 |
| Code 39 | DOC80-12345 | CODE_39 | DOC80-12345 |
| Code 93 | DOC80-12345 | CODE_93 | DOC80-12345 |
| EAN-13 | 590123412345 → 5901234123457 | EAN_13 | 5901234123457 |
| EAN-8 | 9638507 → 96385074 | EAN_8 | 96385074 |
| UPC-A | 03600029145 → 036000291452 | UPC_A | 036000291452 |
| UPC-E | 425261 → 04252614 | UPC_E | 04252614 |
| ITF | 1234567890 | ITF | 1234567890 |
| ITF-14 | 1001234567890 → 10012345678902 | ITF | 10012345678902 |
| Codabar | A123456A | CODABAR | A123456A |
- ITF-14 is reported as ITF. UPC-E shows 8 digits (number system 0, six digits, check digit). An EAN-13 that starts with 0 is reported as UPC_A without that 0: 0012345678905 appears as UPC_A 012345678905. Keep the length difference in mind when matching stock numbers.
- Codabar results keep the A–D start and stop letters (A123456A); other scanners may leave them out, so compare like with like.
- ITF needs at least 6 digits: the 4-digit 1234 was not found.
- QR codes, Data Matrix, PDF417 and GS1 DataBar are not read; use the QR code decoder for QR.
The last digit of EAN and UPC codes is a check digit. The reader recomputes it and treats a mismatch as “not found”; it never shows a doubtful result. The rule: multiply the body digits by 3, 1, 3, 1 … starting from the right, add them up and take the distance to the next multiple of 10. For the body 490123456789 the weighted sum is 126, so the check digit is 4 and the full number 4901234567894. When we replaced the bar pattern of the last digit of 5901234123457 with the pattern for 8, the reader returned “No barcode found. Try a sharp, complete, high contrast image.”
Which rows are scanned, and which angles work
Decoding runs in four passes, most reliable first: (1) the original quick scan of 15 rows around the middle; (2) the same quick scan on the image turned 90° clockwise; (3) if still nothing, a “try harder” scan of the whole image, starting at the middle row and alternating up and down to the top and bottom edges, with rows spaced the image height ÷ 256 apart (rounded down, at least 1 px); (4) the same on the turned image. A result from passes 3 and 4 is kept only if it is confirmed: a separate 10 px strip just above or below the row it came from must give the same value and format with the quick scan. The table shows the rows the try-harder scan covers:
| Image height | Row spacing | Rows scanned (px) | Rows |
|---|---|---|---|
| 600 px | 2 px | 0–598 | 300 |
| 1000 px | 3 px | 2–998 | 333 |
| 2448 px | 9 px | 0–2439 | 272 |
| 3024 px | 11 px | 5–3019 | 275 |
| 4000 px | 15 px | 5–3995 | 267 |
- Tested: a 40 px tall EAN-13 in a 1000 px tall image was read when centred at every position we tried, y = 20, 50, 250, 500, 750, 950, 980. In a 4000 px tall image (rows 15 px apart), barcodes 16 px tall or more were read at all three offsets we tried; 8 and 12 px tall ones only at some.
- Orientation: upside down (180°) makes no difference, because each row is also read backwards. Passes 2 and 4 search the image turned 90°, so vertical barcodes are read too: a vertical EAN-13 decoded in 900 × 400, 400 × 900, 4000 × 3000, 3000 × 4000 images.
- Tilt: barcodes within about 20° of horizontal or vertical were read (tested: 10°, 20°, 70°, 80°); diagonal angles such as 30°, 45°, 60° were not. Straighten those first.
- Why the confirmation: we ran 60 barcode-free 1000 × 750 images of each kind (random grey noise, random coloured rectangles, dense 14 px text lines, random vertical stripes). The try-harder scan alone “found” a barcode that is not there in 1, 3, 7, 0 of them respectively (text pages came back as EAN-13 or EAN-8, for example); the original quick scan and the four-pass page found 0.
- Each image returns one result. A sharp barcode at 1 px per module still decoded in our tests, so small size alone was not what made barcodes fail.
Blank space beside the bars: how much each format needs
Barcodes need a blank area (quiet zone) to their left and right. We placed dark vertical marks on both sides and moved them away step by step to find the smallest gap, in modules (the width of the narrowest bar), that still decoded. This site’s barcode generator always leaves 12 modules per side.
| Format | Smallest gap (modules) |
|---|---|
| EAN-13 | 3 |
| UPC-A | 3 |
| Code 128 | 7 |
| Code 39 | 8 |
| ITF | 10 |
| Codabar | Fails with any dark mark on the same row |
- EAN and UPC are the most tolerant and ITF the most demanding. When a price tag, text or the edge of a package sits next to the bars in a photo, leave more background on both sides when you crop.
- Codabar is the exception. The reader used here treats everything from the first to the last dark pixel of a row as the barcode, so any other dark object on the same horizontal line, even 40 modules away, stops it. Crop Codabar images down to the barcode itself.
Messages and what to do
| Message | Cause and fix |
|---|---|
| Choose an image file. | The file has no image type and its extension is not png, jpg, jpeg, webp, gif or bmp. |
| Image must be at most 30 MB. | The file is larger than 30 MB. Compress or crop it and retry. |
| No barcode found. Try a sharp, complete, high contrast image. | Every failure ends here: no barcode, a QR code, a barcode tilted diagonally (about 30°–60°), a barcode shorter than the row spacing, too little blank space, a wrong check digit, or an image format the browser cannot open. Work through the sections above; cropping close to the barcode and turning it level or upright fixes most cases. |
Choosing a file under “Upload barcode image” starts decoding at once, and Ctrl+V / ⌘V pastes a screenshot (“You can also paste an image from your clipboard.”); after a success, “Copy content” copies the text. Neither the image nor the result is uploaded.
Frequently asked questions
Why did reading fail?
Use a sharp, complete image without strong tilt or glare, with clear space on both sides of the barcode.
Can it read QR codes?
This tool reads one-dimensional barcodes. Use the QR code decoder for QR codes.
Image size limit?
Up to 30 MB per image.
Suggest an improvement to this tool
Missing an option, something awkward to use, or a wrong result? Let us know.