Introducing a NEW QR Generator

When people ask me which QR generator to use, I usually suggest Google Charts. However, recently I've become dissatisfied with its limitations, so I've decided to write and release my own QR encoder.

I'm still looking for a catchy name for it (suggestions welcomed) - so for now it's called "QR Generator PHP".

It's available on GitHub or you can use it directly.

So, how does it compare to Google Charts?

FeatureNew QR EncoderGoogle Charts
Image FormatsPNG, JPG, GIFPNG
Maximum Image Size1480*1480px547*547px
Unicode SupportYesNo
Downloadable ImagesYes- to a specific filenameNo
Open SourceYesNo
Run on your own webserver?YesNo


Usage is really simple.

To generate a QR code which says "hello":
(Click to see the QR code)

You can set the size with, oddly enough, the size parameter:
Size can be up to 1480 pixels.

You can set the image format to JPG or GIF. By default it outputs PNG.

The Error Correction can be set to L, M, Q, or H.

You can also tell the web browser to download the image - rather than just display it. The "download" parameter sets the filename for the image.
The file will be called testing.gif (filetype is determined automatically)

Installation and configuration

Installing the software on your web server is easy. You need PHP4.1 or higher and gd 1.6 or higher. Those are fairly old versions, so any competent web host will have those.

There are three folders.



Inside the php folder, you'll find the "qr.php" file.

There are only two things you need to configure - the location of the data and image folders

$path = "./../data"; // You must set path to data files.
$image_path = "./../image"; // You must set path to QRcode frame images.

By default, they're set up to be accessed without any modification. But, if you desperately want to move them to a different location, make sure you update qr.php.

I've based my QR generator on that of Swetake. The original was licensed as "revised BSD" - I have kept the original licence.


If you've got any feedback - either leave it in the comments here, or over at GitHub.

Share this post on…

4 thoughts on “Introducing a NEW QR Generator”

  1. Itai says:

    Your comparison isn't really fair as Google Charts does support Unicode by UTF-8 (which is actually the default) and you can technically download the images.

    1. As I understand, it URL escapes all the characters - this one doesn't
      (although I'll be updating it to allow it).
      While you can download Google's images - it doesn't have the correct contnet disposition to allow you to do it automatically.

  2. Russell says:

    Wish you where able to put your own logo in the middle of the QR code


What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <p> <pre> <br> <img src="" alt="" title="" srcset="">