I saw a QR code reading a book, but I don't have a smart phone to check it.

So I just took a picture of it and saved my PC. And I downloaded libdecoderqr0, libdecodeqr-dev, libdecodeqr-examples for reading it. But I don't know how to use it.

What do I do next, or is there a nicer way to read QR codes?

  • The simplest way to scan a QR Code is to use one of those online services like e.g. qr4u.online, webqr.com
    – 4xy
    Sep 12 '17 at 10:30


Install the zbarimg command line application by running:

sudo apt-get install zbar-tools

Use the program, zbarimg provided by the package to read your QR encoded image


from command line:

zbarimg "image-file-name.jpg"

The above will display what is encoded in the image in the terminal.

IF you would like to generate QR code you can install qrencode from the repositories.

< input.txt qrencode -s 10 -o test.png

The above will encode the information in the input.txt file in an image file called test.png.

or you can input text from the console with;

qrencode -s 10 -o ubuntu.png http://www.ubuntu.com

The above will generate a QR encoded image called ubuntu.png with the url http://www.ubuntu.com encoded in it.


You can encode and decode online at: online barcodereader.com and at: ZXing Decoder Online


Install libdmtx-utils from the repository and try using the tools it provides.

Libdmtx is a library for reading and writing Data Matrix 2D barcodes, two-dimensional symbols that hold a dense pattern of data with built-in error correction.

dmtxwrite - create Data Matrix barcodes. Simple example:

dmtxwrite  -o image.png input.txt

This will encode text contained in input.txt in current directory to an image, image.png in current directory.

dmtxread - scan Data Matrix barcodes. Simple example:

dmtxread image.png

That reads the encoded image.png and writes the decoded messages to standard output.

  • data matrix seems way better, since it has a proper decoder and it can encode null bytes. this doesn't work: echo -en "\x00" | qrencode -t PNG -o lol.png Feb 18 '14 at 11:34
  • I could not get the libdecodeqr examples to output anything. dmtx seems to be very limited regarding the size of the data; a regular SSH key wouldn't fit. (Also, libdmtx.org points to something very different nowadays.)
    – Raphael
    Mar 13 '18 at 10:34
  • 3
    zbarimg --raw qr.png > output.txt to save it to a file. "QR-Code:" text is appended to the output if --raw is not enabled.
    – Saftever
    Mar 9 '19 at 6:28
  • xbar-tools also contain a tool zbarcam with which the QR code can directly be scanned using a webcam.
    – luator
    Mar 25 '19 at 17:31
  • 1
    Beware - the zbarimg tool will add a label QR-Code: to the output. To suppress this, use the --raw option. Dec 16 '19 at 17:40

ZBar recognizes several kinds of bar codes, including QR codes. If I install zbar-tools

$ sudo apt-get install zbar-tools

and save that QtQR image to a file called askubuntu.png, then the zbarimg utility finds and decodes the QR code

$ zbarimg askubuntu.png 
scanned 1 barcode symbols from 1 images in 0.02 seconds

There is also a zbarcam utility, which you can use to decode QR codes spotted by your web cam.

  • It is not in the question, but can it also generate QR codes? Can you be explicit in the answer regarding this? Aug 4 at 14:03
  • OK, user oylenshpeegul has left the building. Perhaps somebody else can chime in (preferably by editing the answer - but without "Edit:", "Update:", or similar - the answer should appear as if it was written today)? Aug 4 at 14:04


A graphical interface for creating and reading QR codes.


QtQR can read QR codes from image files or from a webcam. It is able to recognise a number of specific types of QR code including web links, email addresses/messages, SMS messages and telephone numbers.

You could potentially scan the QR code from the book using a webcam. If you do this, ensure there is enough light and that you are holding the QR code flat and still. You will see a window with the webcam input on the screen. Wait until green dots appear then close the window and QtQR will tell you what was contained in the QR code.

You can install by adding the PPA ppa:qr-tools-developers/qr-tools-stable and installing the package qtqr.

  • Sorry, I've made the comment in the wrong browser tab. :( -- If you are going to test QtQR: launchpad.net/qr-tools, there are stable and diary PPA's, you can add the daily without too much worry. Please note that if you are running Ubuntu 10.10 you need to add an extra PPA because of some dependencies not been available (zbar) There are instructions in the launchpad site. Any feddback is greatly appreciated. Cheers! Sep 16 '11 at 18:09
  • sudo add-apt-repository ppa:qr-tools-developers/qr-tools-stable sudo apt-get update sudo apt-get install qtqr Jun 13 '19 at 6:12
  • Here are the installation commands for QTQR sudo add-apt-repository ppa:qr-tools-developers/qr-tools-stable sudo apt-get update sudo apt-get install qtqr Jun 13 '19 at 6:15
  • Using sudo add-apt-repository ppa:qr-tools-developers/qr-tools-stable, sudo apt-get update, and sudo apt-get install qtqr, it worked on Ubuntu MATE 20.04 (Focal Fossa) with Cinnamon. Tried 2021-08-04. To start: Win + Q → select "QtQR" → Enter Aug 4 at 14:24

Google Chrome has an extension in the Chrome Web Store called QRreader.

If a QR code exists on a webpage, just right-click on it and voilà!


In 2020, you should use CoBang to scan QR code. It was written recently by me, to catch new technologies in Linux desktop.

How to install in Ubuntu 20.04:

sudo add-apt-repository ppa:ng-hong-quan/ppa
sudo apt update
sudo apt install cobang

It doesn't support generating QR code yet. It is not high priority because there are already some websites to do, with pretty beautiful pictures.

  • The "paste image" feature is just what I needed to read a QR code displayed by another program. Apr 23 at 13:36
  • It is not in the question, but can it also generate QR codes? Can you be explicit in the answer regarding this? But without "Edit:", "Update:", or similar - the answer should appear as if it was written today Aug 4 at 14:08

There's a Brainstorm request for a QR reader here: http://brainstorm.ubuntu.com/item/15111/ Included in the comments are links to Tbarcode and Decodecamera which you might want to check out. I'd link directly to them, but I can't post more than one link yet.

  • I've just tried DecodeCamera. But it doesn't work. The python script meet an error.
    – Benjamin
    Jan 23 '11 at 11:13
  • If you post the error you might be able to get help with it. The way I deal with QR codes is to just point my phone at my screen and use the app on my phone.
    – Tanath
    Jan 24 '11 at 5:32

I actually wanted to be able to read these QR codes myself, so I made a little app that sits up on the system tray, you click it and it highlights all of the QR codes (or bar codes) visible on the screen and tells you what they say... Also, you can click on it and copy any of the code text to the clipboard to paste into a browser etc. I'm using ZBar, and you can check it out here...


Anyone wanna help me turn it into a package?


QTQR is not possible to install onto Ubuntu 10.04 LTS - there are broken packages. Instead of this you can use this link to get it installed.

Qreator is another QR-code creator:

repository - https://launchpad.net/qreator

homepage - http://davidplanella.org/project-showcase/qreator/

Qreator installation

Open a terminal with Ctrl+Alt+T and type these commands:

 sudo add-apt-repository ppa:qreator-hackers/qreator-stable

 sudo apt-get update

 sudo apt-get install qreator
  • But can Qreator do the same? Can it generate QR codes? The name implies it, but does it? Aug 4 at 14:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.