Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Command-Line Apps
  3. bcal

bcal

GPL-3.0Cv2.5

A REPL CLI calculator for storage expression evaluation, SI/IEC conversion, byte address calculation, and general-purpose arithmetic.

GitHubGitHub
691 stars41 forks0 contributors

What is bcal?

bcal is a command-line calculator specifically designed for storage-related calculations, including evaluating expressions with units like GiB and MiB, converting between SI and IEC binary prefixes, calculating byte addresses, and performing LBA/CHS conversions. It solves the problem of manual computation for developers and engineers working with storage, memory, and low-level data structures.

Target Audience

System engineers, firmware developers, and low-level programmers who need to perform precise calculations involving storage capacities, addresses, and binary/hexadecimal conversions in their workflow.

Value Proposition

Developers choose bcal for its focused feature set on storage calculations, minimal dependencies, and REPL interface that simplifies complex conversions and expressions without needing external tools or manual math.

Overview

:1234: Bits, bytes and general-purpose calculator

Use Cases

Best For

  • Evaluating arithmetic expressions with storage units (e.g., '(2GiB * 2) / (2KiB >> 2)')
  • Converting storage capacities between SI (kB, MB) and IEC (KiB, MiB) standards
  • Calculating LBA from CHS and vice versa for disk geometry
  • Converting numbers between binary, decimal, and hexadecimal bases
  • Performing bitwise operations and general-purpose arithmetic in a CLI
  • Analyzing bit positions and values for debugging or low-level programming

Not Ideal For

  • Scenarios requiring precise calculations with fractional bytes, as bcal floors non-integer byte values.
  • Teams working on 32-bit or legacy systems, since bcal only supports 64-bit operating systems.
  • Users who need graphical interfaces or web-based tools for storage calculations.
  • Projects requiring advanced mathematical functions beyond basic arithmetic and storage-specific operations, like complex scientific computing.

Pros & Cons

Pros

Minimal Dependency Footprint

bcal can be built without external dependencies using O_NORL=1, making it lightweight and easy to deploy in constrained environments, as described in the installation section with options like static builds.

Storage-Specific Precision

It accurately handles SI and IEC binary prefixes, unit conversions, and LBA/CHS calculations, essential for system engineers, with features like custom sector size configuration and address formatting.

Flexible REPL Interface

The tool offers both REPL and single-execution modes, enabling interactive calculations and scripting with piped input or file redirection, as shown in the examples with commands like 'bcal -b'.

Comprehensive Unit Support

Supports a wide range of storage units from bytes to terabytes in both SI and IEC standards, allowing seamless conversions, with case-insensitive units and hex/decimal inputs as per the operational notes.

Cons

64-bit System Restriction

bcal explicitly only supports 64-bit operating systems, excluding it from use on older or embedded 32-bit platforms, which limits its compatibility for legacy hardware projects.

No Fractional Byte Handling

The tool does not support fractional bytes and shows floor values for non-integer calculations, as stated in the README, which can lead to inaccuracies in precise storage allocations.

Complex Build Configuration

Building from source requires handling make options like O_NORL or O_EL and dependencies such as readline, which might be challenging for less technical users, as detailed in the installation steps.

Limited Mathematical Scope

While it includes general-purpose operations, bcal is primarily focused on storage calculations, so it may not suffice for complex scientific or financial computations beyond its built-in functions.

Frequently Asked Questions

Quick Stats

Stars691
Forks41
Contributors0
Open Issues0
Last commit1 month ago
CreatedSince 2016

Tags

#mathematics#calculator#unit-conversion#storage#terminal#c-program#repl#standalone#cli-tool#expression-evaluator#console#command-line

Built With

m
musl-libc
G
GNU Readline
C
C++

Included in

Shell36.8kCommand-Line Apps19.2kTerminals Are Sexy12.9k
Auto-fetched 1 day ago

Related Projects

fzffzf

:cherry_blossom: A command-line fuzzy finder

Stars80,450
Forks2,802
Last commit1 day ago
ripgrepripgrep

ripgrep recursively searches directories for a regex pattern while respecting your gitignore

Stars64,071
Forks2,568
Last commit2 months ago
tldrtldr

Collaborative cheatsheets for console commands 📚.

Stars62,618
Forks5,250
Last commit2 days ago
zoxidezoxide

A smarter cd command. Supports all major shells.

Stars36,820
Forks824
Last commit2 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub