Ambimat GroupAmbimatAmbiSecureSIMAuthAmbiAutomationEngineering BlogAhmedabad · India · Est. 1981
Developer utility

Binary Calculator

Convert between binary, decimal, hex, and octal, then run bitwise AND, OR, XOR, NOT and shifts at a chosen 8/16/32/64-bit width — with signed/unsigned and two’s-complement views. BigInt-backed so 64-bit math stays exact.

Client-sideBigInt8/16/32/64-bit

Base converter

Enter a value to see all bases.

Bitwise operation

Choose an operation and enter operands.
All parsing, base conversion, and bitwise math run locally in your browser using JavaScript BigInt. Nothing is uploaded — safe for register dumps and key material.

What this calculator does

This is a binary calculator built for embedded and security engineers who spend their days staring at registers, status words, and bit-packed flags. The left panel is a live base converter: type a value once and read it back in binary, decimal, hexadecimal, and octal at the same time. The right panel runs the bitwise operations you reach for when masking flags or assembling protocol fields — AND, OR, XOR, NOT, and the three shifts (left, logical right, arithmetic right). Both panels share the same notion of operand width and signedness, so the bit pattern you convert is the bit pattern you operate on.

Everything is computed with JavaScript BigInt and then masked to the selected width. That matters more than it sounds: the native JavaScript bitwise operators silently coerce their inputs to signed 32-bit integers, so a 64-bit mask, a 40-bit APDU field, or any value past 2147483647 comes out wrong. Using BigInt and an explicit width mask keeps 8, 16, 32, and 64-bit results exact and lets the signed view show genuine two’s-complement values.

When to use it

Reach for it whenever a value crosses a representation boundary. Decoding a smart-card status word and need to see 0x9000 as bits? Building an ISO 7816 class byte or an EMV tag bitmap one flag at a time? Checking that a left shift wraps the way the silicon will at 8 bits? Confirming that 0xFF is −1 when a field is signed? Each of those is a few keystrokes here. It also pairs naturally with byte-order work: convert a value, then take the hex into the endian converter to swap byte order, or into hex bytes to view it as a byte sequence.

Input and output

In the base converter, choose which base your typed value is in and the tool parses it accordingly; you can also paste with a 0x, 0b, or 0o prefix and it will infer the base. The output shows all four bases plus a nibble-grouped binary view (four bits per group) so long patterns stay readable. In the bitwise panel, operands A and B are read in the selected operand base; for NOT only operand A is used, and for shifts operand B is the shift amount. Results are masked to the active width and reported in binary, hex, decimal (both unsigned and signed two’s-complement), and octal. If a value does not fit the width, the high bits are dropped and the tool flags the truncation rather than hiding it.

Common mistakes

Related tools

Endian converter

Swap byte order on the hex you produce here.

Open endian →

Hex ↔ bytes

View a converted value as a sequence of bytes.

Open hex bytes →

More utilities

Parsers, decoders, and references for smart-card and FIDO engineers.

All resources →