Barcodes are essential for industries like retail, logistics, and manufacturing, which involve long-distance transport, multiple reloads, and highly variable environmental conditions. All this can affect barcode labels, making them hard to read with traditional scanning devices.
Let’s take a look at common problems you’re likely to encounter when working with barcodes – and at what you can do to overcome them.
💡 We’ve included various examples of damaged barcodes in this article. You’re welcome to use our free Barcode Scanning Demo App to try scanning them.
📌 TL;DR
A damaged barcode can usually still be read if enough of its pattern survives.
- For a 1D barcode, the scanner needs the complete sequence of bar and space widths, from one intact line or pieced together from several.
- For a 2D code like QR or Data Matrix, the damage can’t exceed the code’s error-correction capacity.
- Camera-based scanners that use computer vision and machine learning recover far more damaged codes than laser scanners.
- Advanced proprietary scanners perform better than basic open-source libraries.
What types of barcode damage are there, and how do you compensate for each one?
There are seven common types of barcode damage and related issues: ripped labels, wear or scratches, poor printing, blur, small or distant codes, curves or angles, and poor lighting. They break a basic scan in different ways, so they need different fixes.
| Damage type | Why the scan fails | How to read it |
| Ripped or torn | Part of the symbol is missing | For 1D codes, use any intact horizontal line or reconstruct the code from fragments. For 2D codes, rely on error correction. |
| Worn, dirty, scratched or written over | Bars are broken in many places | Software that combines readable segments from several lines. |
| Poorly printed or faded | Bar widths are wrong because of ink spread or fading | Decoders trained on print defects. |
| Blurry | Edges smear and narrow bars merge | Deblurring-aware 1D decoding and refocusing. |
| Small or distant | Too few pixels per bar | Zoom, a fixed close focus, or higher resolution. |
| Curved or angled | The symbol is geometrically distorted | Computer vision that finds the least distorted region. |
| Poor lighting or glare | Bars and spaces blend together | Contrast enhancement, toggling the flashlight, and a change of angle to avoid glare. |
Ripped barcodes

Rough handling can rip off part of a label without making it unreadable. A 1D barcode such as UPC, EAN, Code 128 or GS1 DataBar stores its data in the width of its bars and spaces, not their height (with some exceptions). A good scanner can still read it as long as one unbroken horizontal line through all the bars survives.
A vertical rip is harder. Traditional scanners read along a single line, so once a tear cuts through every line, the scan fails. The Scanbot SDK’s Barcode Reconstruction solves this. It combines the intact segments of several scan lines into one complete sequence, so it can read ripped Code 128, Code 39, EAN-8, EAN-13 and UPC-A barcodes even when no single line is undamaged.
For critical labels, 2D symbologies add an extra safety net: QR and Data Matrix codes carry error-correction data that can rebuild missing parts.
Worn, dirty, or scratched barcodes

Scratches, dirt, scuffs and handwritten notes break the bars in many places. A laser scanner reads along a single line, so it fails as soon as every line crosses a defect. Camera-based software can do better because it sees the whole code at once.
We trained our Barcode Scanner SDK using computer vision algorithms and machine learning models to check for discrepancies in the barcode’s line sequence and restore any damaged parts. In most cases, this enables it to read the encoded data without issues.
Poorly printed or blurry barcodes

Bad print quality greatly reduces a barcode label’s readability. Ink spread makes bars too wide, and worn thermal print heads leave gaps or white streaks. Therefore, it’s crucial to use a label printer specifically made for barcodes.
However, should you encounter poorly printed barcode labels, modern scanning technology goes a long way in helping you read them. Thanks to the machine learning model powering our SDK, printing artifacts and washed-out lines don’t stand in the way of accurate scanning results.
Blur arises from motion, missing autofocus, or a photo taken too close. Narrow bars merge with their neighbors, so the bar widths can no longer be measured. In live scanning, the user should just hold the device still and let it refocus. With still photos, the software has to compensate.
The Scanbot SDK’s 1D Blur Scanner, on by default since v9.0.0, compensates for blurred, small and distant EAN and UPC codes, allowing you to read the barcode’s data correctly.
Very small or distant barcodes

Sometimes the problem is not the barcode label’s quality – what if a barcode is just too small or too far away?
Our Barcode Scanner SDK has two special scanning modes to deal with these problems: One lets you zoom in on distant barcodes. The other uses a locked camera focus to help you scan very small barcode symbologies like Micro QR. Zoomed scanning is especially important for warehousing and other use cases where the labeled items are not easily accessible. Fixed-focus scanning, on the other hand, is useful when scanning tiny labels, such as those on lab sample tubes.
Curved barcodes and difficult angles



Another common issue involves barcodes that can only be scanned from an angle or that are printed onto curved surfaces. They are challenging to read for traditional laser scanners, since the light doesn’t bounce off them correctly.
Mobile barcode scanning software using computer vision, on the other hand, can detect which areas of a barcode are least distorted to accurately read the data.
Barcodes in poor lighting conditions

Barcode scanners rely on the contrast between the black lines and the white space in between, so poor lighting can make a code unreadable. With smartphone-based scanners, you can use the built-in flashlight, although this can produce glare. That’s why your scanning software should be able to handle low-contrast barcodes as well.
When our Barcode Scanner SDK detects a poorly lit 1D barcode it cannot read, its machine learning model applies a binarization filter to enhance the contrast and retries the scan. For 2D barcodes, our algorithms can work around poor lighting conditions even without binarization.
Why do open-source barcode libraries struggle with damaged barcodes?
It comes down to how these libraries decode. The most popular open-source barcode scanning libraries, ZXing and ZBar, follow a fixed set of rules written for clean, sharp barcodes. When a barcode is damaged, blurry or poorly lit, those rules break, even if the data is still there.
Simplifying the image too early
Before reading a barcode, ZXing turns every pixel into pure black or white. On a sharp, well-lit label, that works fine. On a blurry, faded, or dim one, the gray edges get pushed to the wrong side, and the bars come out too wide or too thin.
If the contrast is too low, ZXing doesn’t try at all. Its maintainers say as much: one blurry sample needed to be “a lot sharper“, and barcodes on scanned documents failed because of “too much noise“.
Needing to find the code before the library can repair it
QR codes can survive up to 30% damage thanks to error correction, but only once the scanner has found them. ZXing finds a QR code by looking for its three corner squares, and it expects them to have specific proportions. One scratch or glare spot on a corner can hide the whole code from it. One user’s QR code failed for exactly this reason, even though an iPhone – using a different library – read it without trouble.
Reading 1D barcodes one line at a time
For regular barcodes, ZXing reads single horizontal lines across the bars, and each line has to be nearly perfect. It cannot combine the good parts of different lines. So, if a scratch crosses every line, every attempt fails. Tilted codes are a problem too: ZXing only rotates in 90° steps, and a barcode at 45° simply isn’t found.
Damaged codes can produce wrong results
When a damaged barcode does get decoded, a short check digit is often the only safeguard. In one case, a creased barcode on a battery pack was read as a completely different product code. The maintainer’s response: “a false positive is always possible” because “the whole library is a heuristic”.
The rules are hand-tuned, and nobody is tuning them anymore
ZXing’s rules were tuned by hand years ago, and making them handle damaged codes would take large amounts of test data and engineering time. ZXing is now in maintenance mode with no roadmap, and ZBar’s development stopped in 2012. ZBar users hit the same walls: A poorly printed label returned nothing, and the advice was to “print it bigger“, while a damaged QR code that a phone could read still fails.
How ML-based engines handle the same problems
Decoding engines built on machine learning tackle each of these weak spots:
- They keep the full image. Models work with the original grayscale detail instead of forcing everything into black and white.
- They find codes the way people do. Detectors trained on thousands of blurry, scratched, angled and poorly lit barcodes can spot a code even when a corner is damaged.
- They combine what survives. Barcode reconstruction pieces together the readable parts of many lines, so no single line has to be perfect.
- They handle any angle. Codes are found and straightened whatever their orientation or curve.
- They double-check results. Readings are confirmed across several camera frames before they are returned, which prevents false reads.
Conclusion: How to scan barcodes in any condition
Damaged, blurry and poorly lit barcodes are part of everyday work in retail, logistics and manufacturing. Open-source libraries like ZXing and ZBar work well for clean barcodes in good conditions. But real-world labels rarely stay pristine, and that’s where machine learning makes the difference.
The Scanbot Barcode Scanner SDK is made for real-world conditions. Its ML-powered computer vision reads scratched, torn, faded, and blurry barcodes reliably, 100% offline.
See for yourself with our Demo App, or start your 7-day trial and integrate the SDK into your app today. Have a specific use case? Talk to our experts.
FAQ
Can a damaged barcode still be scanned?
Often, yes. A 1D barcode can be read as long as the full sequence of bar and space widths can be recovered, from one intact line or from fragments of several. A 2D code can be read as long as the damage stays within its error-correction capacity.
How do I fix a barcode that won’t scan?
Improve the lighting, hold the device steady, move closer or zoom in, and check that the symbology is enabled in your scanner. If the code is physically damaged, use scanning software built for degraded codes. If all else fails,type in the human-readable digits and reprint the label.
Why won’t my barcode scan?
The most common causes are blur, a code that is too small or far away, glare or low contrast, a missing quiet zone, poor print quality, and physical damage such as tears or scratches. A symbology that is disabled in the scanner configuration is another frequent cause.
Can you scan a barcode that is partially torn off?
It depends on the direction of the tear. A 1D barcode torn horizontally can still be read if one full row of bars survives. If whole bars are missing across the entire height, the data is lost. 2D codes can rebuild missing parts with error correction.
How much damage can a QR code survive?
It depends on the error-correction level chosen when the code was generated. The QR standard defines four levels that restore about 7% (L), 15% (M), 25% (Q) or 30% (H) of the code’s data. Use level H for labels that will be handled roughly.
Do 2D barcodes handle damage better than 1D barcodes?
Yes. QR, Data Matrix, Aztec and PDF417 codes include Reed–Solomon error correction, so they can rebuild missing data. Most 1D barcodes only have a check digit, which lets scanners detect errors, but not correct them.
Can ZXing read damaged barcodes?
Only to a limited extent. ZXing needs sharp, high-contrast input. Their GitHub issues show repeated failures on blurry, noisy, low-contrast, creased or poorly printed codes. ZXing’s maintainer calls the library “a heuristic” where false positives are “always possible”.