Your mission is not so simple. You have to write a program that decodes QR-codes.

There are some things that are not permitted:

  • Making web requests (except https://i.sstatic.net/sCUJT.png or https://i.sstatic.net/mXUcd.jpg)
  • Using any QR code processing library (Or using any external library to do this)
  • Image processing libraries should not be be used to do anything other than loading image, determining its size and reading single pixels from it
  • Using built-in functions to read QR codes
  • Brute forcing

If you use any external files (except QR code file and language libraries), the byte count of those files will be added to your code.

Other rules:

  • Program must be able to read any valid QR code (No error correction is required). You can assume that the maximum size of QR-Code is 10000 pixels.
  • QR code colors are black and white. ((0, 0, 0) and (255, 255, 255) in RGB. Alpha channel is not used, so your program can ignore it.
  • Image file must be saved as PNG or loaded from https://i.sstatic.net/mXUcd.jpg or https://i.sstatic.net/sCUJT.png runtime. (And tricks like using raw txt file with .png file extension are prohibited)
  • QR code decoded content must be outputted to stdout. If your language does not allow this, you can save it to file named qrcode.txt.
  • QR-code format is normal qr-code (not any modification like micro QR code)

This is , so shortest code wins

An example file is here: http://api.qrserver.com/v1/create-qr-code/?color=000000&bgcolor=FFFFFF&data=http%3A%2F%2Fcodegolf.stackexchange.com&qzone=1&margin=0&size=400x400&ecc=L

QR code

  • 1
    \$\begingroup\$ Can we get the Imgur URL for free in our submissions? URL shorteners could be used, and it would be unfair if that would break ties. \$\endgroup\$
    – ProgramFOX
    Commented May 17, 2014 at 15:34
  • 2
    \$\begingroup\$ "Using language that haves built-in functionality to read QR codes" so I can't even use the language if I omit all that built-in functionality? \$\endgroup\$ Commented May 17, 2014 at 16:26
  • 2
    \$\begingroup\$ This question needs more information: Which QR code version do we use (all of them?)? Do we need to flip around the diagonal if we can't decode? Will we always have a nice QR-only picture, or will we need to search through a picture that contains a QR code? Which encodings should we support? Will we need to support error handling/error handling modes? \$\endgroup\$
    – Zaq
    Commented May 17, 2014 at 19:30
  • 3
    \$\begingroup\$ This is going to be difficult af spec, iso or whatever is called \$\endgroup\$
    – gcq
    Commented May 18, 2014 at 19:07
  • 1
    \$\begingroup\$ This was helpful blog.qartis.com/decoding-small-qr-codes-by-hand \$\endgroup\$ Commented Sep 25, 2014 at 23:43


Browse other questions tagged or ask your own question.