Image Size Reducer
Barcode extractor

Extract a Barcode From an Image

Drop in a photo, a scan, or a screenshot and let the barcodes be found and decoded for you. The values come back as text, ready to copy or export, without needing the original code.

  • Barcodes detected automatically in an image
  • EAN, UPC, Code128, QR, and Data Matrix
  • Several codes found in the same image
  • Values copied out as text or a file
  • Decoded in the browser, nothing uploaded
Open the barcode tool

Reading the Code, Not Cutting It Out

A barcode is only ever a way of carrying a number. Extracting it means recovering that number, and everything about the process is about legibility.

When a barcode is scanned at a till, a laser reads the pattern of bars and turns them back into digits. The bars themselves are meaningless without that reading; they are a printed representation of a value, and the value is the only useful part. That is what extraction is for. When you extract a barcode from an image, you are not cropping a rectangle and saving it as a picture, you are recovering the number it stands for. Which is why the quality of the source image matters so much: the same code that scans perfectly from a clean label can fail completely from a photograph taken at an angle, and the difference is never the code itself.

What the Barcode Tool Does

Barcodes and QR codes are detected in an image and decoded into their values, which can be copied or exported.

Automatic detection

Upload an image and the codes are located for you, with no need to draw a box around them first.

Decoded values

Each symbol is returned as the digits, letters, or link it encodes, along with the format it was read as.

Multiple codes at once

Several barcodes in one image are all found and decoded, rather than the reader stopping at the first.

Many formats

Common retail, logistics, and two dimensional formats are supported, from EAN and UPC to QR and Data Matrix.

Local processing

Decoding runs in the browser, so the image is never uploaded.

ImageSizeReducer

ImageSizeReducer

@imagesizereducer

The output is data, not a picture

It is worth being clear about the result. A barcode reader returns the value encoded in the symbol, a string of digits, letters, or both, along with the format it was recognized as. That is the whole deliverable, and it is usually all anyone needs: a product number to look up, a tracking reference to paste into a form, a link hidden inside a QR code. Keeping a picture of the code would add nothing, because the code can always be regenerated from the value if it is needed again.
Read this barcode
A barcode image beside the string of digits it decodes to
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

The quiet zone is not optional

Every barcode standard requires a blank margin around the symbol, wider than the bars themselves. This quiet zone is what tells a scanner where the code begins and ends, and without it, the reader cannot tell the leading edge of the pattern from the surrounding artwork. It is one of the most common reasons a code fails in a photograph. A label printed correctly but photographed with the margin cut off by the frame, or crowded by text and logos, is far harder to decode than one with breathing room on both sides.
Read this barcode
A barcode with a clear quiet zone beside one crowded by surrounding print
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Contrast is the whole mechanism

A barcode works by contrast: dark bars against a light space. A scanner is looking for that difference, so washing it out is the fastest way to make a code unreadable. Photographs are full of ways to reduce contrast: low light, a shadow across half the label, a shiny surface reflecting a window, printed bars that have faded or smudged. Plain black on white is not a style preference here, it is the format working as intended, and anything that moves away from it costs reliability.
Read this barcode
A high contrast barcode beside one washed out by glare and shadow
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Enough pixels across the bars

The bar pattern has to be sampled finely enough for the narrowest bar to be more than a smudge. In practice that means the code needs to occupy a decent share of the image, ideally filling the frame, rather than sitting small in the corner of a wide shot. Sharpness matters as much as size. A code photographed from far away and then enlarged will simply be a soft blur, because no processing can restore an edge that was never captured. When you extract a barcode from an image, cropping the picture down to the code before reading it is often the simplest improvement.
Read this barcode
A barcode filling the frame beside a tiny blurred one from a wide photo
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Angle and rotation

A barcode is read along the direction of its bars, and the lines have to be reasonably perpendicular to the scan for the pattern to be measurable. Tilted codes are handled up to a point, but past a certain angle the bars converge in perspective and the spacing no longer reads correctly. For a flat label photographed head on, this is rarely a problem. For a code on a curved surface, such as a can or a bottle, the bars bend across the shape and the outer edges compress, which is why those labels are often printed on a flat panel rather than wrapped around the whole object.
Read this barcode
A barcode read head on beside one distorted across a curved surface
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Several codes in one image

Real images often contain more than one symbol. A shipping label might carry a Code128 for the parcel, an EAN for the product, and a QR code for tracking, all on the same page. A good reader finds them all rather than stopping at the first, and reports the value of each along with its format. That is the difference between a simple scan and a real extraction, and it is what makes the result useful when the image is a document rather than a single code.
Read this barcode
A shipping label containing several different barcode types decoded at once
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Why photographs fail

It is almost never the barcode's fault. The failures cluster around a few familiar causes: glare from a glossy surface, a shadow cutting across the bars, too few pixels on the symbol, a curve distorting the spacing, or a print so worn that bars have merged. The fix is usually physical rather than digital. Better light without direct reflection, a flatter angle to the surface, and moving closer so the code fills more of the frame will rescue most images that a filter cannot. Re-scanning or re-photographing the label is often faster than trying to decode a hopeless one.
Read this barcode
A barcode photo retaken with even light and the code filling the frame
ImageSizeReducer

ImageSizeReducer

@imagesizereducer

Made in the browser

The images people need to read are frequently sensitive: shipping labels with addresses, invoices, membership cards, internal documents. Sending them to a server to be decoded is a privacy cost with no benefit. Detection and decoding happen on the device. There is no upload and no account, so a label can be read without the document leaving the machine it was photographed on.
Read this barcode
A barcode being decoded inside a browser window

How to Extract a Barcode From an Image

Four steps. The first is worth getting right, since a flatter, closer photograph decodes far more reliably than a distant one.

Step 1

Upload the image

Use a photo or scan where the code is sharp and fills a good part of the frame, with even light and no glare across the bars.

Step 2

Let the codes be found

The image is searched automatically for barcodes and QR codes, including several symbols on the same document.

Step 3

Read the values

Each detected symbol is shown with its decoded value and format, so you can tell instantly whether the read was clean.

Step 4

Copy or export

Take the values out as text, or download them as a file when an image holds a batch of codes.

Who Reads Barcodes From Images

Four kinds of work where a code has to be recovered from a picture.

WH

Warehouse teams

shipping labels and packing slips

A parcel photographed on the loading dock still needs its tracking number typed up. Reading it straight from the image saves retyping it by hand.

OS

Online sellers

product codes and listings

Supplier photos often already show the product barcode. Pulling the number out of the picture is faster than tracking down the spec sheet.

DV

Developers

testing and test data

Grabbing real values out of screenshots is handy when building a scanner of my own or filling a fixture. Browser-based reading keeps client material off a server.

RE

Researchers

documents and archives

Scanned paperwork is full of codes that were never typed anywhere else. Extracting them from the scan turns a pile of images back into usable data.

Frequently Asked Questions

How barcode extraction works, and why an image sometimes refuses to decode.

Read the code, keep the number

Upload a photo or a scan, let the barcodes be detected, and copy the decoded values out as text or a file.

Read this barcode
The Value Beneath the Bars

A barcode is a number wearing a pattern

Strip away the bars and a barcode is nothing more than a value written in a form a machine can read quickly, which is why the only useful thing to recover from one is that value. Everything about doing it well comes back to legibility. The quiet zone tells the reader where the pattern begins, contrast is the entire mechanism, and the symbol needs enough sharp pixels across it for the narrowest bar to register as a bar rather than a smudge. Glare, shadow, distance, and a curved surface account for almost every failure, and a flatter, closer photograph fixes more than any filter. Because a shipping label often carries several codes, a reader that finds them all is worth more than one that stops at the first. Keep the image on the device while it is decoded, and when you extract a barcode from an image you end up with the one thing that mattered: the number.

Smaller files, same picture.