QR Code Decoder
Decode QR codes from image files using your browser.
Back to all tools on ToolForge
QR image
Decoded text
About QR Code Decoder
This QR code decoder reads QR codes from uploaded images using the BarcodeDetector API directly in your browser. It is useful for verifying printed QR codes, extracting links from screenshots, checking campaign codes, and reading QR data from saved images without uploading files to external servers.
What is the BarcodeDetector API?
The BarcodeDetector API is a native browser API for detecting barcodes and QR codes from images. It provides fast, client-side decoding without requiring external libraries or server-side processing.
// Browser support check
if ("BarcodeDetector" in window) {
const detector = new BarcodeDetector({ formats: ["qr_code"] });
detector.detect(imageElement).then(codes => {
codes.forEach(code => console.log(code.rawValue));
});
}
Supported Barcode Formats
| Format | Description | Common Use |
|---|---|---|
| qr_code | 2D matrix barcode | URLs, text, contact info, WiFi credentials |
| code_128 | High-density linear barcode | Shipping labels, product identification |
| code_39 | Variable-length linear barcode | Inventory, ID cards, automotive industry |
| ean_13 | 13-digit European Article Number | Retail product packaging |
| upc_a | 12-digit Universal Product Code | Retail products in North America |
| datamatrix | 2D matrix barcode (smaller than QR) | Electronics components, small items |
QR Code Structure
QR codes consist of several key components that enable reliable decoding:
- Position detection patterns: Three large squares at corners for orientation
- Alignment patterns: Smaller squares for distortion correction in larger codes
- Timing patterns: Lines connecting position patterns for coordinate reference
- Data cells: Actual encoded information in binary format
- Error correction: Reed-Solomon redundancy for damaged code recovery
QR Code Error Correction Levels
| Level | Recovery Capacity | Use Case |
|---|---|---|
| L (Low) | ~7% of codewords | Clean environments, minimal damage risk |
| M (Medium) | ~15% of codewords | General purpose (default level) |
| Q (Quartile) | ~25% of codewords | Industrial environments, outdoor use |
| H (High) | ~30% of codewords | Harsh conditions, high damage risk |
Common Use Cases
- Marketing verification: Check what URL or content a printed QR code links to before publishing
- Security auditing: Verify QR codes in emails or posters don't lead to malicious sites
- Event management: Extract ticket information or attendee data from QR-coded passes
- Inventory systems: Read product codes from photos taken in warehouses
- Contact sharing: Extract vCard data from QR-coded business cards
Browser Support
| Browser | Support Status |
|---|---|
| Chrome (desktop & Android) | ✓ Full support (v87+) |
| Microsoft Edge | ✓ Full support (v87+) |
| Opera | ✓ Full support |
| Firefox | ✗ Not yet supported |
| Safari | ✗ Not yet supported |
Tips for Successful Decoding
- Ensure the QR code is clearly visible and in focus
- Good lighting and contrast improve detection accuracy
- Avoid images where the QR code is partially cut off
- Higher resolution images decode more reliably
- Straight-on photos work better than angled shots
Frequently Asked Questions
- What is the BarcodeDetector API?
- The BarcodeDetector API is a native browser API that detects barcodes and QR codes from images. It supports multiple formats including QR code, Code 128, Code 39, EAN-13, and more. The API is available in Chromium-based browsers (Chrome, Edge, Opera) but not yet in Firefox or Safari.
- What image formats are supported for QR decoding?
- This tool supports all common image formats: PNG, JPEG, GIF, WebP, BMP, and SVG. The image must contain a clearly visible QR code with good contrast. Blurry, low-resolution, or heavily compressed images may fail to decode.
- How does QR code detection work?
- QR codes contain three position detection patterns (large squares) at three corners that help the decoder locate and orient the code. The BarcodeDetector API analyzes the image, finds these patterns, extracts the grid data, and decodes the binary information into text or URLs.
- What types of data can QR codes contain?
- QR codes can store URLs, plain text, contact information (vCards), WiFi credentials, email addresses, phone numbers, SMS messages, and more. The decoder extracts the raw data; specialized formats like vCards will appear as formatted text that you can parse separately.
- Why might a QR code fail to decode?
- Common failure causes: poor image quality or blur, insufficient lighting or contrast, QR code is too small or partially obscured, the code is damaged or corrupted, or the browser lacks BarcodeDetector support. Ensure the QR code is clearly visible and the image is in focus.
- Can this tool decode multiple QR codes from one image?
- Yes, the BarcodeDetector API can detect multiple QR codes in a single image. If an image contains several QR codes, all detected codes will be extracted and displayed, each on a separate line.