CyberChef Parse TLV Operation

📅 Updated: October 2025 🔍 Category: Data Format
TLV Parse CyberChef Data Format JSON

What is TLV?

TLV stands for Type-Length-Value, a data encoding format widely used in telecommunications, smart cards, and network protocols. It's a simple yet powerful way to structure binary data by dividing information into three parts: a type identifier, a length indicator, and the actual value.

Type
Tag ID
Identifies data type
Length
Size
Bytes of value data
Value
Data
Actual content
💡 Key Benefit: TLV encoding allows systems to easily parse unknown or optional fields without breaking compatibility. If you don't recognize a Type, you can simply skip past it using the Length value.

Why TLV Matters

TLV encoding is essential in many real-world applications including credit card chip transactions (EMV), network protocol messages, configuration files, and IoT device communication. Understanding TLV helps you analyze and debug these systems.

Common Usage
EMV
Structure Parts
3
Encoding
Binary

TLV Structure Explained

Type (Tag)

The Type field identifies what kind of data follows. It's typically 1-2 bytes and acts as an identifier. For example, in EMV payment cards, type 9F02 represents "Amount, Authorized".

Length

The Length field specifies how many bytes of data are in the Value field. This can be simple (1 byte for lengths up to 255) or use multi-byte encoding for larger values. Knowing the length allows parsers to jump directly to the next TLV element.

Value

The Value field contains the actual data. It can be any format: text, numbers, binary data, or even nested TLV structures. The Type field tells you how to interpret these bytes.

Real-World Example: Credit Card Data

9F02 06 000000001000

  • Type: 9F02 = Amount, Authorized
  • Length: 06 = 6 bytes
  • Value: 000000001000 = $10.00

Using Parse TLV in CyberChef

The Parse TLV operation in CyberChef converts TLV-encoded data into a readable JSON format. This is extremely useful when analyzing network packets, smart card data, or any system using TLV encoding.

Steps to Parse TLV:

  1. Open CyberChef and find the "Parse TLV" operation
  2. Input your TLV data (usually in hexadecimal format)
  3. Select the appropriate input format (Hex, Base64, etc.)
  4. The operation outputs a structured JSON object showing all Type-Length-Value triplets
⚠️ Input Format: TLV data is typically represented as hexadecimal strings. Make sure your input is properly formatted before parsing.
Interactive TLV Parser

Enter TLV-encoded data in hexadecimal format to see it parsed into JSON:

Click "Parse TLV" to see the result
Input Bytes
0
TLV Elements
0
Parse Status
Ready

TLV Format Visualizer

Understanding how TLV data is structured helps you work with it more effectively. This interactive visualizer breaks down TLV encoding step by step:

Build Your Own TLV

Create a TLV structure and see how it encodes:

Common TLV Tags Reference

Different systems use different tag sets. Here are some common examples from EMV payment systems:

Tag (Hex) Description Typical Length
9F02 Amount, Authorized 6 bytes
9F03 Amount, Other 6 bytes
5F2A Transaction Currency Code 2 bytes
82 Application Interchange Profile 2 bytes
9F26 Application Cryptogram 8 bytes
9F37 Unpredictable Number 4 bytes
📚 Tag Standards: Different industries define their own tag sets. EMV uses tags defined by EMVCo, while network protocols like SNMP or LDAP have their own tag definitions.

Best Practices

When working with TLV data in CyberChef, follow these guidelines for best results:

Common Use Cases

Common Issues & Solutions

Invalid Hex String

If parsing fails, ensure your input contains only valid hexadecimal characters (0-9, A-F). Remove spaces, colons, or other separators unless the parser explicitly supports them.

Incorrect Length Values

If the output looks wrong, the Length field might be corrupted or incorrectly encoded. This causes the parser to read the wrong number of bytes for the Value.

Empty or Incomplete Output

Incomplete TLV data will result in partial parsing. Ensure you have the complete message, including all bytes specified by each Length field.

Nested Structures Not Showing

Some TLV implementations use nested structures where a Value contains more TLV elements. You may need to parse these recursively or run Parse TLV again on specific value fields.

Summary

The Parse TLV operation in CyberChef is an essential tool for analyzing structured binary data. By converting TLV-encoded information into readable JSON format, it helps you understand complex data formats used in payment systems, network protocols, and smart cards. Remember to verify your input format, reference appropriate tag documentation, and validate the parsed output against expected values.

← Back to Operations Guide