When I first started working on EMV integration in one of our terminal projects, I was overwhelmed by how much technical jargon was thrown around. One of the most confusing things I came across early on was something called “TLV” I still remember opening a packet capture for a failed transaction and seeing a sea of alphanumeric codes, thinking, what in the world is this stuff?
If you’re also dealing with EMV or working on payment terminals, you’ve probably seen TLV too. Maybe it’s in the transaction logs. Maybe it’s in the APDU response. Either way, it’s everywhere in EMV and it’s important to know what it means, how it works, and how to decode it.
In this post, I’ll break it down for you in a simple, beginner-friendly way, sharing what I’ve learned from my own experience.
What is TLV?
TLV stands for:
- Tag
- Length
- Value
It’s a way of encoding data where each field contains:
- A Tag to identify what kind of data it is
- A Length that tells you how long the value is
- A Value, which is the actual data itself
Think of it like labeling a storage box: the tag is the label, the length is the size of the contents, and the value is what’s actually inside.
Here’s a real-world example (simplified):
9F02 06 000000010000
- 9F02 = Tag (Amount, Authorized)
- 06 = Length (6 bytes)
- 000000010000 = Value (Amount = 100.00 in cents)
Why TLV is Used in EMV?
EMV (Europay, Mastercard, Visa) cards operate with smart chips, and these chips store a lot of structured data. TLV is used because:
- It’s flexible and self-descriptive
- It’s compact and fits well into APDU commands
- It’s standardized, making it easier to parse and validate
When a terminal sends a command to the card, it receives TLV-formatted data back. This format is key to how EMV cards exchange data during a transaction.
How to Read a TLV Sequence
Let me walk you through a TLV breakdown. Here’s a sample data stream:
6F 23 84 07 A0 00 00 00 03 10 10 A5 18 50 0A 56 49 53 41 20 44 45 42 49 54 87 01 01
Let’s decode step by step:
Step 1: Tag
Start from the first byte:
- 6F = This is the tag for the FCI Template
Some tags are one byte (9A, 5F2A), and some are two or more (9F42, 5F34).
Step 2: Length
- After the tag 6F, you’ll see 23 = which is hexadecimal for 35 (this tells you the value is 35 bytes long)
Step 3: Value
- The next 35 bytes represent the value of the 6F tag, which contains more nested TLV values.
This nesting makes TLV parsing more complex but also more powerful.
TLV Structure in Real-Life EMV Applications
To give you a visual reference, here’s a basic diagram I made that shows a TLV structure:

TLV Security Relevance
TLV isn’t just for structure. It’s also crucial for cryptographic checks. For example:
- 9F10: Issuer Application Data
- 9F26: Application Cryptogram
These values are essential for verifying the card and ensuring transaction integrity. Tags 9F10 and 9F26 are among the key concepts in EMV TLV. I’ll be creating a blog post focused on these tags.
How to Parse TLV in Code?
public static Dictionary<string, string> ParseTLV(string tlvData)
{
var result = new Dictionary<string, string>();
int index = 0;
while (index < tlvData.Length)
{
string tag = tlvData.Substring(index, 2);
index += 2;
if ((Convert.ToByte(tag, 16) & 0x1F) == 0x1F)
{
tag += tlvData.Substring(index, 2);
index += 2;
}
int length = Convert.ToInt32(tlvData.Substring(index, 2), 16);
index += 2;
string value = tlvData.Substring(index, length * 2);
index += length * 2;
result[tag] = value;
}
return result;
}
This helped us quickly debug terminal issues by viewing the raw TLV in a readable way.
EMV vs NFC TLV: Are They the Same?
While both EMV chip and contactless cards use TLV, NFC protocols like PayWave and PayPass often use slightly different structures and data tags (like PPSE – Proximity Payment System Environment).
Still, the TLV principle remains the same.
Resources You Can Explore
Here are some excellent resources I personally learned from:
- EMV Book 3: Application Specification from EMV Website
- EMV Tag Reference Guide (PDF by QuickChip)
- GlobalPlatform Card Specification
- NXP EMV TLV Guide
- Handy TLV Decoder Online
Final Thoughts (From My Experience)
If you’re working with EMV, especially if you’re building or debugging terminals, understanding TLV is not optional, it’s mandatory. Once you get the hang of it, it actually becomes second nature.
When we finally nailed our parsing logic during a production issue, the whole team felt relieved. So, don’t get discouraged by how cryptic it looks at first.
It’s just a structured way to talk to a chip. Once you understand the language, you’ll be surprised how much power and flexibility EMV gives you.