Try To Calculator logoTry To Calculator

Bitwise Calculator

Last updated: August 12, 202539 people find this calculator helpful
Loading calculator…

The bitwise calculator lets you execute bitwise AND, bitwise OR, and bitwise XOR (exclusive or) operations. This tool allows you to input numbers from the binary, octal, and decimal number systems and presents the result of the bitwise operations in all those numeral systems.

What is a bit? And what is a numeral system?

A bit is the smallest unit of information used in digital communication and electronics. Information is encoded in a logical state, which can only have two different values: 1 or 0. Alternatively, the logic pairs true/false, on/off, or yes/no can be used. Since a single bit can only encode a very limited amount of information, bits are lined up to represent larger amounts of data. For example, one byte is a succession of 8 bits, equaling 2^8 logical states.

Most of us are not used to thinking in terms of bits when talking about numerical information. So let's compare binary numbers made from bits of information to our habitual decimal system:

  • The decimal system, also known as the base-10 system, uses the digits 1 to 9. Every digit of a number corresponds to a power of the base 10. For example, the number 123 can be expressed as 1×10² + 2×10¹ + 3×10⁰ (scientific notation).
  • Binary numbers are based on base 2. So every digit of a number corresponds to a power of 2. For example, the binary number 101 equals 1×2² + 0×2¹ + 1×2⁰, which equals 5 in the decimal system.

The binary converter provides a closer inside into the world of the binary system. It describes the same method used in this application to convert negative numbers from the decimal to the binary system: the signed two's complement representation.

There are other popular numeral systems besides the binary and decimal ones, namely the octal system based on the number 8 and the hexadecimal or 16-base system. You can check out our decimal to octal converter and decimal to hexadecimal converter to learn more about these number systems.

What is a bitwise operator? AND, OR, and XOR.

To use this bitwise operator calculator, we must first understand bitwise operations.

The bitwise calculator performs bitwise AND, OR, and XOR operations.

A bitwise operation is executed on a binary number, which can also be seen as a string of bits. The image displays how it works. We have two input integers in binary format, and the two binary numbers are compared bit by bit, position by position, from the first to the last. The bitwise calculator can perform 3 different bitwise operations: bitwise AND, bitwise OR, and bitwise XOR:

  • Bitwise AND: The corresponding bit of the result is 1 if both input numbers have a 1 on this bit; otherwise, it is 0.
  • Bitwise OR: The corresponding bit of the result is 1 if at least one input number has a 1 on this bit; otherwise, it is 0.
  • Bitwise XOR/exclusive OR: The corresponding bit of the result is 1 if one and only one input number has a 1 on this bit; otherwise, it is 0.

Bitwise operations are the base for numerous real-world applications reaching from data compression and encryption over finite state machines and finding a network address from an IP address and a subnet mask (check: what is a subnet mask?).

How to use the bitwise calculator

This article introduced the concepts of bits and different numeral systems as well as the bitwise operators AND, OR, and XOR. Let us now get to know the bitwise calculator. For example, we want to find the results for a bitwise AND for the numbers 87 and 101, both in the decimal system.

  1. Choose the number of bits in the binary representation. Since 8 bits allow for an input of numbers between -128 and 127 in the decimal system, this is sufficient for our cause.
  2. Choose your input datatype. The bitwise operator calculator supports numbers from the binary, octal, and decimal systems. We choose decimal.
  3. Input your data in fields number 1 and number 2 in the corresponding numeral system. The order of input, for us, 87 and 101, does not matter.
  4. Choose your bitwise operator from the options AND, OR, and XOR. We want the AND operator.
  5. The bitwise calculator presents your result as numbers from the binary, decimal, and octal systems:
    • binary: 0100 0101
    • octal: 105
    • decimal: 69

In case your binary result could be either understood as a negative number in signed notation or a positive number in unsigned notation, both decimal system results are displayed.

That's it; now you know how to handle bitwise operations. And if you are interested in other bit operations, give our bit shift calculator a visit.

FAQs

What does the Bitwise Calculator do?
Use the bitwise calculator to execute bitwise AND, OR, and XOR on inputs from different numeral systems. Use the calculator above for instant results in your browser.
Is the Bitwise Calculator free to use?
Yes. All Try To Calculator tools are free and do not require an account.
Are my inputs stored or sent to a server?
No. Calculations run locally in your browser. We do not collect the numbers you enter or the results shown.
Can I use the Bitwise Calculator for professional decisions?
This tool is for education and quick estimates. For medical, legal, tax, or financial decisions, verify results with a qualified professional.
Where can I find related calculators?
Browse more Math tools on Try To Calculator at /math, or use the related calculators section on this page.

Related calculators