Binary Calculator – Bitwise & Base Conversion Tool
Convert between binary, decimal, octal and hexadecimal, and run arithmetic or bitwise operations — AND, OR, XOR, NOT and bit shifts — with remainders.
Binary
11111111
Octal
377
Hexadecimal
FF
Decimal
255
Last updated: June 2026
How this calculator is verified
Checked by True Calculator automated test suite on
- Formula verified against a published worked example in the automated test suite
- Edge cases (zero, negative, boundary and unit-mismatch inputs) covered by unit tests
The full verification method is on our how we verify page. Found an error? Tell us and we will re-check it.
When to Use This Calculator
Computer science students preparing for exams or interviews often need to convert between decimal, binary, octal and hexadecimal quickly, and to perform arithmetic in base 2. This calculator handles both conversions and binary addition, subtraction, multiplication and division, so you can verify a practice problem in seconds. Network engineers also use binary arithmetic when working out subnet ranges and broadcast addresses. Whether you are studying for a placement test, debugging a bitwise operation in code, or teaching a friend how 255 in decimal becomes 11111111 in binary, this tool gives an instant check against hand calculations.
How to Use This Calculator
- Step 1: Choose the base you are starting from — binary, decimal, octal or hexadecimal — and enter the number in the input field.
- Step 2: Read the number rendered in all four bases at once in conversion mode.
- Step 3: Switch to operations mode, pick a bit width, enter two binary numbers and choose an operation: +, −, ×, ÷, AND, OR, XOR, NOT or a bit shift.
- Step 4: Read the result in binary, octal, hexadecimal and decimal, plus the remainder when dividing.
Worked Example
Add 1010 and 0011 and the tool returns 1101 — decimal 10 plus 3 is 13. Subtract 100110 from 1110011 to get 1001101 (115 − 38 = 77). Multiply 10111 by 11: the result is 1000101, since 23 × 3 = 69. Bitwise checks follow the same masks a CPU uses: 1100 AND 1010 is 1000, 1100 OR 1010 is 1110, and shifting 1010 left twice gives 101000, or 40. Each answer appears in binary, octal, hexadecimal and decimal, which helps when a protocol spec documents values in hex while a script prints decimal.
Tips and Common Mistakes
- •Tip 1: Enter digits valid for the chosen base — 2 and 9 are rejected in octal and binary inputs respectively.
- •Tip 2: Use hexadecimal when reading memory dumps and configs, since one hex digit maps cleanly to four binary bits.
- •Tip 3: Bitwise results are masked to the selected bit width, so NOT 1010 in 8 bits gives 11110101, not a negative signed value.
- ✗Mistake 1: Reading the octal output as decimal — 52 octal is 42 decimal, not 52, so compare values across bases carefully.
- ✗Mistake 2: Forgetting that hex letters are case-insensitive but digits above 9 must be A through F, not 10 through 15.
Frequently Asked Questions
What is binary?
Binary is a base-2 number system using only 0 and 1. It's how computers store and process data.
How do I convert decimal to binary?
Repeatedly divide by 2 and record remainders. Read remainders bottom-to-top for the binary result.
How do I add binary numbers by hand?
Add bit by bit from the right, carrying 1 when a column sums to 2. For example 101 + 011: 1+1 = 0 carry 1, 0+1+1 = 0 carry 1, 1+0+1 = 0 carry 1, giving 1000, which is 8 in decimal.
Why is binary used in computers?
Computers store everything as two states — voltage on or off — which maps perfectly to 0 and 1. All data, from numbers to images to text, is represented as binary underneath.
How do I convert decimal to binary quickly?
Divide by 2 repeatedly and read the remainders from bottom to top. For 42: 42÷2=21r0, 21÷2=10r1, 10÷2=5r0, 5÷2=2r1, 2÷2=1r0, 1÷2=0r1 → 101010.
You might also need
Related calculators from other categories
Math
Decimal to Fraction Calculator
Convert a decimal into its simplest fraction form, such as 0.75 to 3/4 — perfect for school maths and carpentry.
Math
Decimal to Percent Calculator
Convert a decimal to a percentage instantly, for example 0.25 to 25% — handy for marks, GST and discounts.
Math
Fraction to Decimal Calculator
Convert any fraction to a decimal by dividing numerator by denominator — get terminating or repeating decimals.
Math
Percent to Decimal Calculator
Convert a percentage to a decimal, such as 25% to 0.25 — the quick step behind interest and discount sums.