When confronted with a QR code and no idea what it contains (or to verify it contains what is claimed), one might want to decode it. This can be accomplished easily using ZBar bar code reader.

Usage

To decode a saved image:

zbarimg ~/Downloads/code.png

Example output (using first Google image search result for “example QR code”, which happens to be the Encyclopedia Britannic’s page on QR codes):

% zbarimg Downloads/Example-QR-code.jpg.webp
QR-Code:http://itunes.apple.com/us/app/encyclopaedia-britannica/id447919187?mt=8
scanned 1 barcode symbols from 1 images in 0.14 seconds

Install on Debian

It is packaged so can be installed directly:

apt-get install zbar-tools

Install on macOS

It is available through Homebrew, so can be installed easily if Homebrew is already installed:

brew install zbar