Next-Gen App & Browser
Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles
This free tool performs bitwise operations on binary, octal, decimal, and hexadecimal numbers instantly and provides real-time results. It is ideal for developers, students, and engineers.
Calculate
Binary Result
Decimal Result
Octal Result
Hex Result
Bitwise operations work by directly manipulating the individual bits of a number, and they're crucial in areas like low-level programming, encryption, and making algorithms more efficient. Some common operations include AND (&), OR (|), XOR (^), NOT (~), Left Shift (<<), and Right Shift (>>).
In binary arithmetic, this operation adds two numbers bit by bit, carrying over any excess to the next column, just like decimal addition but using only 0s and 1s. For example, 5 (101) + 3 (011) = 8 (1000).
When subtracting the second number from the first, binary arithmetic borrows from higher bits when necessary, much like decimal subtraction, but in base-2. For example, 5 (101) - 3 (011) = 2 (010).
To multiply two numbers in binary, shifted versions of the first number are added based on the 1s in the second number. For example, 5 (101) × 3 (011) = 15 (1111).
Dividing the first number by the second provides both the quotient and remainder in binary form, using repeated subtraction and shifting at the binary level. For example, 5 (101) / 2 (010) = 2 (010) remainder 1.
Raising the first number to the power of the second involves repeated multiplication in binary. For example, 5 (101) ^ 2 results in 5 × 5 = 25 (11001) in binary.
When performing bitwise AND, corresponding bits of two numbers are compared, outputting 1 only when both input bits are 1. It’s akin to two switches that must both be on for the light to work. For example, 5 (101) & 3 (011) = 1 (001), as only the rightmost bit is 1 in both numbers.
The bitwise OR returns 1 if at least one of the compared bits is 1, similar to two switches where either one can turn the light on. For instance, 5 (101) | 3 (011) = 7 (111), as each position has at least one 1 between the two numbers.
This exclusive OR operation outputs 1 only when exactly one of the compared bits is 1, but not when both are 1 or both are 0. It's like a "different detector" - if the bits are different, you get a 1. For example, 5 (101) ^ 3 (011) = 6 (110).
This unary operation inverts all bits, changing each 0 to 1 and each 1 to 0, making it like a photographic negative of the binary number. For example, ~5 (00000101) becomes (11111010) in 8-bit representation, which equals -6 in decimal.
Shifting all bits to the left by a specified number of positions fills the right side with zeros, effectively multiplying the number by 2 for each position shifted. For example, 5 (101) << 1 becomes 10 (1010), similar to multiplying 5 by 2.
When bits are shifted to the right by a specified number of positions, the number is effectively divided by 2 for each position shifted, rounding down for positive numbers. For example, 5 (101) >> 1 becomes 2 (10), which is like dividing 5 by 2 and rounding down.
Bitwise operations are widely used in various fields, including:
A tool that performs bitwise operations on binary, octal, decimal, and hexadecimal numbers.
Yes, the calculator converts decimal inputs and processes them accordingly.
They optimize algorithms, aid in encryption, and manage binary data efficiently.
Yes, it supports AND, OR, XOR, NOT, left shift, and right shift operations.
Yes, it’s completely free with no hidden charges.
No, it works directly in your web browser.
Did you find this page helpful?