This cool new form of barcode knits up well!

How to knit a QR code

You have no doubt seen QR codes by now. They are the black and white square digital form of "next generation" barcode. Most of them urge you to scan them with your smartphone in order to experience new worlds of marketing. Oh joy.

The good news is that QR codes are easily adaptable to knitting. And yes, you can even scan in your knit QR code and have it work properly! (Assuming you have done the colorwork correctly.)

1. Decide what you want your QR code to do or "say"
QR codes can either encode a word or phrase, or they can be used to encode an entire URL. When the user scans the QR code for a URL, their browser is automatically taken to that URL.

This has a lot of fun potential applications. Obviously, a QR code can be a secret message. I have heard of someone who knit a QR code throw pillow that took you to the Wikipedia page for "pillow." If you have a website or blog, you can incorporate a QR code with your own site's URL. Just wear your sweater around town and ask people to scan you!

2. Encode it
There are several websites that will take your string of text and turn it into a QR code. My personal favorite is this site, which also lets you specify the size of the graphic you want to create.

Choose the biggest size, create your QR code and download the image. (Right click on the image and choose "Save as…")

Image courtesy Flickr/Bekathwia

3. Do a bit of math
This step will require some fudging and approximation.

First, you need to figure out the general dimensions of your finished QR code. What size do you want your QR code to be? Is this going to be a little design on a pair of mittens, a throw pillow, the back panel of a sweater or an afghan?

Next, figure out what kind of gauge you will be knitting it at. (You may have a yarn for this project in mind already; this is when you find out whether or not it's going to work for what you want.)

Finally, count the number of squares (pixels) that your QR code is high and wide. The number of pixels is determined by how much text you have put into your QR code. If you encode a big long URL, you will have more dots in your QR code versus one that just says "test."

Are these numbers going to work, given that each pixel needs to be at least one (ideally two) stitches across and high? You may have to fiddle with the size of the QR code or your yarn gauge to get it to fit.

As an example, let's say we want to make a pillow that is 10 inches square. I've chosen a yarn with a gauge of five stitches to the inch and seven rows to the inch. This means that my pillow will be 50 stitches across and 70 rows high.

Let's say my QR code is 30 pixels across. This means that it will fit on the pillow, but I will want to add a border of 10 stitches on each side in order to center the design.

If you wanted to make mittens with that example QR code, you would need to use a very light fingering yarn in order to get enough stitches across the back of the hand to fit the QR code. By contrast if you wanted to make an afghan, you would want to use a very bulky yarn - or make each pixel be 5x5 stitches.

4. Chart it
At the simplest level, you can just print out your QR code and use a ruler to draw the grid lines. You can also try uploading it to a service like the KnitPro chart generator, although I have never had much luck going that route.

If you want to actually color in graph paper to use as a pattern, keep in mind that knit stitches are not square. Your actual knit item will not be quite the same shape as the graph paper. Luckily the QR specification is flexible enough that most people report success.

5. Get to knitting
Good luck, and have fun!

Main image courtesy paxmodept's Create a QR Code tool