Parse TLV

Converts a Type-Length-Value (TLV) encoded string into a JSON object. Can optionally include a Key / Type entry.

Input: Text (UTF-8) or original file bytesResult: Structured JSON

or drop a file here

Text input

Run to see the result

Examples

Example keys and passwords are public test material.

BER long-form length (one-byte length encoding)

Input

872468764261c782e4be29a4.bin

131 bytes

Download

Expected answer

JSON
[
    {
        "key": [
            1
        ],
        "length": 128,
        "value": [
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66,
            66
        ]
    }
]
Type/Key size
1
Length size
1
Use BER
On
BER long-form length (two-byte length encoding)

Input

e419452a8e47a978bad0fee2.bin

265 bytes

Download

Expected answer

JSON
[
    {
        "key": [
            1
        ],
        "length": 256,
        "value": [
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65,
            65
        ]
    },
    {
        "key": [
            2
        ],
        "length": 3,
        "value": [
            65,
            66,
            67
        ]
    }
]
Type/Key size
1
Length size
1
Use BER
On
BER multiple entries with mixed short and long-form lengths

Input

f4cdf9f2f6a95796b6207846.bin

15 bytes

Download

Expected answer

JSON
[
    {
        "key": [
            1
        ],
        "length": 5,
        "value": [
            72,
            101,
            108,
            108,
            111
        ]
    },
    {
        "key": [
            2
        ],
        "length": 5,
        "value": [
            87,
            111,
            114,
            108,
            100
        ]
    }
]
Type/Key size
1
Length size
1
Use BER
On
KeyLengthValue

Input

c7f4b7886290ab1c01d12eaa.bin

19 bytes

Download

Expected answer

JSON
[
    {
        "key": [
            4
        ],
        "length": 5,
        "value": [
            72,
            111,
            117,
            115,
            101
        ]
    },
    {
        "key": [
            5
        ],
        "length": 4,
        "value": [
            114,
            111,
            111,
            109
        ]
    },
    {
        "key": [
            66
        ],
        "length": 4,
        "value": [
            100,
            111,
            111,
            114
        ]
    }
]
Type/Key size
1
Length size
1
Use BER
Off
KeyLengthValue with BER

Input

c7f4b7886290ab1c01d12eaa.bin

19 bytes

Download

Expected answer

JSON
[
    {
        "key": [
            4
        ],
        "length": 5,
        "value": [
            72,
            111,
            117,
            115,
            101
        ]
    },
    {
        "key": [
            5
        ],
        "length": 4,
        "value": [
            114,
            111,
            111,
            109
        ]
    },
    {
        "key": [
            66
        ],
        "length": 4,
        "value": [
            100,
            111,
            111,
            114
        ]
    }
]
Type/Key size
1
Length size
4
Use BER
On
LengthValue

Input

8d867a134c212469902e955a.bin

16 bytes

Download

Expected answer

JSON
[
    {
        "length": 5,
        "value": [
            72,
            111,
            117,
            115,
            101
        ]
    },
    {
        "length": 4,
        "value": [
            114,
            111,
            111,
            109
        ]
    },
    {
        "length": 4,
        "value": [
            100,
            111,
            111,
            114
        ]
    }
]
Type/Key size
0
Length size
1
Use BER
Off
LengthValue with BER

Input

8d867a134c212469902e955a.bin

16 bytes

Download

Expected answer

JSON
[
    {
        "length": 5,
        "value": [
            72,
            111,
            117,
            115,
            101
        ]
    },
    {
        "length": 4,
        "value": [
            114,
            111,
            111,
            109
        ]
    },
    {
        "length": 4,
        "value": [
            100,
            111,
            111,
            114
        ]
    }
]
Type/Key size
0
Length size
4
Use BER
On

Format reference: Parse TLV background and specification

Related tools

Browse data format tools