# Scanning QR codes with a webcam

> Yes — a browser scanner can decode QR codes from a webcam with no install. Hold the code 30–60 cm from the lens, not close up: most webcams are fixed-focus around arm's length, so a code held at 10 cm is just blur. A 720p webcam resolves up to roughly version 10 comfortably at that range.

Source: https://useqr.app/docs/scanning/qr-scanning-with-a-webcam · Last reviewed 2026-08-21 · UseQR is free forever, MIT licensed, no signup.

---

## No install required

A browser can read the webcam directly, so desktop QR scanning needs no app. Open
[/scan](/scan), allow camera access when the browser asks (the permission model is
covered in [camera permissions and QR scanning](/docs/scanning/camera-permissions-and-qr-scanning)),
and hold the code up. Decoding runs inside the page — the video never leaves your
machine, which matters if the code contains a password or payment string.

## Hold it back, not close

The instinct is to push the code right up to the lens. That is exactly wrong. Most
webcams are **fixed-focus**, tuned for a person sitting at a desk — sharp from roughly
50 cm to infinity, soft below that. A code held at 10 cm is an unrecoverable blur no
matter how large it looks in the frame.

**Hold the code 30–60 cm from the lens** and let size, not proximity, do the work. If
the preview looks soft, move the code *away*, not closer.

## What a webcam can actually resolve

Decoders want roughly **3 pixels per module** or better (the reasoning is in
[module size vs camera resolution](/docs/spec/module-size-vs-camera-resolution)).
Take a typical webcam with a ~65° horizontal field of view: at 40 cm it sees a slice
of desk about 51 cm wide, so a 720p sensor (1280 px) delivers ~25 px/cm and 1080p
~38 px/cm. For a 10 cm printed code held at that distance:

| Code | Modules incl. [quiet zone](/glossary/quiet-zone) | 720p px/module | 1080p px/module |
|---|---|---|---|
| Version 3 | 37 | 6.8 | 10.2 |
| Version 5 | 45 | 5.6 | 8.4 |
| Version 10 | 65 | 3.8 | 5.8 |
| Version 20 | 105 | **2.4 — fails** | 3.6 |

So a 720p webcam comfortably handles anything up to about version 10; denser codes
need a 1080p camera, a larger print, or a shorter payload. If a code will routinely be
webcam-scanned, keep the payload short and check it with the [validator](/validate).

## Showing a phone screen to a webcam

Holding your phone's screen up to the laptop camera works, but stacks two screen
problems: glare off the glass and moiré between the two pixel grids. Raise the phone's
brightness, tilt it a few degrees, and hold it steady at 30–40 cm. If the code is
already *on the computer* — in an email, a page, a PDF — skip the camera entirely and
[scan the screenshot](/docs/scanning/how-to-scan-a-qr-code-from-a-screenshot) instead;
a pixel-perfect image beats any photograph of a screen.

## A 30-second checklist

- **Light the code**, and avoid sitting with a bright window behind it — backlight
  makes the camera expose for the window and silhouette the code.
- **Fill a third to a half of the frame.** More is unnecessary; less starves the
  decoder of pixels.
- **Hold still for a second.** Webcams in dim rooms use long exposures, and movement
  becomes blur.
- **Wipe the lens.** Laptop webcams collect fingerprints exactly where it hurts.

Developers wiring this into their own pages — rather than using ours — will find the
BarcodeDetector and library options in
[reading QR codes from a webcam in the browser](/docs/developers/read-qr-codes-from-a-webcam-in-the-browser).

## FAQ

### Can I scan a QR code with my laptop's webcam?
Yes. A browser-based scanner reads the webcam directly with nothing to install, and a 720p webcam resolves typical codes without trouble. Hold the code 30–60 cm from the lens, since most webcams cannot focus closer than that.

### Why is the code blurry in my webcam?
Almost certainly distance. Webcams are fixed-focus for a person at a desk, sharp from about 50 cm outward. Move the code further away rather than closer, and let it occupy a third to half of the frame.

### Is webcam scanning private?
It can be. A scanner that decodes in the page keeps the video on your machine and shows you the payload text without uploading anything. Check for that claim before using any online scanner with a code that contains a password or payment details.

### Why will my webcam not read a dense QR code?
Resolution. At typical distances a 720p webcam delivers about 25 pixels per centimetre, which runs out near version 10 for a 10 cm code. Use a 1080p camera, print the code larger, or shorten the payload so the code is less dense.

## Try it

- https://useqr.app/scan
- https://useqr.app/validate
