Nested QR Codes

Retro_Dev1 pts0 comments

Nested QR Codes | alloc.dev

2026-08-17 # Nested QR Codes

The outer QR code scans to "OUTER" and the inner QR code scans to "INNER"

sona sin mi

I saw<br>dithered QR codes<br>online recently. The method relies on a feature (read "flaw") of QR code scanners - which target the<br>center of each data block when scanning the image. As long as the center of the data block<br>(determined by QR code structure) is the correct value, then the scanner will ignore the edges of<br>the block. This is different from how companies embed their logo into a QR code, which literally<br>removes data from the QR code, relying on error correction.

I figured that if you could fill the latent space with some bespoke pattern or image, why not<br>another QR code? To make sure the inner QR code could scan correctly, I offset it by 1/3 the size of<br>data blocks of the other QR code, and scaled it the same. This way, the center of each data block<br>for the inner QR code would not overlap the center of each data block in the outer QR code. The<br>inner QR code's structure is not *entirely* distinguishable, and it does have the hole punched out<br>of it for the outer QR code's alignment mark, but they both seem to scan just about as easily on my<br>phone... Surprisingly, I realised the whitespace around the position markers in the outer QR code<br>could function as the bordering whitespace for the inner QR code, or at least part of it. :)

retrodev@spud:~/ > zbarimg nested_qr.png<br>QR-Code:INNER<br>QR-Code:OUTER<br>scanned 2 barcode symbols from 1 images in 0.02 seconds<br>So, who is going to make the first triple-nested QR code?

code inner outer data block nested

Related Articles