Barcode & QR Code Reader
Scan barcodes and QR codes from an uploaded image or live camera feed.
Sobre esta ferramenta
Decode barcodes and QR codes instantly — either by uploading an image file or by pointing your device's camera at a code for live scanning. The tool uses the ZXing-js library to support a wide range of formats including QR Code, Data Matrix, PDF417, Code 128, Code 39, EAN-13, EAN-8, UPC-A, UPC-E, Aztec, and more. Results show the decoded value, the barcode format type, and a copy button. If a URL is detected, a safe preview link is shown. All decoding happens entirely in your browser.
Como usar
- 1 Click 'Upload Image' to select a photo containing a barcode or QR code.
- 2 Alternatively, click 'Use Camera' to enable live scanning with your device camera.
- 3 Wait for the decoder to process the code — results appear below.
- 4 Copy the decoded value with the Copy button.
- 5 If a URL is detected, click the preview link to verify before visiting.
What a barcode scanner actually does
A barcode reader doesn't "read" a picture the way you read a label — it locates a region of high-contrast stripes or a 2-D grid, samples the brightness across it, and maps the pattern of widths back to the symbology's lookup table. A 1-D barcode like EAN-13 encodes each digit as a fixed sequence of bar and space widths; a 2-D code like QR or Data Matrix encodes bits in a square matrix and adds Reed–Solomon error correction so a partially damaged code still decodes. This tool hands that job to the open-source ZXing ("Zebra Crossing") engine, which can recognise QR Code, Data Matrix, PDF417, Aztec, Code 128, Code 39, Code 93, EAN-13, EAN-8, UPC-A, UPC-E, ITF, Codabar, and the RSS/DataBar family — all from one decoder.
How decoding happens here, step by step
When you upload an image, the tool draws it onto an off-screen canvas and downsizes it to fit within 640×480 pixels before decoding. That resize is deliberate: a 12-megapixel phone photo of a tiny barcode is mostly wasted detail, and a smaller bitmap is both faster to process and less likely to confuse the locator. ZXing then converts the canvas to grayscale, builds a black/white "binarized" view, hunts for the finder or guard patterns, and reads out the encoded value plus the format name. In live-camera mode it does the same thing on every video frame continuously, so the result pops up the instant a code enters the frame.
One practical detail worth knowing: the ZXing library itself is fetched on demand from a public CDN (unpkg) the first time you scan, so the very first decode needs an internet connection. After that, the actual decoding of your image or camera frames runs entirely in your browser — the picture and the video feed are never uploaded to any server.
A worked example
Suppose you photograph the back of a paperback and upload it. The image is 4000×3000; the tool scales it to 640×480, ZXing finds the guard bars at each end of the stripe block, measures the relative widths, and decodes 9780306406157 with the format reported as EAN_13. Because that value isn't a web address, no link preview appears. Now scan a QR code on a poster instead: it decodes to https://example.com/event, the tool detects the https scheme, and offers an "Open safely" preview link with rel="noopener noreferrer" so you can confirm the destination before visiting — a small but real safeguard against malicious QR codes.
Why a scan sometimes fails
- Blur and focus. The single most common cause. A barcode that looks fine to your eye can still be too soft for the binarizer to resolve clean edges. Tap to focus before shooting, or move slightly farther away.
- Glare and reflection. Glossy packaging and phone screens bounce light across the bars and wash out the contrast. Angle the code away from the light source.
- Cropping the quiet zone. 1-D and 2-D codes both need a margin of blank space around them. If you crop right to the first bar, the locator can't find the start.
- Low resolution after downscaling. A barcode that occupies only a small corner of a large photo may shrink below the readable threshold once the image is reduced to 640×480. Crop to the code first so it fills more of the frame.
- Wrong expectation. A stylised or partially printed code may simply not be a valid symbology. If nothing decodes across several clean attempts, the code itself may be damaged.
Where this is genuinely useful
Inventory spot-checks without a dedicated scanner gun; reading a UPC to look up a product; pulling the text out of a QR code on a flyer to see exactly where it points before tapping it; recovering the data from a screenshot of a boarding pass or ticket (often PDF417 or Aztec); and verifying that a barcode you generated elsewhere actually encodes the value you intended. For the last case, generate a code with a QR or barcode generator, then read it back here as a round-trip sanity check.
Camera scanning tips
Grant camera permission when prompted, and if your device has multiple cameras the tool lets you pick — the rear camera is almost always the better choice because it focuses closer and has a higher resolution sensor. Hold the code steady and let autofocus settle; continuous scanning means you don't press a button, so the moment the frame is sharp and the code is centred in the guide box, the value appears. If a tab is left open, stop the camera to release it for other apps.
Perguntas frequentes
Crie QR codes personalizados para URLs, texto, Wi-Fi, contatos e mais — grátis, sem cadastro.
Gere códigos de barras nos formatos Code 128, Code 39, EAN-13, UPC-A e ITF-14 e baixe como SVG ou PNG.
Converta qualquer arquivo de imagem para uma string URI de dados codificada em Base64.