QR Code and 2D Code Generator

This page is an online two dimensional code generator which is written in PHP. It can generate QR Code, Data Matrix, Aztec Code and Micro QR Code.

Using the form on this page, you can create two dimensional code images that trigger various actions on the scanner device. Don’t forget to install Qrafter or Qrafter Pro (why two versions?) to scan and generate QR Codes if you have an iPhone or iPad. So far, this page created 4,994,761 codes since I started counting in January, 2010.

Please be sure to read the Notes and FAQ sections below before requesting help in the comments if you encounter any problems with code generation (Especially for Micro QR Codes or backslash characters you may encounter on some codes!).

This page is very popular and because of that, it gets an incredible amount of comment spam. Sometimes legitimate comments can get caught as spam and I can miss them, so if your comment does not appear after some time, you can contact me from the email address on my contact page.

READ THIS FIRST:

I am getting many questions about scanning the codes created on this generator. Most of them are about some problem with the scanner not detecting the content of the code properly. This generator follows established standards strictly and most scanner apps except Qrafter and Qrafter Pro for iOS don’t follow those standards completely. So, if you somehow end up with an unexpected result after scanning a code, it is because that your scanner was developed lousily. If you are on iOS, use Qrafter or Qrafter Pro for guaranteed standards compatibility. For other platforms, please contact the developers of your scanner app to tell them to start following the standards that were established for a reason.

Select a Code Action:
Code Type: QR Code (recommended)
Data Matrix (only ASCII chars)
Aztec Code (only ASCII chars)
Micro QR Code (only ASCII chars)
Bookmark Title: *
Web Site URL: *
Phone Number: *
SMS Message:
Mail Recipient: *
Subject:
Body:
Escape Special Characters (like colon, semicolon or comma): Yes
No
IMPORTANT: Please check notes on escaping in Notes section.
Version: 2.1
3.0
vCard Type: Real Person
Company
First Name:
Middle Name:
Last Name:
Organization:
Title:
E-Mail Address:
Mobile Phone:
Video Call Phone:
Work Phone:
Work Fax:
Home Phone:
Work Address: Street:
City:
State:
ZIP Code:
Country:
Home Address: Street:
City:
State:
ZIP Code:
Country:
Address: Street:
City:
State:
ZIP Code:
Country:
Work Web Address:
Home Web Address:
Web Address:
Birthday:
Event Format: Fully Compliant to iCalendar Standard Compliant to ZXing Proposal
Event Summary: *
Event Description:
Full Day Event: Yes (Only uses start date and end date) No (Also uses start time and end time)
Start Date:
Start Time:
End Date:
End Time:
Text: *
NOTE: Google Maps will be used to select the coordinates, but the resulting url will be a Bing Maps URL.
Location Name:
 
Twitter User: *  
Prepend username before tweet
Twitter User: *
Text to Tweet: *
Search Type: Publisher Search Exact Package Name
Market Search: *
Package Name: *
Youtube Video ID: *  
Enter either only the YouTube video ID or full URL for the video.
iTunes App ID: *  
Enter either only the App ID or full URL for the app on iTunes.
Venue ID: *  
Enter either only the venue ID or full URL for the venue.
Facebook Status: *
BBM Pin: *
SSID: *
Password:
Network Type:
URL Shortening:
(will use full url in case of error)
Error Correction Level:
(only for QR Code)
Block Size in Pixels:
Margin Size in Blocks:
Output Type:
Foreground Color:     Transparent
Background Color:     Transparent
Qrafter Banner

Notes:

You can follow me or Qrafter on Twitter.

QR Code is far more widespread than Data Matrix, Aztec Code or Micro QR Code. Actually Micro QR Code is rarely used and is only given here as a technology preview. If you want to create a campaign for your products using a 2D Code, make sure that you are using QR Codes, not the other types.

Data Matrix and Aztec Code have significantly lower capacity (4096 alphanumeric characters for QR Code, 3067 for Aztec Code and 2335 for Data Matrix), so if you would like to encode a lot of text, select QR Code.

To create the best readable code for long URLs, use one of the URL shortening services so that the resulting code is as small as possible. I personally prefer bit.ly over the others.

Micro QR Code cannot hold more than 35 numeric and 21 uppercase alphanumeric characters, and it can hold even less characters when you use lowercase characters. When encoding a URL into a Micro QR Code, try using all uppercase characters for longer URLs. I don’t know of a scanner that supports Micro QR Code though.

If your input cannot be encoded, the generator will give a warning. In that case, lower the character count in your input and try again.

If your device cannot interpret the encoded 2D Code properly, it probably means your scanner program is written poorly or does not have the capability of decoding that particular code format; or your device does not accept that action, because all codes created by this script and the content within them are compliant to all necessary published standards (vCard standards, URL encoding schemes, NTT DoCoMo standards, etc.).

While we are talking on standards, let me open the topic up a little bit more. Sadly most scanners out there do not follow special character escaping standards. Characters like “:” or “;” are special characters in vCard, meCard or vEvent specifications, and they should be properly escaped for the input to be interpreted correctly. This generator follows these standards correctly, and so a URL field like “http://example.com” becomes “http\://example.com” after escaping. The problem is, some scanners do not know how to handle this escaped character and break altogether. If you encounter such problem, select No for Escape Special Characters in vCard, meCard or vEvent creation. But while you will be able to read those QR Codes in broken scanners, be aware that, your 2D Code will not be standards compliant and you may not be able to add a URL that includes a second colon (for example as a port number separator) or semicolon when you do that. If you are on iPhone or iPad, I strongly suggest that you ditch your broken scanner and download Qrafter or Qrafter Pro. They are fully compliant to said standards. This way, I hope that developers will be forced to create scanners that obey standards that were established for a reason.

Data Matrix, Aztec Code and Micro QR Code do not support characters other than ASCII because of their spec, so if your input has international characters, always use QR Code. Another caveat of Micro QR Code is that, it is not supported by most of the scanner programs out there. As for Kanji and Cyrillic characters, again, only QR Code should support them.

Always use dark colors for foreground color and light colors for background color. If there is not enough contrast between foreground and background colors, your device will most probably fail to decode the code. Another warning: The EPS version I had to use does not support transparency, so you should use another format if you are going to have transparent foreground or background in your codes.

Twitter Profile Image Overlay option overlays your Twitter profile image onto a code that includes your Twitter profile URL. Images created with this option will behave very oddly with vector image formats. You have been warned! 🙂

Currently you can do the following actions with 2D codes generated with this form:

  • You can browse to a website.
  • You can bookmark a website.
  • You can make a phone call.
  • You can send a short message.
  • You can send an e-mail.
  • You can create a vCard (v2.1 or v3.0) with coordinates to add a contact to your device.
  • You can create a meCard to add a contact to your device.
  • You can create a vCalendar event to add to your calendar.
  • You can create iTunes app and review URLs for iOS devices.
  • You can create market:// URLs for searching for publishers or packages on Market app for Android.
  • You can create Foursquare venue URLs.
  • You can create special youtube:// URLs for YouTube app on iOS.
  • You can fetch and encode the latest tweet of a Twitter user.
  • You can overlay a Twitter profile image over the code.
  • You can create a mobile URL to tweet on Twitter.
  • You can connect to a WIFI network on Android devices.
  • You can read plain or free formatted text on your device.

You can change the block size of the generated image to make it bigger or smaller. Also, you can change the margin size of the image to add more quiet zone if your decoder cannot decode it (Especially Data Matrix seems to need bigger margin sizes). Error correction level for QR Code (ignored for other code types) can be set to 4 different values and higher values may cause the image to be decoded slightly slower. The 4 values can be explained like this:

  • Low (L): Up to 7% of errors can be corrected.
  • Medium-Low (M): Up to 15% of errors can be corrected.
  • Medium-High (Q): Up to 25% of errors can be corrected.
  • High (H): Up to 30% of errors can be corrected.

You can choose PNG, PDF, SVG or EPS outputs. SVG will output a vector image XML file, and you can edit it in applications like Adobe Illustrator or Inkscape.

Please be aware that while I make checks for illegal characters to protect my server, I do not check your input for a meaningful value.

The image generation is done using third party encoders. I have only written a handy PHP front end that formats your input and passes it to these encoders.

A note about printing from Roy, a fellow user of this generator: When codes are generated, they are created in RGB (my note: yes even if they are black and white, they are in RGB colorspace) and if they are used in printing, they should be converted to grayscale or CMYK so that, when printed, only the black plate is used. This ensures the highest edge resolution, particularly in smaller sizes.

QR Code Scanners:

The best scanner apps for iPhone and iPad are Qrafter and Qrafter Pro. They are available on the App Store. They are designed for both iPhone and iPad and Qrafter is free with advertisements, while Qrafter Pro is paid with no advertisements. They are able to understand all actions on this generator (and more) and are the most advanced scanners for QR Codes on iPhone and iPad.

For Android, the best option seems to be the Barcode Scanner app from ZXing.

For Nokia Maemo/Meego, you can use Mbarcode according to Ryks, another commenter.

For other devices, you may find one, suitable for your device from Kaywa or QuickMark.

QR Code is a registered trademark of DENSO WAVE INCORPORATED in the United States and other countries.

Qrafter is a registered trademark of Kerem Erkan in the United States, European Union and other countries.

FAQ:

Here is an updating list of frequently asked questions.

Q: Can I change the content of a code I created if I find a mistake?
A: The codes generated on this generator are standalone, which means they have no connection to this generator after being generated. This also means they include the content directly inside them, and if the content needs to change, the generated code image will change. Please test your code images with as many devices and scanner apps as possible to avoid any problems after printing the codes.

Q: Why do I get unwanted characters like a backslash (\) or semicolon (;) in the result when I scan a QR Code?
A: You are using a QR Code reader that cannot parse the contents of QR Codes correctly. Many readers are especially weak at parsing vCards. Use a proper app from the QR Code Scanners list on this page.

Q: Do you harvest the information I enter into this form?
A: No, I don’t use the information you enter to this form in any means. After you create your 2D Code, the information is removed from my server.

Q: Can I track the scan information for the 2D Codes I create on this generator?
A: You can’t track the 2D Codes you create on this generator unless you create your own trackable URL (for example a bit.ly URL) and then enter that URL to generate a QR Code for it on this page.

Q: Do the 2D codes that were created on this generator have an expiration date?
A: No, all codes generated on this generator can be used as long as you want.

Q: Can I use the codes I create on this generator commercially? Do I need to pay any fees?
A: You can use the codes created on this generator both commercially and personally. There are no fees to pay. The only favor I ask back is the promotion of Qrafter or Qrafter Pro on your site as your recommended reader app for iOS devices. But it is only a request, you are not obliged to do that. 🙂

Q: What is the minimum size for a QR Code so that it can be scanned with all devices?
A: The answer to this question cannot be given with exact proportions. New devices with autofocus cameras can scan very small QR Codes, but old devices that don’t have autofocus cameras will have problems with scanning codes smaller than one or two inches. Also it depends on the size of the information that you put into the QR Code. You need to test your QR Code with many devices, old and new to find the best compromise.

Q: Can I overlay an image on top of the QR Code like the one in “Twitter Profile Image Overlay” action of this generator?
A: Yes you can. Create a QR Code with highest error correction and select a vector output. This way, using your preferred image editor, you can overlay an image that’s up to 30% of the QR Code. Be careful not to overlay the image on top of the 3 alignment squares though.

1,121 thoughts on “QR Code and 2D Code Generator”

  1. Great tool, first time using the generator worked like a dream! I am a technology teacher and I am coming up with so many applications for this. Great work!

  2. Just wanted to let you know about a bug. If you attempt to set the foreground colour to white (#FFFFFF), nothing will show other than the background colour. However, if you set foreground to something similar, say #FFFFFE, it works correctly.

    ~WhiskeyJack
    Mozilla Firefox 3.5.4
    Microsoft XP Pro

  3. Novice here!!! I am looking to place a QR code on my business card. i wanted to use your generator to create a QR code to my facebook page. First, is that allowed? Second, i am concerned that the code will go dead at some point and all the printing will be a waste. Can you tell me if I can rely on the QR code to remain? Thanks

    1. Yep, you can use the codes anywhere you like. Also QR Codes never expire like some commercial codes out there, so don’t worry about that.

  4. Hello Kerem, Is there any way I can get a copy of your great script. I run a Russian Orphanage Just north of Moscow, and your script will help us with marketing to the western world.
    Please let me know if this is at all possible.

    Robert Dukes

    1. Hi Robert, great job you are doing there. Unfortunately, I don’t give the source code, it is not pure PHP, and got a little complicated for other site installs. But you are always more than welcome to use my site commercially, there are no hidden fees, copyright issues, anything.

      Cheers.

  5. I am trying to get the send an SMS qr to work on an I-phone and a blackberry are there any free code readers that you would recommend? The “QR Reader” i-phone app doesn’t let me send the text I set for the message.

  6. Hi there, great tool, thank you!

    It would be awezome to be able to generate a QR with background transparency. I recognize that this would not work with any patterned background, but when overlaying the QR on top of a solid area raster image, the raster does not usually have a perfectly solid color. This subtle variance adds depth to the image and would not confuse a QR reader, but in printing, it’s obvious that there is a start difference from the original background.

    Looking at the paths, it appears that there may be some difficulty in doing this, but I just wanted to add $0.02…

    Cheers, Brian

  7. Hello,
    Can you give me any direction in regards to size of code and border to use? We want to start using these on print materials to direct people to our various websites (some may be up to 40 characters). I went ahead with 5×5 pixel which turns out to be approx. 1″ x 1″. My DroidX app scans it with no problems. I’m hoping to do at 1/2 that size in the future. Is there a rule of thumb I can follow?
    Thank you very much! Lisa Knutsen

    1. The general rule is a 2cm x 2cm minimum code size plus border. You may need a wider border for smaller codes, but that’s not always true. You should experiment with different readers to find the most suitable size.

  8. Thanks for this! One question, though. I’m trying to create an event to be entered into a calendar. The time is off. When I set it to 19:00-20:30, it shows up as 2:00-3:30 p.m. If I adjust it accordingly, everything works great (with the RedLaser iPhone app anyway).

    1. Seems like RedLaser defaults to UTC when no timezone is specified. It should default to your local timezone. You should file a bug report to them.

  9. Hi I am testing this for SMS. It is not working. I use ScanLife on my Blackberry Curve 8300. Am “out-of-date” with my hardward or software? The error from ScanLife is saying it is not a registered code. I have found this to be the default message from them. Do you recommend any other software for the Blackberry if I am using something that is not current?

    1. I don’t use a Blackberry, so I will not be able to help much, but probably ScanLife cannot interpret the code. You should try a different reader.

  10. Hi Kerem,
    great work. Is it posible to buy a Licence of the Generator? We need to install the Code on our Server . What Extensions are needed in PHP and whats the price for the Generator

    All the best,
    Daniel

  11. Hi Karem
    If I use the generator do i have to pay or buy a license to use it. I don’t want to generate a code and print it on lots of things then discover I need to have a contract or license or something?

    1. No, we can’t. Because that way, the reader program will think that we have entered the surname, not first name. If there is no surname and your reader cannot interpret that comma, you should file a bug report for the program.

  12. Hello Kerem, i visit you’re page and used some links. But when i go to the subject META>Login with my IE8.x browser i get a 403 error page. I’m like to read about the QR technik and you have good information. Succes and ‘i will be back’. Best regards J. Verhaar

  13. Could the VCard generator be updated to allow for middle names? I personally like to use my full name on business cards etc., so it’d be really neat.

    Also, just out of curiosity, what library/software are you using to generate the codes? This is by far the most full-featured generator I’ve found.

    Anyway: Thanks! This is awesome

    1. I have never seen a vCard that has a separate field for middle name. Perhaps you should write your first and middle name on the first name field. That way, the vCard will be compatible with most reader programs and contact book programs.

      I am using libqrencode to generate QR Codes.

      1. Thanks for the reply.

        As for the middle-name-thing: The built-in Mac OS X Address Book – the example I have at hand – has a middle name field (although it’s hidden by default, I think), and based on a little testing and googling the VCard spec supports it (and more). I.e. the VCard name data can be:
        N:Lastname;Firstname;Middlename;Prefix;Suffix

        Example:
        N:King;Martin;Luther;Dr.;jr.

        That will be read (by Address Book at least) as: “Dr. Martin Luther King jr.” and I believe that’s what the spec (rfc2426, section 3.1.2) says too.
        The separate TITLE-attribute is, I believe, meant for organisational titles (like “CEO”) rather than honorific titles like “Dr.” or “Mr.” (see section 3.5.1).

        In any case, when I read a QR-encoded VCard, it says, simply:
        N:Firstname;Lastname;;;

        So there’s plenty of space there, it seems (and the format’s correct, spec-wise). It’s of course possible that some (spec-ignorant) VCard readers will choke if you add in a middle name.

        1. Thanks for the detailed comment. I just checked RFC 2426 again and you are right. Actually, I had checked the Mac OS X Address Book before replying to you and could not find the middle name section there, also could not find how to enable it (I confess, I didn’t look too hard ;)).

          The javascript for my generator started to become inefficient for adding new fields, so when I find a solution for that, I’ll add a middle name field. But beware, I am sure there will be a lot of readers there, that will record your middle name as your surname.

  14. I manage an online store. I am introducing our clients to QR Codes and recommending your website to create them because you offer QR Codes in tiff format. (The store vendor I use only allows upload of tiffs and jpgs.) When I try to upload your QR Code in tif format it is not working and my store vendor is saying that the tiff file is using zip compression and is therefore not supported. Is this the case, and if so, is there anything I can do about it? And thank you for providing this service.

      1. Thank you so much. It works perfectly now. You just made my day because I was at my wit’s end trying to find a suitable QR Code format. I see now why you are at the top of best QR Code generator lists.

      2. Did you change your TIFF Compression method again? My store is now once again rejecting tiff images created on your site. I thought I would check with you first before asking my store vendor what’s up. The error message is as follows: “An error occurred when trying to downsample the image. This can occur with TIFF images saved with JPEG compression. Please contact technical support. “

        1. Hi Steve,

          No it’s still LZW. But I have changed the color model from grayscale to RGB when I added transparency options. Can you check with your vendor about this? Their software seems to be too picky 🙂

  15. Is there a way to add a picture to a VCard. So that when you scan it with an iPhone, for example, it same both the phone number, your name and the picture that you attach into the relevant box?

Leave a Reply

Your email address will not be published. Required fields are marked *