ToolSite

How to Scan and Decode a QR Code From an Image File

Decode QR codes from screenshots and image files without a phone camera. Extract URLs, WiFi credentials, and text using our free browser-based decoder.

By ToolSite5 min readguides

When You Can't Point Your Phone at It

QR codes appear in screenshots, PDFs, emails, and photos where you can't physically point a second device at the screen. You need the data from the QR code, but the code is already on your device as an image file. Holding your phone up to your laptop screen to scan a QR code from a PDF is awkward, unreliable (screen glare ruins the scan), and slow.

The QR Code Decoder extracts the data directly from an image file. Upload the file, and the tool reads the QR code and displays the contents: the URL, the WiFi password, the contact card fields, the plain text. No second device needed. No camera alignment struggles.

How It Works

The decoder runs entirely in your browser:

  1. Loads the image into a canvas element in your browser.
  2. Scans the image for QR code finder patterns (the three large squares at three corners of every QR code).
  3. Once a QR code is located, it maps the module grid and decodes the pattern of black and white squares into binary data.
  4. The binary data is interpreted according to QR code encoding standards (numeric, alphanumeric, byte, or kanji mode).
  5. The resulting text is displayed, with special handling for recognized data types (URLs become clickable links, WiFi credentials show network name and password separately, vCard fields are parsed).

All processing is local. The image never leaves your browser. This matters when the QR code contains sensitive data like WiFi passwords, private URLs, or personal contact information.

What Gets Decoded

The decoder recognizes and handles these data types:

  • URLs: displayed as a clickable link you can open directly.
  • Plain text: displayed as-is with a copy button.
  • WiFi credentials: SSID, encryption type, and password extracted and displayed in labeled fields. You can copy the password without retyping it.
  • Contact cards (vCard): name, phone, email, organization, and URL parsed into individual fields. Copy any field or the full contact block.
  • Email addresses: displayed with a mailto link so you can compose an email in one click.
  • Phone numbers: displayed with a tel link for one-click dialing on mobile.
  • SMS messages: phone number and message body extracted and displayed separately.

Common Use Cases

Conference slides and PDFs: a speaker puts a QR code on a slide for feedback or resource links. You're watching remotely or reviewing the deck afterward. The slide is a PDF page or screenshot. Decode the QR directly from the file instead of squinting at a blurry slide image.

Email signatures: someone's email signature has a QR code for their contact card or website. Screenshot the signature area, upload to the decoder, and get their details without manual typing. No risk of transposing digits in a phone number.

Verification before printing: you generated a QR code for a URL and want to confirm it encodes the right link before printing 500 flyers or stickers. Download the generated QR image, upload it to the decoder, and verify the decoded data matches what you entered. This simple round-trip check catches data entry errors that would otherwise waste an entire print run.

Photos of physical codes: you photographed a QR code on a sign, product label, or poster. Instead of visiting the location again or trying to angle your phone at the photo (which rarely works, since the camera autofocuses on the screen's pixels), decode directly from the photo file.

Screenshots from messaging apps: someone sent you a QR code in WhatsApp, Slack, or iMessage. Screenshot it, upload it, and extract the data. Many messaging apps don't have built-in QR scanning from images.

WiFi credentials from router stickers: your router has a QR code on the bottom with the default WiFi password. Take a photo of it, decode the image, and get the password as copyable text. No more squinting at tiny serial numbers.

Troubleshooting Bad Scans

If the decoder can't read your QR code:

Image too small: QR codes need roughly 30 to 40 pixels per side at minimum for the finder patterns to be detectable. A 25x25 pixel QR code in a screenshot will probably fail. Use a higher-resolution source or zoom in on the code before capturing.

Blur or compression artifacts: JPEG compression can smear the sharp edges between QR modules, especially at low quality settings. A QR code in a heavily compressed JPEG (quality 40 or below) may have modules that bleed together. Use PNG for QR code images whenever possible. If you only have a JPEG, try a screenshot at 2x or 3x zoom to capture more pixels per module.

Poor contrast: QR codes rely on sharp light-dark transitions. A white QR code on a light gray background may fail because the contrast ratio is too low. Similarly, a glossy or reflective surface in a photo can wash out modules. If possible, adjust the image contrast before decoding, or recapture the code under better lighting.

Partial occlusion: error correction (up to level H, 30 percent recovery) allows decoding even with partial damage. If one corner is torn off or covered by a sticker, but the three finder patterns are intact, the decoder can reconstruct the missing data. If a finder pattern itself is damaged, the code won't decode because the decoder can't locate the QR code boundaries.

Multiple QR codes in one image: the decoder reads the first QR code it finds. If your image has two codes (common on product packaging), crop the image to isolate the one you want before uploading.

Try it yourself: generate a QR code with the QR Code Generator for any URL. Download the PNG. Then open the QR Code Decoder, upload that PNG, and confirm the decoded URL matches what you entered. This round-trip verifies both tools work correctly and gives you confidence before generating codes for production use.

Related Reading