# Why do QR Codes have the 3 boxes in the corners?

**URL:** <https://boards.straightdope.com/t/why-do-qr-codes-have-the-3-boxes-in-the-corners/973776>\
**Category:** Factual Questions\
**Created:** [October 25, 2022, 8:35pm UTC](https://boards.straightdope.com/t/why-do-qr-codes-have-the-3-boxes-in-the-corners/973776 "2022-10-25T20:35:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jackknifed\_Juggernaut](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@Jackknifed\_Juggernaut](https://boards.straightdope.com/u/Jackknifed_Juggernaut)\
**Post date:** [October 25, 2022, 8:35pm UTC](https://boards.straightdope.com/t/why-do-qr-codes-have-the-3-boxes-in-the-corners/973776/1 "2022-10-25T20:35:25Z")

</div>

If you’ve ever looked at multiple QR codes, you may have noticed that 3 of the 4 corners of the codes have boxes in them. I assume this is to help the reader or camera figure out what is the correct positioning (since cameras can be sideways, upside-down, etc., relative to the code). However, wouldn’t only 1 of the corners being a box accomplish this?

---

<div class="post-metadata">

**Author:** ![engineer\_comp\_geek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/engineer_comp_geek/32/504_2.png) [@engineer\_comp\_geek](https://boards.straightdope.com/u/engineer_comp_geek)\
**Post date:** [October 25, 2022, 8:43pm UTC](https://boards.straightdope.com/t/why-do-qr-codes-have-the-3-boxes-in-the-corners/973776/2 "2022-10-25T20:43:55Z")

</div>

One box gives you the orientation, but it doesn’t give you the scaling or the distortion caused by the image being tilted. With 3 points you can figure out the rotation, scaling, and tilt, basically everything you need so that you know how far to offset in both the X and Y directions to find the data.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [October 25, 2022, 8:48pm UTC](https://boards.straightdope.com/t/why-do-qr-codes-have-the-3-boxes-in-the-corners/973776/3 "2022-10-25T20:48:26Z")

</div>

The wiki article has a pretty good discussion of all the coolitude that’s in a QR code’s design.

> **[QR code | Design](https://en.wikipedia.org/wiki/QR_code#Design)**
>
> Unlike the older, one-dimensional barcodes that were designed to be mechanically scanned by a narrow beam of light, a QR code is detected by a 2-dimensional digital image sensor and then digitally analyzed by a programmed processor. The processor locates the three distinctive squares at the corners of the QR code image, using a smaller square (or multiple squares) near the fourth corner to normalize the image for size, orientation, and angle of viewing. The small dots throughout the QR code are t...

---

<div class="post-metadata">

**Author:** ![Joey\_P](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@Joey\_P](https://boards.straightdope.com/u/Joey_P)\
**Post date:** [October 25, 2022, 8:50pm UTC](https://boards.straightdope.com/t/why-do-qr-codes-have-the-3-boxes-in-the-corners/973776/4 "2022-10-25T20:50:17Z")

</div>

This guy made a QR code with an entire game stuffed into it.

[![](https://img.youtube.com/vi/ExwqNreocpg/maxresdefault.jpg "Can you fit a whole game into a QR code?") ](https://www.youtube.com/watch?v=ExwqNreocpg)

---

<div class="post-metadata">

**Author:** ![N9IWP](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/n9iwp/32/3154_2.png) [@N9IWP](https://boards.straightdope.com/u/N9IWP)\
**Post date:** [October 25, 2022, 10:59pm UTC](https://boards.straightdope.com/t/why-do-qr-codes-have-the-3-boxes-in-the-corners/973776/5 "2022-10-25T22:59:19Z")

</div>

I really enjoyed that video  
Brian

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [October 25, 2022, 11:09pm UTC](https://boards.straightdope.com/t/why-do-qr-codes-have-the-3-boxes-in-the-corners/973776/6 "2022-10-25T23:09:30Z")

</div>

As did I, though it was only tangentially about QR codes.

(Next up: Make a binary QR code, where the encoded file is an image, containing another QR code. How many layers could you get?)

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [October 26, 2022, 12:53pm UTC](https://boards.straightdope.com/t/why-do-qr-codes-have-the-3-boxes-in-the-corners/973776/8 "2022-10-26T12:53:16Z")

</div>

> [@Chronos](#):
>
> (Next up: Make a binary QR code, where the encoded file is an image, containing another QR code. How many layers could you get?)

Per the wiki article, for arbitrary binary data the max capacity of a QR code (so-called version 40) is 2,953 8-bit bytes. Call it 3KB for round numbers.

The bare minimum bit count required to specify the smallest QR code (version 1) as an image is 441 bits. Sounds like you could get a couple layers of QR code images inside a QR code, provided you had a very efficient image file format. I’m not sure whether image compression would help much at the smaller / inner end, but might be useful at the outermost layer(s).
