Need estimation?
Leave your contacts and get clear and realistic estimations in the next 24 hours.
Table of contentS
Born in the early 2000s from the RFID and contactless smart card technologies like Sony’s FeliCa and NXP’s MIFARE, NFC is now transforming the way devices communicate and interact. It started gaining true popularity in 2011, with the introduction of Google Wallet and Samsung Pay. Today in 2025, NFC is booming not only for lightning-fast contactless payments, but also for contact data sharing with NFC business cards, secure authentication with digital IDs, keyless access solutions in real estate, automotive, and tourism, public transportation ticketing, smart packaging, inventory tracking, and IoT device pairing and more.
Now, we don’t have to imagine a world where you pay for your morning coffee with a simple tap of your phone or unlock your car as you approach it – we live in it. In smart homes, NFC tags can be programmed to control appliances, unlock doors, or even adjust lighting settings with a simple tap of a smartphone. In the realm of events and conferences, NFC-enabled badges allow for seamless check-ins and networking opportunities, so attendees can easily exchange contact information or access event schedules. In fact, the global NFC market size was valued at $30.85 billion in 2024 and is projected to grow at a CAGR of 12.3% from 2025 to 2030, highlighting its growing significance in business applications.
In this article, we will explore what NFC tags are, their types, and how to program NFC tags effectively on both Android and iOS platforms.
NFC stands for near-field communication and is based on RFID (Radio Frequency Identification), allowing devices to communicate when they are physically close. NFC tags, cards, and chips are small, passive devices that can store data and communicate with NFC-enabled devices, such as smartphones, tablets, speakers, headphones, game consoles, access control systems, and others.
For NFC to work, there should be at least a passive NFC device that stores data and an active device (reader) that activates the passive device and can read and write information on it. Thus, there are three main operating modes for NFC:
Let’s see how exactly the communication works in the passive operating mode example (when we have the tag and the reader):
1. Field Activation
NFC uses magnetic field induction, which works at a frequency range of 13.56 MHz and offers a data transmission rate of up to 424 kbit/s within a distance of approximately 10 centimeters. The active device – NFC reader – generates this RF electromagnetic field, it powers the passive NFC tag and activates it for communication.
2. Tag Detection & Selection
The reader sends a REQA (Request Command) to detect the tag. If there are multiple tags in range, it initiates an anticollision procedure to identify and select a single tag it has to communicate with using its UID (Unique Identifier).
3. Protocol Activation
The reader and the tag establish communication and its parameters, such as baud rate, framing format, CRC checks and error detection, as well as higher-layer protocols if needed.
4. Data Transfer
The reader sends READ, WRITE, or AUTHENTICATE commands to the tag and it responds with the requested data or status or returns a payload (a URL, text, contact info, WiFi pairing, app launch instruction, etc.)
5. Authentication or Secure Session (optional)
Secure tags (NTAG424 DNA or MIFARE DESFire EV3) may require mutual authentication using AES or 3DES keys, generate cryptographic SUN (Secure Unique NFC) messages, perform session key derivation, anti-tamper checks, or transaction counters.
6. Termination / Field Removal
When the tag moves out of range or the reader disables the field, the tag loses power, and the communication session ends.
NFC is very simple in use: you only have to place an NFC-enabled device close to the tag – and the communication initiates. This provides opportunities for multiple use scenarios, especially for situations where a quick and simple connection interface matters.
Find out how we built an innovative fan engagement application that relies on NFC technology for one of our clients.
The NFC technology has many features that make it so widely adopted:
If you try surfing the net in search of an NFC tag for your solution, you will come across a wide range of options. So, before we move on to discussing how to program NFC chips, let’s clarify their differentiating features, capabilities, and purposes.
The NFC ecosystem is largely built on five tag types (as defined by the NFC Forum) and several proprietary and secure chip families, each suited for different applications.
The NFC Forum is a non-profit industry consortium founded in 2004 by Sony, NXP Semiconductors, and Nokia, aiming to standardize and advance the NFC technology. The organization differentiates the types of NFC tags by their memory structure, communication protocol, and data access methods, with all of them supporting NDEF (NFC Data Exchange Format) to varying extents:
Also, there are proprietary NFC chip families that go beyond basic tags, offering cryptographic support, multiple applications, and high configurability.
NFC chip types also may come in different form factors:
Each type of NFC chips has unique features and limitations, making it crucial to choose the right one based on the intended application. For instance, NFC Type 4 tags are preferred for payment systems due to their enhanced security features, while Type 1 tags may suffice for basic data sharing tasks. Embedded in various materials, such as stickers, wristbands, business cards, etc., NFC chips allow versatile integration into everyday objects. This adaptability has led to innovative uses in industries ranging from retail to healthcare, where NFC technology can streamline processes and enhance user experiences.
Programming NFC tags requires specific tools and software to ensure successful implementation. Thus, in this section, we briefly describe the essential tools you will need for NFC programming.
The main thing you will need is a device that can write data to NFC tags and chips and read it from them. The most common hardware used to program NFC tags are mobile Android and iOS devices that support the NFC technology and have the NFC feature enabled in the settings. In some cases, engineers may use USB NFC Readers (ACR series, Omnikey, Identiv) for PC-based tag initialization, provisioning, or desktop applications or development boards for embedded device programming.
You will need to purchase blank or rewritable NFC tags, making sure they are not locked or permanently written. The type of NFC tags you will program should correspond to your application requirements. Consider factors like memory capacity, security features, and form factor. For example, the most common NTAG213, NTAG215, and NTAG216 tags are inexpensive and support NDEF; NTAG424 DNA tags support cryptography, making them more secure; MIFARE Ultralight / DESFire are more advanced and require authentication keys.
If you decide to use mobile devices to program your NFC chips or tags, you can use various Android and iOS applications that enable NFC tag programming through a user-friendly interface. Examples include NFC Tools for Android and iOS, MIFARE SDK Tools and NXP TagWriter for Android, and even core NFC-enabled custom apps from iOS that allow limited write to NFC Type 1–5 tags.
Also, there are desktop tools for programming NFC tags that work with USB NFC readers. There’s an NFC Tools app for PC that offers a GUI and enables NDEF read/write. For enterprise-grade bulk NFC provisioning, developers use GoToTags NFC Encoder.
There are also development kits and libraries that are best for NFC programming on each platform. For Android, you can use Android NFC APIs, NXP MIFARE SDK (for working with MIFARE DESFire, Ultralight, and NTAG) or TapLinx SDK (a more modern alternative to MIFARE SDK from NXP). Meanwhile, iOS has more limits. It relies on Core NFC only starting from iOS 13, plus it provides limited writing features, supporting just a few tag types and giving no access to low-level operations.
For advanced programming, a development environment such as Android Studio for Android or Xcode for iOS may be necessary. These platforms offer extensive libraries and APIs for integrating NFC functionality into your applications.
How to Program NFC Tags on Android & iOS?
Programming NFC tags on Android and iOS involves a few straightforward steps. Below, our mobile development experts provide a general guide for both platforms.
You can program NFC tags on Android with two different approaches: using NFC Tools with no coding or by using your own Android app. While the NFC Tools app is enough for some small tasks, it won’t provide the security and scalability you can achieve with your custom Android app. Thus, here, we provide the instructions for programming your NFC tags using your own Android app written in Kotlin.
The Android system is permission-based, so to be able to use NFC in an app, you need to declare the required permission. The NFC events dispatch works starting from Android API level 10. Thus, in AndroidManifest.xml file, declare the following:
<uses-permission android:name="android.permission.NFC" />
If you want your app to be available on Google Play only for devices that have NFC hardware, then you need to add the following in the manifest:
<uses-feature android:name="android.hardware.nfc" android:required="true" />
If NFC functionality is not crucial to the app, then you can omit this <uses-feature> line. But make sure you check if NFC is available at runtime.
val intent = Intent(this, javaClass).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
val pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_MUTABLE)
val filters = arrayOf(IntentFilter(NfcAdapter.ACTION_TAG_DISCOVERED))
nfcAdapter.enableForegroundDispatch(this, pendingIntent, filters, null)
override fun onNewIntent(intent: Intent) {
val tag = intent.getParcelableExtra<Tag>(NfcAdapter.EXTRA_TAG)
val ndef = Ndef.get(tag)
if (ndef != null) {
val message = NdefMessage(arrayOf(
NdefRecord.createTextRecord("en", "Hello NFC!")
))
ndef.connect()
ndef.writeNdefMessage(message)
ndef.close()
}
}
As we’ve already mentioned, in contrast with the Android systems, iOS has some limitations:
Thus, for programming an NFC tag with iOS, you will need an iPhone with iOS 13 and higher, Core NFC, Xcode, and Swift, and a type 2 or 4 NFC tag. Here's the workflow:
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>NDEF</string>
</array>
<key>NFCReaderUsageDescription</key>
<string>We use NFC to write to tags</string>
This grants your app permission to initiate NFC NDEF sessions and displays the usage description as a system alert when NFC is first accessed. Without this, NFC sessions will fail to start or will be rejected during App Store review.
class NFCWriter: NSObject, NFCNDEFReaderSessionDelegate {
var session: NFCNDEFReaderSession?
func beginSession() {
session = NFCNDEFReaderSession(delegate: self, queue: nil, invalidateAfterFirstRead: false)
session?.alertMessage = "Hold your iPhone near the NFC tag"
session?.begin()
}
func readerSession(_ session: NFCNDEFReaderSession, didDetect tags: [NFCNDEFTag]) {
guard let tag = tags.first else { return }
session.connect(to: tag) { error in
tag.queryNDEFStatus { status, capacity, error in
let payload = NFCNDEFPayload.wellKnownTypeTextPayload(string: "Hello from iOS!", locale: Locale(identifier: "en"))
let message = NFCNDEFMessage(records: [payload!])
tag.writeNDEF(message) { error in
if error != nil {
session.invalidate(errorMessage: "Write failed")
} else {
session.alertMessage = "Write success!"
session.invalidate()
}
}
}
}
}
func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) {
print("Session ended: \(error.localizedDescription)")
}
}
This step Initializes the NFC session and starts scanning, handles tag detection and writes a basic NDEF text payload. Also, this enables the session to end with appropriate success or error messages.
let writer = NFCWriter()
@IBAction func writeTagButtonTapped(_ sender: UIButton) {
writer.beginSession()
}
This way, you ensure NFC scanning is user-initiated, following the iOS requirement, and the reader session launches and displays Apple’s native NFC scanning prompt.
Programming NFC tags for payment applications requires additional considerations to ensure security and compatibility. This involves multiple layers: secure tag hardware, backend integration with a payment provider, encrypted payload handling, and a smooth user experience. So in this section, we provide a guide on how to set up an NFC tag for payments.
We recommend selecting an NFC Type 4 tag, as they are designed for secure transactions. They support ISO/IEC 14443-4 protocol, file-based access, AES/3DES encryption, secure session authentication, and anti-cloning features (like SUN — Secure Unique NFC message).
Payment data is not stored on the tag. The tag is used as a token trigger or identifier, which the mobile app or terminal resolves through a secure backend. For Google Pay, you need to use the Android HCE (Host-based Card Emulation) on Android. For Apple Pay – embedded Secure Element, which is not programmable via the NFC tag. Alternatively, you can handle wallet logic and server-based transaction processing in your app.
Ensure that sensitive payload data (e.g., token or reference ID) is encrypted and that the tag is programmed to comply with payment security standards. Make sure you don’t store PAN or card data on the tag and use NDEF Records with dynamic URL or app-launch instructions. As an option, in certain tags, you can use SUN message for anti-cloning.
After programming, conduct thorough testing to ensure that the NFC tag functions correctly at point-of-sale terminals and that transactions are processed securely. Make sure that:
Tools you can use for testing your NFC payment workflow include NFC Tools Pro, Terminal simulators (Square Reader SDK, Verifone test mode). Consider backend logging for the token lifecycle.
User experience should be seamless, allowing users to complete transactions with a simple tap of their device against the NFC tag. Payment should be triggered instantly and users should get clear UI feedback (“payment complete” screen, etc.) If you don’t have a dedicated app, make sure a secure payment web page opens properly.
As any software programming, NFC setup has its nuances and challenges. Thus, for those looking for some extra recommendations on NFC programming, we’ve prepared some important tips.
Foreground dispatch ensures that your app gets first access to an NFC tag when it's active. Without it, the system may prompt the user to choose from other NFC-capable apps (like Google Wallet), or worse, ignore your app entirely. Implementing foreground dispatch in Android can help prioritize your app for NFC intents, ensuring that it receives the tag data first when in the foreground. You must disable foreground dispatch in onPause() or the system may throw exceptions. Keep in mind that this only works while the activity is resumed and visible.
Some devices (especially budget or older ones) don’t support NFC, and others might have it disabled. Your app should gracefully handle both cases. So always verify whether the device supports NFC and if it is enabled in the settings: prompt user to open NFC settings with startActivity(Intent(Settings.ACTION_NFC_SETTINGS)) and disable NFC features in the UI if NFC is not available. This can prevent crashes or unexpected behaviors during implementation.
NFC tags can be read by any device with an NFC reader, which makes them vulnerable to eavesdropping or cloning if you store plaintext sensitive data. Thus, when programming NFC tags for payments or authentication, never store sensitive data like user credentials, payment tokens, or API keys in plaintext. We recommend encrypting data before writing it to the tag and authenticating the tags using NFC chips with secure features (Secure Unique NFC (SUN), file-level AES authentication).
As you already know, NFC is not just for reading tags – it also supports device-to-device (peer-to-peer) communication applicable for contact sharing, app content syncing, or triggering actions in nearby devices. So, you can leverage NFC's peer-to-peer mode for non-trivial applications and features that can blow your users’ minds and attract more attention to your software product.
Unlike Android, iOS doesn’t allow background NFC tag detection unless certain system apps are running (like Apple Wallet): it requires a user-initiated action (e.g., button press) to start the NFC session. Also, the NFC session times out after ~60 seconds, and only NDEF-formatted tags are supported for reading. Keep these nuances in mind while designing UI and make sure your app guides the user to scan a tag within a specific UI flow.
Programming NFC tags is a powerful way to enhance user experiences and streamline interactions in various applications, from payments to data sharing. Understanding the types of NFC tags, the tools required, and the programming process on both Android and iOS platforms is essential for successful implementation. By following best practices and incorporating advanced techniques, developers can create innovative solutions that leverage the capabilities of NFC technology.
If you're inspired by the possibilities of NFC tags and want to integrate this technology into your business solutions, Axon is here to help. Our expertise in full-cycle software development ensures that your NFC-enabled applications are not only innovative but also tailored to drive your business forward. From concept to maintenance, we deliver custom software solutions that align with your unique needs. Ready to transform your business ideas into reality? Contact us at Axon, and let's create something exceptional together.
Yes, you can reprogram NFC tags as long as they haven’t been permanently locked. Writable tags can be erased and updated multiple times using supported NFC apps or code until they are explicitly made read-only.
You can check a tag’s lock status using NFC writing apps like NFC Tools or programmatically by reading the tag’s lock bytes or metadata. If locked, attempts to write to the tag will either fail or return an error code.
Yes, NFC tags can be programmed for multiple uses, such as linking to a website, sharing contact information, or initiating a payment process, depending on the tag's memory capacity and type.
Free product discovery workshop to clarify your software idea, define requirements, and outline the scope of work. Request for free now.
[1]
[2]
Leave your contacts and get clear and realistic estimations in the next 24 hours.