EMV TLV Builder & Decoder

Build a TLV hex string from tag/value pairs (left) and decode TLV into EMV tags (right).

Build TLV

Enter one tag per line. Values should be hex (no spaces). You can use either = or whitespace.


Built TLV output

Length encoding follows EMV BER‑TLV rules (short form up to 127 bytes; long form uses 81/82).

How encoding works (mock)

function buildTLV(pairs):
  tlv = ""
  for each (tag, valueHex) in pairs:
    lenBytes = (valueHex.length / 2)
    L = encodeLength(lenBytes)   // 0..127 => 1 byte, else 81/82 + length
    tlv += tag + L + valueHex
  return tlv

EMV TLV encoding (builder)

EMV data elements are commonly represented as TLV (Tag‑Length‑Value). To encode TLV, you concatenate the tag bytes, the encoded length, then the value bytes (usually represented as hex in logs and ISO8583 DE55).

1) Tag (T)

  • Tags can be 1–3 bytes (e.g. 82, 5F2A, 9F33).
  • In this builder, you provide the tag as hex (no spaces).

2) Length (L)

  • Length is the number of bytes in the value (not hex characters).
  • Short form: 0..127 bytes → one length byte (e.g. 06).
  • Long form: if length ≥ 128, first byte indicates how many length bytes follow (e.g. 81 + 1 byte, 82 + 2 bytes).

3) Value (V)

  • Value is raw bytes. In hex form, it must be even-length.
  • Example: 9F0206 000000100100 → Tag 9F02, Length 06, Value 000000100100.
This page validates the TLV it builds by round‑tripping through the same decoder logic (parseTags) to catch length/value mistakes early.

Decode TLV

Paste TLV hex (e.g. DE55) and decode to tags.



Decoded tags

How decoding works (mock)

function parseTLV(tlvHex):
  while tlvHex not empty:
    tag = readKnownTagPrefix(tlvHex)  // 1..3 bytes from known list
    len = readLength(tlvHex)          // supports 81/82 long form
    value = read(len bytes)
    emit(tag, value)

EMV TLV decoding (parser)

To decode EMV TLV, you read the stream from left to right and repeatedly extract a tag, then its length, then exactly that many value bytes.

Step A: Read the tag (T)

  • Tags have variable size. Many EMV tags start with 9F (two-byte tags), but not all.
  • This decoder uses a known-tag list to determine whether the next 1, 2, or 3 bytes form a valid tag.

Step B: Read the length (L)

  • If the first length byte is < 0x80, that value is the length in bytes.
  • If the first length byte has the high bit set (e.g. 81, 82), then the lower bits tell how many bytes follow to represent the length.

Step C: Read the value (V)

  • Read exactly L bytes as the value.
  • Some tags are constructed (contain nested TLVs). In our util, tags starting with FF trigger a recursive parse.
If you see missing tags or misaligned values, the most common cause is a wrong length (a single byte off will break everything after it).
  Related

Recent Articles on Iso8583

Choose the product you need

ISO8583 Converter REST-api

Convert ISO8583 to rest-api JSON XML SQL &more

ISO8583 Interface Connector

Integrate ISO8583 card schemes and hosts

ISO20022 SWIFT MT MX Converter

Convert and integrate ISO20022 SWIFT MX with MT , ISO8583

ISO8583 Builder Parser Connector

Most simple solution to build and parse ISO8583 messages

ISO8583 Switch Router

ISO8583 or REST-api Switch Router Bin Amount

Card Payments Authorization

Pre-screen, pre-authorize and Authorize cards and ledger

POS Card Acquirer & Aggregator

Acquiring and Aggregating from POS and other devices

Cards Generator Issuing Host

Generate and export card data for cards issuing and test

ISO8583 Simulator

ISO8583 HISO98 HISO87 simulator

ISO20022 Simulator

ISO20022 & SWIFT simulator

POS Simulator

POS protocols simulator

Mobile Banking Simulator

Mobile Banking Testing Simulator

QR Payments Connector

EMV QR Payments Interface Connector

Micropayments Connector

Micropayments Acquiring Connector & Router

ISO8583 Alerts Notifications

Detect Anomalies, Alerts & Notifications

Clearing & Settlement

Generate Convert Import

Request a Quote

Get a free quote, Ask for details
Get help

Documentation

Read Documentation and Start guides

Online Tools

Online Tools Overview