Disclosure: As an Amazon Associate, CardWise earns from qualifying purchases at no additional cost to you. This does not affect our recommendations.
TLV/BER-TLV Parser Comparison — Decoding EMV's Data Language
EMV payment cards, smart cards, and PKI certificates all speak the same data language: BER-TLV (Basic Encoding Rules, Tag-Length-Value). Every piece of data — from your card number to the cryptogram — is encoded as a TLV object with a tag that identifies the data type, a length, and the value itself. Parsing TLV correctly is essential for EMV development, smart card debugging, and security auditing.
This comparison reviews the available TLV parsers and how they handle tag resolution, constructed objects, multi-byte tags, length encoding, and EMV-specific tag dictionaries.
TLV Structure
Tag (1-2 bytes) Length (1-3 bytes) Value (N bytes)
| | |
Identifies Size of value The actual data
data type that follows
Examples:
9F02 → Amount, Authorized (numeric, 6 bytes)
5A → Application Primary Account Number (PAN)
9F36 → Application Transaction Counter (ATC)
8A → Authorization Response Code
57 → Track 2 Equivalent Data
Some tags are constructed (bit 5 of the first tag byte = 1), meaning their value contains nested TLV objects. For example, tag 70 (EMV Reply Template for SDA) is constructed and contains primitive tags like 90 (Issuer Public Key Certificate) and 9F32 (Issuer Public Key Exponent).
Parser Comparison
| Feature | CardWise EMV TLV Parser | emv-lab.dev | PC/SC TLV Tools |
|---|---|---|---|
| Platform | Web (browser, no install) | Web | Desktop (CLI/GUI) |
| EMV Tag Dictionary | Full (EMV 4.3 Book 3 + kernel specs) | Full EMV + payment scheme tags | Basic EMV tags |
| Constructed Object Parsing | Recursive (unlimited depth) | Recursive | Recursive |
| Multi-byte Tags | Yes (9Fxx, BFxx) | Yes | Yes |
| Length Encoding | 1-byte, 2-byte, 3-byte forms | Yes | Yes |
| Tag Name Resolution | EMV + ISO 7816 + GlobalPlatform | EMV + payment scheme | EMV only |
| Privacy | Client-side (no upload) | Server-side (data sent to server) | Local |
| Hex Input Format | Flexible (spaces, newlines, uppercase/lowercase) | Requires clean hex | Requires clean hex |
| Error Handling | Reports exact offset of malformed TLV | Generic error | Generic error |
Privacy Consideration
Common EMV Tags
| Tag | Name | Description |
|---|---|---|
| 4F | Application Identifier (AID) | Identifies the card application (e.g., A0000000041010 for Visa Debit) |
| 5A | Application PAN | Primary Account Number (16 digits) |
| 57 | Track 2 Equivalent Data | PAN + expiration date + service code |
| 5F24 | Application Expiration Date | YYMMDD format |
| 8A | Authorization Response Code | 00 = approved, 05 = declined, etc. |
| 9F02 | Amount, Authorized | Transaction amount in minor units (cents) |
| 9F36 | Application Transaction Counter | Incrementing counter for each transaction |
| 9F26 | Application Cryptogram (AC) | The EMV cryptogram (ARQC, TC, or AAC) |
| 9F10 | Issuer Application Data | Card-specific data for issuer verification |
| 70 | EMV Reply Template for SDA | Constructed: contains SDA certificates and data |
ACR122U NFC Reader — Capture raw EMV TLV data from contactless payment cards. Use with the CardWise TLV Parser for instant client-side decoding.
— Check Price on Amazon
Use Cases for TLV Parsing
- EMV development: Debug contactless transaction flows by inspecting the TLV data exchanged between the card and terminal.
- Card personalization: Verify that the correct TLV data objects were written to the card during personalization.
- Security auditing: Inspect the cryptogram, ATC, and issuer application data to verify transaction integrity.
- Interoperability testing: Compare TLV responses from different card manufacturers to ensure terminal compatibility.
- PKI certificate parsing: X.509 certificates use DER encoding (a variant of BER-TLV). A BER-TLV parser can decode the certificate's ASN.1 structure.
Related Comparisons
- ATR Parser Comparison — decoding the smart card's initial identification
- GPO vs AC Commands — where TLV data is exchanged in the EMV flow
- EMV vs Magnetic Stripe — why TLV encoding replaced track data
- ASN.1 Parser Comparison — parsing X.509 certificates and DER structures
Summary
Ready to decode TLV data? Try our EMV TLV Parser or the EMV Tag Lookup.