Skip to content
BER-TLV parser and builder
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Update maven.yml Sep 10, 2019
concourse Added concourse pipeline for testing against java 8 and 7 May 15, 2017
src #10 Fixed Last tag from a hex string is sometimes missing after parsing Sep 10, 2019
.travis.yml Update .travis.yml Sep 10, 2019
LICENSE.txt Added a LICENSE May 12, 2017 Added circleci badge Nov 5, 2018
mvnw.cmd Added maven wrapper Nov 5, 2018
pom.xml [maven-release-plugin] prepare for next development iteration Sep 10, 2019

maven Build Status CircleCI

BER-TLV parser and builder

BerTlv is a java library for parsing and building BER TLV encoded data.


  • supported types: amount, date, time, text, BCD, bytes
  • thread safe (provides immutable container BerTlv)
  • production ready (uses in several projects)
  • lightweight (no external dependencies)

Setup with dependency managers




compile 'com.payneteasy:ber-tlv:$VERSION'

How to parse

byte[] bytes = HexUtil.parseHex("50045649534157131000023100000033D44122011003400000481F");

BerTlvParser parser = new BerTlvParser(LOG);
BerTlvs tlvs = parser.parse(bytes, 0, bytes.length);
BerTlvLogger.log("    ", tlvs, LOG);

How to build

byte[] bytes =  new BerTlvBuilder()
                .addHex(new BerTag(0x50), "56495341")
                .addHex(new BerTag(0x57), "1000023100000033D44122011003400000481F")


The BerTlv framework is licensed under the Apache License 2.0

You can’t perform that action at this time.