QR code or NFC, which one you should use for your solution

Claudio Moran
7 min readSep 25, 2022

--

Photo by Brett Jordan on Unsplash

When building a digital solution, a good way to interact with the real world is using QR codes or any other 2D barcode, but I will refer to QR code all the time since it is the most common one. Another good option is the use of NFC, but Which one to use? We will discuss that in this article.

QR Codes

Hello world!

Widely used, everyone that owns a smartphone is familiar with QR codes. It is just a 2D barcode that can contain a certain amount of data.

Sometimes you can find a nice message as content but most of the time, the content of a QR code is just a reference to access content:
A link to a webpage or an identifier (that later is the input to an application).
In this way, you read the code and let your smartphone access the content that it is referring to.

One really important thing to notice: QR codes are always the same before and after you read them (they are static), what can change is the content of the reference. One example is a ticket for a concert. The first time you read it, it will grant you access, the second time, it could display a message saying: ticket already used.

So let’s see what is the good thing about them:

  • All smartphones with a working camera can access the content.
  • They are easy to use. Most people are used to them as the pandemic helped that as most restaurants now have a QR menu.
  • If your QR code is a reference to something, the content of the reference can be updated.
  • It is possible to do offline implementations applying some logic to the application reading the code.
  • The implementation is very cheap. In the worst scenario, you just have to print the code to be used.

What is bad about them:

  • All smartphones with a working camera can access the content.
  • If your QR code is NOT a reference to something, then the content can’t be changed. You will have to generate or scan a new one.
  • They are easy to copy. You can take a screenshot of your QR code and send it to all your friends. This is something to consider when you work on a solution.
  • Most of the time, the content you access with them is online, this means that the reference that is pointing to has to be available during the time of the operation.
  • If they are in an offline implementation the constraints are big.
  • Reading a code requires good conditions: Code needs to be clear, the camera needs to focus, and lighting conditions have to be good.

You will notice that I highlighted “All smartphones with a working camera can access the content” as a good and bad thing at the same time, this is because in some cases, like the menu of a restaurant, it is something you for sure want as that will reduce the inconvenience of downloading an application to access your content. In other cases, this is something you may not want, like if it was a one-time-use concert ticket. In this case, you may want only some people making use of the ticket and this means instead of the full URL you may want to generate a QR with just a ticket number, then create an application that is capable of reading that number and triggering the call to an API.
The fact that there are many QR readers out there, does not mean you may not need to develop your own application.
It all depends on your implementation and use case.

NFC

Photo by Nathana Rebouças on Unsplash

When we think of NFC, two things come to mind:

  • An smartphone/smartwatch, acting itself as a tag.
  • An Smart card or Tag, but a chip that can be held and put in your pocket.

NFC stands for Near Field Communication. The most popular chips are Mifare which are used inside Smart cards and the most popular implementations are payments and transportation.

Sometimes, NFC chips are used in a very similar way as QR codes. Some people put a URL, an email inside them, or maybe a code to trigger an application, and also they are written in a way that anyone can read them
I’ve seen implementations of Smart cards given in parking garages that are just the reference to access an account. Nothing happens within the Smart card but just the identifier is used.
When the implementation is done this way, a QR code could most likely do the job at a lower cost.

The truth is, unlike QR codes, the content of an NFC chip CAN change. There is logic happening inside, there is actual implementation and rules that depend on the chip that you are communicating to.

So let’s see what is good about NFC:

  • The content can change after an action is done.
  • It is easy to do an offline implementation. This stops the dependency and need of having systems up 100% of the time.
  • Some NFC chips are very secure. Some of them can’t be hacked with our current technology and in some cases, it is impossible to generate an exact copy.
  • Smart cards/tags don’t require a battery to operate.
  • Fast reading. Unlike QR codes, you don’t need to have proper lighting or wait for focus.

As there are good things there is also a list of no-so-good things to consider:

  • Not all Smartphones can read all the chips. Some Smartphones can’t even read NFC. iPhones are limited to what they can read, where they can write, and so on. If your solutions require to have someone to capture the content of an NFC tag/device, you may have to implement an external reader.
  • They are very secure, lots of them can use symmetric encryption algorithms like AES to access the content but this raises another question: Where do you store the keys to read them? Leaving them in the application layer could cause security issues so, to store the keys, the cost and time to implement a solution may increase. A usual way to store the keys is the use of SAM(secure access module).
  • If you are giving out Smart cards or tags, then the cost could be high. Some chips are very expensive, depending on the technology and cryptographic capabilities, so it is very important to pick the right one for your solution.

There are some particular cases where the features of NFC technology is a must but for some other, we can certainly think of QR codes as an option that can do the same for the solution at a lower cost/time. If online connectivity is not an option, then you really may want to consider NFC.

Why and When

Note that there is not a rule of thumb as there are always exceptions, especially in technology but here I will explain some use cases that commonly use these technologies, but that doesn’t mean you could not do something different.

Transportation: We already mentioned QR codes usually depend on an online implementation. Do you imagine what would happen in your country if the internet goes down and people can’t go on the bus? Correct, chaos. That’s why NFC is widely used here. Another reason is the speed of the transaction, as having an offline solution allows you to control the time that the transaction will take. One last reason and also very important is security. The more people using your solution, the more likely someone will benefit from hacking, this means, you have to keep the content safe as in most transport solutions the balance is inside the card. Many transportation systems have been hacked using weak NFC technologies. One example is Transantiago in Chile, using the well-known Mifare classic.

Payments: Here we find both in the picture with the appearance of payment apps. In your Visa/Mastercard there is an actual payment application(yes, inside the Smart card), that allows you to access your account, the benefit is that you as the owner of the card don’t need to be online. When is about payments using Smartphones then QR codes are very tempting as, unlike NFC, are supported by all the devices, the downside is that now you most likely require an online connection. Again, it all depends on the implementation.

Restaurant Menu: This is easy to guess but since all smartphones support QR codes as long as the camera works, it makes the best option to have this technology instead of NFC.

Anti-counterfeit implementation: Unlike NFC, QR codes are really easy to duplicate, which means in this case you are more likely to want an NFC chip to send along with an expensive wine bottle, an expensive piece of clothing, or a collector’s piece. It will be harder to read but your customers have the opportunity to read the tag and have proof that the piece is authentic and no one will be able to clone it (at least the tag).

Concert ticketing: In this case, you may want the security and speed of NFC, as well as the offline capabilities, but the other challenge you have is the fact that not all devices support this technology. Then you may think to send all of your customers an NFC ticket, but then you have logistic and cost issues, this is why QR codes are the ones owning this type of solution. Right after you sell the ticket, you can send it to an email giving the user the option to print it themselves or to have it on their Smartphone making it the best way to distribute an entrance to a concert/event.

To finish this article I just want to add that here I mentioned technical/logistic reasons to use QR codes or NFC, but there are also other reasons a business may have. Marketing is a good example, maybe you want to use NFC instead of QR codes because it looks cooler or maybe it is because your competition is doing it that way so you have to compete somehow.

I hope you have enjoyed the content.

--

--