Home

TLVencoded

TLV encoding stands for Tag-Length-Value, a data encoding method in which each data element is encoded as a triplet: a tag that identifies the data type, a length that specifies the size of the value, and a value that contains the data bytes. The method is commonly referred to as TLV encoding or TLV-encoded data.

The tag conveys information about the element's type and encoding rules. It may specify a class (universal,

TLV is used in many standards and applications, notably ASN.1 BER/DER encodings, ISO 7816 smart cards, NFC

A simple example is a universal, primitive integer tag 0x02 with length 0x01 and value 0x05, representing

application,
context-specific,
private)
and
indicate
whether
the
element
is
primitive
or
constructed,
and
it
may
also
carry
a
tag
number
that
further
identifies
the
item.
The
length
field
encodes
how
many
octets
follow
in
the
value.
Length
can
be
encoded
in
a
short
form
for
small
values
or
a
long
form
for
larger
ones;
some
protocols
also
allow
an
indefinite
form
for
streaming
data.
data
formats
such
as
NDEF,
and
various
cryptographic
structures.
This
encoding
supports
nested
data
by
allowing
a
value
to
itself
contain
TLV-encoded
data.
the
number
5.
Another
example
is
0x16
(IA5String)
with
length
0x04
and
value
"test".
The
flexibility
and
self-describing
nature
of
TLV
encoding
make
it
a
common
choice
for
data
interchange
and
storage
across
diverse
domains.