Apache Tuweni provides support for manipulating unsigned integers and base Ethereum currencies.

To get started, install the units library.

With Maven:


Or using Gradle:


The units library revolves mainly around the Uint256, Uint384 and Uint64 interfaces.

This tutorial goes over the main uses of Uint256 - you can apply the same behaviors over to Uint384, Uint64 or Uint32.

It will also touch on Wei and Gas.