16

It seems like most (if not all) QR readers on my iPhone handle URLs without the http:// just fine but I was wondering if that is universal? Android? BlackBerry? Is there an RFC somewhere that I should be reading

I'm building a QR management/url shortener system and was wondering if it was absolutely necessary. If not, I can drop 7 characters from my QR's URLs and make them the lowest level of complexity (16 characters or less). Which, from everything I've read, is a Good Thing™.

Charles
  • 50,943
  • 13
  • 104
  • 142
Dan Berlyoung
  • 1,639
  • 2
  • 17
  • 36
  • Just tried Barcode Scanner on Android, and it works without the http://. Don't know about others though.. – MartinodF Nov 15 '10 at 17:26
  • While most QR readers will launch a browser and assume http, leaving it out certainly bothers me. How is the phone supposed to know that you intend HTTP? It guesses. – Brad Nov 15 '10 at 17:42
  • I just tried a couple of more obscure scanners myself (MAAD Qr and i-nigma) and some just showed it as a string and didn't realize it was a URL. Might be an answer to my question right there. – Dan Berlyoung Nov 15 '10 at 19:09

4 Answers4

16

I haven't found any absolute documentation that says it must have it. But... After testing a number of QR reader apps, it's clear that many of them will 'guess' at a url if there is no http:// in it. But many do not and display it as just a string. Since it's a URL, it really does need it. And if any apps won't read it, then I have to bow to them and add it for all of them.

Dan Berlyoung
  • 1,639
  • 2
  • 17
  • 36
  • 6
    Just to mention: We had an issue concerning URLs without 'http://' with several iOS apps and on Blackberry. Adding 'http://' fixed the problems with all apps we were able to test with. **Conclusion: Always add http:// to your links** – Mario Apr 16 '13 at 16:29
16

Hey Dan I am the dev of Barcode Scanner and just saw your question. I have a few more tidbits of info which may help.

There is no real 'standard' for this; I suppose the HTTP specification is the closest thing and technically it does say you need "http://". This wiki has everything we think we know about standards and de facto standards in this area.

I can tell you that QR codes have special modes to encode digits only, and alphanumeric-only text. The alpha mode includes only capital letters, but does include key punctuation like colon and slash. So, HTTP://EXAMPLE.ORG/BAR ought to be encodable in QR codes in fewer bytes than http://example.org/bar.

URLs themselves are case-sensitive however. It's not necessarily OK to uppercase a URL. But the server application may be case-insensitive. If you control the endpoints and know you can use all uppercase, this is a way to perhaps squeeze into version 1.

Finally I'll say that version 1 QR codes are a little weird since they have no alignment pattern. Without a fourth point to find, it can't (well, the dumb-but-effective process employed by Barcode Scanner and by extension a lot of scanners) account for perspective distortion. It happens to work with only small tilt. But version 2 actually has a small advantage for decodability with that alignment pattern.

Sean Owen
  • 66,182
  • 23
  • 141
  • 173
  • Very good info, Sean. Thanks! Interesting tidbit about the ver 1 codes not having the extra reference point. Noticed that but never understood the impact. – Dan Berlyoung Dec 14 '10 at 20:12
  • Note that sadly, some QR code readers will recognise a URL starting with upper-case HTTP:// or HTTPS:// but then fail to open it! So lower-case http:// or https:// seems to be a requirement (which takes a few more bits to encode and results in a slightly larger QR code). – jcaron Apr 19 '21 at 08:12
4

QR readers usually identify as a URL any text that conform to ANY of this conditions:

  • Text starts with http:// (or HTTP://)
  • Text starts with www.
  • Text starts with MEBKM: (NTT DoCoMo format for web bookmark)

You should be fine without http if your url starts with www. but it's not your case.

As Sean points out, you should use all-caps urls instead.

You can fit up to 24 alphanumeric characters in a Version 1 level L QR, wich is just enought for a url shortener. Example:

HTTP://1QR.ES/AAAAAAAAAA

HTTP://1QR.ES/AAAAAAAAAA

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
NiloVelez
  • 3,611
  • 1
  • 22
  • 30
  • 2
    Note that sadly, some QR code readers will recognise a URL starting with upper-case HTTP:// or HTTPS:// but then fail to open it! So lower-case http:// or https:// seems to be a requirement (which takes a few more bits to encode and results in a slightly larger QR code). – jcaron Apr 19 '21 at 08:12
  • but relevant is mostly the mobile camera and the OS because thats what people use and this works fine with uppercase. I stick with uppercase to make it encode size-friendly. – Logemann Oct 06 '22 at 14:40
4

Fun fact: Samsung Galaxy phones (e.g. S8 and S9) will open a QR code with a URL that has "HTTP" or "HTTPS" (in uppercase) in their text editor. Create the same URL with lowercase "http" or "https" and the same URL and it will open in a browser as expected.

tra
  • 41
  • 1