Skip to main content

Structured Data

TLV Parser

Parse hexadecimal TLV records with fixed type widths and big-endian or definite BER lengths. Inspect offsets and reject truncated values.

Tool workspace

Packet bytes stay in this browser. Checksum checks use only the addresses you enter.

Add the required input to continue.

Needs input

Run the tool when your input is ready.

Paste hexadecimal TLV records. Type bytes stay opaque. Length values use big-endian order.

Options

Fixed type width in bytes. Zero selects length-value records.

Fixed length width in bytes. BER length ignores this width.

Read definite BER lengths. This does not decode variable ASN.1 tags or nested objects.

Your result appears here

Parse hexadecimal TLV records with fixed type widths and big-endian or definite BER lengths. Inspect offsets and reject truncated values.

This tool runs open-source code from CyberChef by GCHQ (Apache License 2.0). See open-source credits.

TLV Parser reads fixed-width type bytes followed by a length and its value. Fixed lengths use big-endian order. Use BER length selects definite BER length encoding while keeping the configured type width. The parser returns each record's starting offset, type bytes, value length, and exact hexadecimal value.

The JSON keeps type and value bytes as hexadecimal strings. The byte table explains each type, length, and value boundary.

  • Check a proprietary binary message whose tag and length widths are known.
  • Locate a truncated value without silently inventing missing bytes.
  • Inspect definite BER length fields while retaining opaque application values.

Sources: ITU-T X.690: BER length encoding

Instructions

  1. Select Hex and paste complete byte pairs. Choose Raw only when characters directly represent the original byte values.
  2. Set Type size to the fixed number of type bytes. Use zero for records that contain only length and value.
  3. Set Length size to the fixed width from your format specification. Use BER length ignores that fixed width.
  4. Select Parse bytes. Compare each record's declared length with its value bytes and the next record's offset.
  5. Select Run working sample for two records with type bytes 01 and 02.

Example

Input: 01 03 41 42 43 02 02 00 ff

Settings: Input format: Hex; Type size: 1; Length size: 1; Use BER length: off (the defaults).

Result: [ { "offset": 0, "key": "01", "length": 3, "value": "414243" }, { "offset": 5, "key": "02", "length": 2, "value": "00ff" } ]

Record 1 starts at offset 0 and contains 41 42 43. Record 2 starts at offset 5 and contains 00 ff.

Limits

  • Type size accepts 0 through 8 bytes. Fixed Length size accepts 1 through 4 bytes.
  • BER mode supports short lengths and up to four subsequent length bytes. It rejects indefinite lengths.
  • BER mode does not parse variable ASN.1 identifiers, nested structures, or end-of-contents markers.
  • The input limit is 65535 bytes and 4096 records. The explanation shows at most 64 field rows.
  • Zero-length values remain valid. Incomplete headers and values cause errors with the affected offset.
  • TLV has no universal type registry or checksum. Your application's specification determines the meaning of each type and value.