Introducing bcal (Byte CALculator): a utility for storage conversions and calculations


bcal is my new utility to deal with regular data storage unit conversions and other storage related calculations. I felt the need of a dedicated tool as an alternative to using a regular calculator for operations like finding an address offser, base conversions, LBA-CHS conversions etc. Though I’ve started with storage related conversions, the scope of bcal isn’t limited. PRs for other domain specific calculations are welcome. The intention is to come up with an engineer’s tool.

bcal doesn’t support negative inputs as all inputs are treated as unsigned. On a 64-bit device bcal supports 64-bit  inputs and 128-bit outputs, thanks to GCC libquadmath.


  • convert to IEC/SI standard data storage units
  • show the address in bytes
  • show address as LBA:OFFSET
  • convert CHS to LBA and vice versa
  • show binary, decimal and hex representation of a number
  • custom sector size, max heads/cylinder and max sectors/track
  • minimal dependencies
  • open source and free (GPLv3)


  • to calculate the offset of 100 GB
  • conversions involving variable sector size
  • find the decimal or hex value of a binary number
  • CHS to LBA calculations


bcal depends of libc and GCC libquadmath. Both are installed by default on Ubuntu. To install bcal, run the following commands:

$ sudo git clone
$ cd bcal
$ make
$ sudo make install


bcal has an elaborate help and extensive man page with examples. The project readme is a great resource too!

Once installed, you can start with:

$ bcal -h

On GitHub: bcal


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

search previous next tag category expand menu location phone mail time cart zoom edit close