Skip to content
Platform independent Near Field Communication (NFC) library
C CMake M4 Roff Makefile Shell
Branch: master
Clone or download
doegox Merge pull request #554 from quantum-x/master-UL-4K-DirectWrite-OneTi…

Adding extended Magic Card support
Latest commit f8b2852 Aug 22, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmake Add missing files to autotools release process Apr 4, 2017
contrib Add missing files to autotools release process Apr 4, 2017
examples Fixed a typo in examples/nfc-emulate-uid.1 Apr 28, 2019
include Fix mem leak May 18, 2017
libnfc Fix PN533 hardcoded ednpoints table Jul 17, 2019
m4 I2C: remove unneeded I2C_DRIVERS_ENABLED Jun 14, 2013
test Add more missing files Apr 4, 2017
utils Update nfc-mfclassic.c Aug 19, 2019
.gitignore Git: ignore generated files May 18, 2015
.travis.yml Update .travis.yml Aug 21, 2019
AUTHORS Update changelog & authors Mar 2, 2017
CMakeLists.txt Generate config.h into build instead source directory. Jul 19, 2019
COPYING Add LICENSE and README files to releases produce by s… Jun 26, 2009
ChangeLog New NFC modulation type NMT_BARCODE May 17, 2017 Remove last SVN cruft Nov 27, 2012 typo Feb 18, 2017 Add more missing files Apr 4, 2017 Fix typo in drivers blacklist, thanks Godfrey Chung Mar 7, 2017 Added Markdown to HACKING file Apr 8, 2016 Update README about pn533_usb Feb 18, 2017 Some systems (e.g. glibc < 2.17) require librt to get clock_gettime Mar 2, 2017
libnfc.conf.sample Fix typo in libnfc.conf.sample Apr 30, 2013 Sync libnfc.pc includedir with the rest of the project source files. Dec 22, 2009 Fix version fetch using Jan 15, 2013
manual-test-results.txt add some manual test reports. May 5, 2011 allow to cross-compile 32 and 64 bit versions of the library for windows Jan 25, 2017

* Free/Libre Near Field Communication (NFC) library
* Libnfc historical contributors:
* Copyright (C) 2009      Roel Verdult
* Copyright (C) 2009-2015 Romuald Conty
* Copyright (C) 2010-2012 Romain Tartière
* Copyright (C) 2010-2013 Philippe Teuwen
* Copyright (C) 2012-2013 Ludovic Rousseau
* Additional contributors:
* See AUTHORS file

General Information

libnfc is a library which allows userspace application access to NFC devices.

The official web site is:

The official forum site is:

The official development site is:

Important note: this file covers POSIX systems, for Windows please read


Some NFC drivers depend on third party software:

The regression test suite depends on the cutter framework:


See the file INSTALL for configure, build and install details.

Additionnally, you may need to grant permissions to your user to drive your device. Under GNU/Linux systems, if you use udev, you could use the provided udev rules. e.g. under Debian, Ubuntu, etc.

sudo cp contrib/udev/93-pn53x.rules /lib/udev/rules.d/

Under FreeBSD, if you use devd, there is also a rules file: contrib/devd/pn53x.conf.


In order to change the default behavior of the library, the libnfc uses a configuration file located in sysconfdir (as provided to ./configure).

A sample commented file is available in sources: libnfc.conf.sample

If you have compiled using:

./configure --prefix=/usr --sysconfdir=/etc

you can make configuration directory and copy the sample file:

sudo mkdir /etc/nfc
sudo cp libnfc.conf.sample /etc/nfc/libnfc.conf

To configure multiple devices, you can either modify libnfc.conf or create a file per device in a nfc/devices.d directory:

sudo mkdir -p /etc/nfc/devices.d
printf 'name = "My first device"\nconnstring = "pn532_uart:/dev/ttyACM0"\n' | sudo tee /etc/nfc/devices.d/first.conf
printf 'name = "My second device"\nconnstring = "pn532_uart:/dev/ttyACM1"\n' | sudo tee /etc/nfc/devices.d/second.conf

How to report bugs

To report a bug, visit and fill out a bug report form.

If you have questions, remarks, we encourage you to post this in the developers community:

Please make sure to include:

  • The version of libnfc

  • Information about your system. For instance:

    • What operating system and version
    • For Linux, what version of the C library

    And anything else you think is relevant.

  • A trace with debug activated.

    Reproduce the bug with debug, e.g. if it was:

      $ nfc-list -v

    run it as:

      $ LIBNFC_LOG_LEVEL=3 nfc-list -v
  • How to reproduce the bug.

    Please include a short test program that exhibits the behavior. As a last resort, you can also provide a pointer to a larger piece of software that can be downloaded.

  • If the bug was a crash, the exact text that was printed out when the crash occured.

  • Further information such as stack traces may be useful, but is not necessary.


Patches can be posted to

If the patch fixes a bug, it is usually a good idea to include all the information described in "How to Report Bugs".


It should be as simple as running these two commands:




If your Touchatag or ACR122 device fails being detected by libnfc, make sure that PCSC-lite daemon (pcscd) is installed and is running.

If your Touchatag or ACR122 device fails being detected by PCSC-lite daemon (pcsc_scan doesn't see anything) then try removing the bogus firmware detection of libccid: edit libccid_Info.plist configuration file (usually /etc/libccid_Info.plist) and locate <key>ifdDriverOptions</key>, turn <string>0x0000</string> value into 0x0004 to allow bogus devices and restart pcscd daemon.


Using an ACR122 device with libnfc and without tag (e.g. to use NFCIP modes or card emulation) needs yet another PCSC-lite tweak: You need to allow usage of CCID Exchange command. To do this, edit libccid_Info.plist configuration file (usually /etc/libccid_Info.plist) and locate <key>ifdDriverOptions</key>, turn <string>0x0000</string> value into 0x0001 to allow CCID exchange or 0x0005 to allow CCID exchange and bogus devices (cf previous remark) and restart pcscd daemon.

Warning: if you use ACS CCID drivers (acsccid), configuration file is located in something like: /usr/lib/pcsc/drivers/ifd-acsccid.bundle/Contents/Info.plist


Libnfc cannot be used concurrently with the PCSC proprietary driver of SCL3711. Two possible solutions:

  • Either you don't install SCL3711 driver at all
  • Or you stop the PCSC daemon when you want to use libnfc-based tools

PN533 USB device on Linux >= 3.1:

Since Linux kernel version 3.1, a few kernel-modules must not be loaded in order to use libnfc : "nfc", "pn533" and "pn533_usb". To prevent kernel from loading automatically these modules, you can blacklist them in a modprobe conf file. This file is provided within libnfc archive:

sudo cp contrib/linux/blacklist-libnfc.conf /etc/modprobe.d/blacklist-libnfc.conf

Proprietary Notes

FeliCa is a registered trademark of the Sony Corporation. MIFARE is a trademark of NXP Semiconductors. Jewel Topaz is a trademark of Innovision Research & Technology. All other trademarks are the property of their respective owners.

You can’t perform that action at this time.