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,902,489 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,119 thoughts on “QR Code and 2D Code Generator”

  1. Hi Kerem, great site.

    The 5-pixel QR code that I generated is still too large for my needs. Can I shrink the file down in Photoshop?

    1. Hello Cory,

      The minimum practical QR Code size that can be read by most readers is 2 cm per side. So you can shrink your whole QR Code to that size, but be aware that, you should put considerably smaller information into it, so that cellphones that do not have auto-focus cameras can also read the code.

  2. Hi,
    This is very useful. Thanks for your effort!
    Could you put a checkbox if script should put Location in code or not?
    Thanks,
    Gat

    1. Hi,

      If you have not entered any location, the generator does not put a Location field into the codes. If you have entered it previously, you can reset the form and enter the values again.

      On a side note, please don’t forge any e-mail address from my site when you enter any comments (like you have done this time). Or your comment may be marked as spam.

  3. We are transitioning our print clients to QR codes, a bit of a Pied Piper at this stage – but it’s coming and will be popular in the next few years. Is there a way to create a QR code that opens a pdf on the moblie device? Or a recommended way to do that without having to put it in a web repository and then open? Your generator is top notch and we think your insight is right on.

    1. Thanks for your kind words.

      I think the best way will be the web repository solution as probably you’ll have to support a lot of different devices. While you may be able to create a QR Code that can open a local PDF on a particular device, that QR Code will be meaningless for all other devices. So, you should do what’s standard on all devices which is having them download the PDF from the web.

    1. Thanks. I think I have mentioned this page somewhere in the comments, but I am not sure, and I cannot check the site fully at the moment.

  4. Can you share where you found a QR code reference which tells you what data needs to be embedded in the QR code image? I’d like to implement a form like you have, but use the PHP QR Code library. I don’t know how to formulate the string that needs to be embedded in the bar code.
    Thanks for any help you can offer.

  5. Yes. The working code is different than yours (both versions – with and without escape special chars). Maybe different implementation of meCard?

    1. Please send me the address of that generator, or a working QR Code via e-mail and I’ll check what I’m doing different. I have been following standards from the start, but everyone can make a mistake or two đŸ™‚

      You can find my e-mail address in my Contact page.

  6. Hi,
    I have noticed some incopatibilities between similar code types and subtypes – namely, QR with meCard embedded. Reader I am using (i-nigma) properly recognizes meCard created by other encoder but fails to read yours. I am assuming this is not a parsing issue but rather different metadata naming convention (even though it should be standardized)?

  7. I’m getting mixed results creating QR Codes here and scanning with Quickmark…

    This mecard works:
    “URL:http://webaddress.com;;”

    This mecard URL breaks the whole entry:
    “URL:http\://webaddress.com;”

    I seem to get inconsistent creations using this generator. I have a control image I check to make sure the scanner is working.

    When it works it’s great but I’d love to see this solved!

    1. Well, that’s because QuickMark does not follow escaping standards for meCard. As you can see “:” is a separator for different fields, it should be escaped for consistency. While QuickMark seems to have solved this problem, they actually did not, and their reader can get confused when you have to enter more complex URLs into the URL field other than a simple http://webaddress.com.

      I will add a “Don’t escape special characters” checkbox to the generator for testing those reader programs that don’t want to follow the standards, but when you select that, while your reader can read the code successfully, other programs may not be able to, because the generated QR Code will not be standards compliant.

  8. Could you please add
    xmlns=”http://www.w3.org/2000/svg”
    to your svg tag? Without it it’s difficult to embed SVG as an image.

    Thank you for the encoder — it’s the best!

    1. Hi, I added the version attribute, xml namespace you suggested and other two other xmlns attributes (XLink and XML Events) to the SVG output. I would appreciate it if you could test it and give feedback.

    1. Hi J.F.

      The mail I sent to your address which you entered for your comments bounced back to me. Please contact me via e-mail and I’ll reply to you resending that mail again.

  9. Dear Kerem, thank you for your great coding machine. here are a couple of my concerns.
    I do help my customers with implementing the QRcodes in Montreal Canada. Since an update in i-nigma and mobiletags the url in Bookmark tag shows up with “;;” at the end making it impossible to follow, while zxing, an ixMAT readers still perform well…
    Actualy zxing reader is one of the most reliable reader for Android and iPhone version free under “Barcodes” in i-store, while i-nigma is the most recomended on Blackberry at least here in eastern Canada.
    OK you are not distributing your coder’s code, but could we embed it in my website for example… building a kind of Cloud coding…

    1. Hello J.F,

      I have removed the “;;” part and tried it with Kaywa and Quickmark. They both identified the bookmark correctly, so I will leave it as is, most probably the problematic readers will also interpret the code correctly now.

      Also thanks for your feedback about the reader programs, it is much appreciated.

      I will contact you via mail about your other question.

  10. How come I cannot make a micro qr code? I’ve entered something as small as 23 characters with a only letters and a . and a –

  11. Nemanja Pavlovic

    I really like what you showed here. Just the thing I was looking for. Please let me know if there is a chance we could talk about using this generator on my website? Thanks.

      1. I hope to use QR Code in the printing of products, t-shirts, mouse pads, and much much more.

        Your generator is “AWESOME”. The url portion came out from info in the “email”. So the url showed as my email. Other than that I found it to be the absolute best QR Code generator out there.

        1. Thanks David,

          Can you elaborate on your problem? Did you try the “Website” action and it ended up as an email? I could not understand that.

      2. A friend said that in Japan they use it a lot. Of course, they are mobile maniacs, so all the stores have QR codes in the products.

        Great generator. I already Twit this page, now I gonna blog it. đŸ˜‰

        1. Yes, especially in Eastern Asia QR Codes are used for everything. The western world is slow at adopting these codes but lately with smart phones we have started seeing more and more of these codes everyday. I have been working on QR Codes since 2006 and I am glad to see that my predictions were true about them. đŸ™‚

          Thank you very much, I would appreciate links to the generator.

  12. Okay,… maybe I’m totally dumb, but where exactly can I find the source code of your (btw: awesome) QR code generator?

    I searched through your whole blog (nearly), but couldn’t manage to find a download…

    Thanks in advance,
    Martin

  13. OK This is a very good and usefull explanation, I see the difference in the two approaches and I completely agree with you, that your way is the way to go.

    1. Thanks. I hope to see better reader programs in the future if QR Codes gain more momentum. Until that time, sadly all functions of my generator will not be available to everyone.

  14. May be you understand this better than me:
    vCal (Calendar)
    Scanning a QR code with this symbol will add this event to your calendar.

    Ex: http://www.mskynet.com/qrgen?qt=vcal&title=Birthday&...
    http://www.mskynet.com/qrgen?qt=vcal&title=\t
        &desc=\d&loc=\l&email=\e
        &sYear=\sy&sMonth=\sm&sDay=\sd
        &sHour=\sh&sMin=\sn&sOffset=\so
        &eYear=\ey&eMonth=\em&eDay=\ed
        &eHour=\eh&eMin=\en&eOffset=\eo
        &alarm=\a
    *Note: Please URL encode the following parameters.
    
        * \t - Title, e.g. "Birthday".
        * \d - Description, e.g. "Barcode's 58th Birthday!".
        * \l - Location, e.g. "Seattle, WA".
        * \e - Organizer's Email, e.g. "noreply@mskynet.com".
        * Start date/time
              o \sy - Event start year, e.g. "2010"
              o \sm - Event start month, e.g. "10"
              o \sd - Event start day, e.g. "07"
              o \sh - Event start hour, e.g. "12"
              o \sn - Event start minute, e.g. "30"
              o \so - Event start UTC offset, e.g. "-8" for (PST)
        * End date/time
              o \ey - Event end year, e.g. "2010"
              o \em - Event end month, e.g. "10"
              o \ed - Event end day, e.g. "07"
              o \eh - Event end hour, e.g. "13"
              o \en - Event end minute, e.g. "30"
              o \eo - Event end UTC offset, e.g. "-8" for (PST)
        * \a - Alarm in minutes, e.g. "15". (default: disabled)
        * width - width in pixels. (default: autosize)
        * cap - url encoded caption text. (default: none)
        * subcap - url encoded subcaption text. (default: Add * to Contact)
        * nocap - 1 to disable subcap. (default: enabled, 0)
        * col - hex color value. (default: black, '000000')
        * bgcol - hex color value. (default: white, 'FFFFFF')
    

    I got it from:
    http://www.mskynet.com/static/QRGenAPI

    1. They are not encoding a vCalendar event code. They are creating a URL QR Code, which redirects your browser to a page on their server, which then creates an ics (iCalendar format) file and prompts you to download to your device.

      It is a completely different approach. My generator on the other hand, encodes the content of that ics file directly into a QR Code. When it is encoded into a QR Code, the reader program has to interpret it correctly. But when it is downloaded via the browser, the reader has nothing to do with interpreting the vCalendar event. So, my generator relies on the capabilities of the reader program. Their method is very easy to implement but it is not a good way to improve the reader capabilities.

      On a side note, LOCATION field is a standard since vCalendar 1.0. Unfortunately the reader program on Android cannot interpret it. The GEO field is also the same.

      Because QR Codes on mobile devices are new to the western world, most of the reader programs cannot interpret many codes, even though those codes are created according to RFC standards. It is a similar situation here. Maybe you should write this as a feature request to Google’s ZXing project, since they are the makers of the barcode reader on Android.

  15. OK I understand.
    The field you added is indeed what i mean.
    I tested the ‘location name’ field.
    Barcode scanner understands the ‘event summary’ and also the day and time information.
    it als shows the button ‘add to agenda’
    Unfortunately it doesn’t pick up the information from the field ‘Location Name’
    May be it is not standard yet in vCalender?
    well…Thanks any way… let’s say: to be continued

Leave a Reply

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