TLV Builder

Build BER-TLV and EMV hex data by picking tags, formats, and values yourself.

This tool runs entirely in your browser. Your files are never uploaded to a server.

Application Primary Account Number (PAN)cn

Application Expiration Daten · 6 digits

Transaction Currency Coden · 4 digits

Application PAN Sequence Numbern · 2 digits

Amount, Authorisedn · 12 digits

Cardholder Nameans

TLV hex output · 52 bytes

5A0847617390010100105F24032512315F2A0209495F3401019F02060000000010005F200F544553542043415244484F4C444552

Decoded back (what a parser will see)

5AApplication Primary Account Number (PAN)(8 bytes)
4761739001010010
5F24Application Expiration Date(3 bytes)
251231
5F2ATransaction Currency Code(2 bytes)
0949
5F34Application PAN Sequence Number(1 bytes)
01
9F02Amount, Authorised(6 bytes)
000000001000
5F20Cardholder Name(15 bytes)
544553542043415244484F4C444552

Encodes BER-TLV with definite lengths (short form under 128 bytes, 81/82 long form above). Everything runs in your browser — use synthetic card data only.

What this tool does

Builds BER-TLV/EMV hex data row by row: pick a tag (57, 5F24, 5F2A, 5F34, 9F02, and more), choose how to enter its value (hex, text, EMV numeric, or compressed numeric), and the tool encodes the length and concatenates everything into one hex string — the reverse of what the TLV Parser decodes.

How to use it

Add one row per tag, type or select it from the built-in EMV tag list, pick the matching value format, and enter the value in plain digits or text — the tool converts it to hex and pads it automatically when the tag has a fixed EMV length. Optionally wrap the whole list in a constructed template tag (70, 77, 6F, and others) to produce a single nested structure.

Worked example

The default rows build a minimal EMV data set — PAN (5A), expiration date (5F24), currency code (5F2A), PAN sequence number (5F34), authorised amount (9F02), and cardholder name (5F20) — and show the resulting hex string plus its decoded tree so you can confirm each length byte before using the data elsewhere.

EMV value formats

Numeric fields (format n, like 5F24 or 9F02) are packed as BCD and left-padded with zeros to their fixed digit count; compressed numeric fields (format cn, like the PAN or Track 2 data) are left-justified and right-padded with F; text fields are encoded as plain ASCII bytes. Picking a recognized tag preselects the right format automatically.

Length encoding

Lengths under 128 bytes use the BER-TLV short form (a single length byte); at 128 bytes or more the tool switches to the long form (0x81/0x82/… followed by the length's own bytes), matching how a real terminal or card would encode the same data.

Important limitations

This is a generic BER-TLV encoder with EMV-aware padding for a bundled subset of tags — it does not validate cryptograms, produce a compliant EMV transaction, or check that a combination of tags is valid for any particular scheme. Always verify output against the exact specification (or test card/terminal) you're targeting.

Privacy and sources

Encoding happens entirely in your browser; nothing you type is uploaded. Built from the EMV Books 1–4 tag and data-element specifications (Application Interchange Profile, Terminal Verification Results, and related books) as reference for tag names and formats; content reviewed September 2026.

Frequently Asked Questions

What's the difference between this and the TLV Parser?
The TLV Parser decodes existing hex data into a tag tree; this Builder does the reverse — you pick tags and values and it produces the hex string, so the two tools are complementary halves of the same workflow.
Why does my numeric value get padded with zeros?
Several EMV tags (like 5F24 Expiration Date or 9F02 Amount) use a fixed-length numeric (BCD) format, so the tool zero-pads on the left to match the tag's defined digit count — the same padding a real card or terminal would produce.
Can I build a nested structure like an FCI template?
Yes — set "Wrap in template tag" to a constructed tag such as 6F or 70 and every row you've entered is encoded as one TLV, then wrapped inside that outer tag with its own length.