Hexadecimal & Bitwise Calculator NZ

This calculator performs bitwise operations on two whole numbers and shows the result in decimal, hexadecimal, binary and octal at once, so you can work fluently across the number bases that programmers use every day. Computers store everything as bits, and bitwise operations act on those bits directly, which makes them fast and indispensable for low-level work: setting and clearing flags, building bitmasks, packing several small values into one number, manipulating colours and pixels, and handling permissions and hardware registers. The core operations are AND, which keeps only the bits set in both numbers; OR, which sets a bit if it is in either; XOR, the exclusive or, which sets a bit where the two differ; and NOT, which flips every bit of a single number. The two shift operations slide the bits left or right, which is the quick way to multiply or divide by powers of two. You enter your two values, in plain decimal or in hexadecimal with a leading 0x, choose the operation, and the calculator shows the answer in all four bases together with the conversions you need. Seeing decimal, hex, binary and octal side by side is the fastest way to understand what an operation actually did to the bits. Use it to debug a bitmask, to check a hex value, to learn how the operations behave, or to convert a number between bases on the fly. The hexadecimal and binary outputs are shown as unsigned 32-bit values, the usual convention for bitwise work, while the decimal result keeps its sign so a NOT result reads naturally.

Calculate.co.nz is proud to be partnered with Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner: Health Based Building
Advertise on this page
12
result (decimal)
Hexadecimal0xC
Binary1100
Octal014

Accepts decimal or 0x-prefixed hex. NOT and shifts use Value A. Hex, binary and octal show the unsigned 32-bit form. Decimal keeps its sign.

How it works

Each value is read as a whole number, in decimal or hexadecimal. The chosen operation acts on the binary bits: AND, OR and XOR combine the two numbers bit by bit, NOT flips every bit of A, and the shifts move A's bits left or right by B places. The result is then converted to decimal, hexadecimal, binary and octal.

Worked example

With A = 60 (binary 111100) and B = 13 (binary 001101), the AND operation keeps only the bits set in both, giving 001100, which is 12 in decimal, 0xC in hexadecimal, 1100 in binary and 014 in octal. Choosing XOR instead would give 49, the bits where the two numbers differ.

Related calculators