Programmer Calculator
Convert between decimal, hexadecimal, binary, and octal number systems with bitwise operations.
Number Systems
Quick Actions
Which base to use when
Decimal (base 10) is how values are usually reported; binary (base 2) shows the exact bit pattern a machine stores; hexadecimal (base 16) compresses four bits into one digit, which is why memory addresses, colour codes and byte dumps are written in hex; octal (base 8) groups three bits and survives mainly in Unix file permissions such as 0755. Every base here describes the same integer — only the notation changes, so 255, 0xFF, 0b11111111 and 0o377 are one value viewed four ways.
Bitwise operations explained
AND keeps a bit only when it is set in both operands and is the standard way to mask fields out of a packed value. OR sets a bit when it is present in either operand, which is how flags are combined. XOR sets a bit when the operands differ, making it useful for toggling and simple checksums. NOT inverts every bit. Left shift (<<) multiplies by two per position and right shift (>>) divides by two, discarding the remainder. Shifts are usually faster than multiplication and are common in hash functions and pixel packing.
Precision and signed values
JavaScript performs bitwise operations on 32-bit signed integers, so results wrap at 2,147,483,647 and negative numbers appear in two’s complement form, where the highest bit carries the sign. Values above 2^53 cannot be represented exactly as ordinary numbers at all. If you are working with 64-bit registers, cryptographic constants or large database identifiers, verify the result against a big-integer implementation before relying on it in production code.
Cite this page
UnitConvertLab. (2026). Programmer Calculator. UnitConvertLab. Retrieved from https://unitconvertlab.com/zh/tools/programmer-calculator