← All calculatorsGeneral & Scientific

Binary Calculator

Converts between binary, octal, decimal and hexadecimal, and performs arithmetic directly in whichever base you choose — with all four representations shown side by side.

Decimal
45
Binary
101101
Octal
55
Hexadecimal
2D

How to use the Binary Calculator

  1. Select the base of the value you are entering.
  2. Type the value using that base's digits.
  3. Choose an operation and a second value, or leave it on convert-only.
  4. Read the result in all four bases at once.

How the calculation works

Positional notation works identically in every base: each digit is multiplied by the base raised to its position index. In binary, 101101 is 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 45. The only thing that changes between bases is how many digit symbols exist before you carry.

Binary is the machine's native base because a transistor has two stable states. Hexadecimal exists purely for human convenience: each hex digit maps to exactly four binary digits, so a 32-bit value collapses to eight readable characters with no arithmetic. Octal groups three bits and survives mostly in Unix file permissions.

Arithmetic follows the same rules as decimal, with carries happening at the base rather than at ten — 1 + 1 in binary is 10. Bit shifting is the fast path for powers of two: shifting left one place doubles a value, shifting right halves it and discards the remainder. Results here are treated as unsigned 32-bit values for the binary, octal and hex rows, so very large or negative results wrap in the way hardware registers do.

Formula
value = Σ dᵢ × baseⁱ ; left shift by n multiplies by 2ⁿ

Source: Positional numeral systems; two's-complement 32-bit integer representation.

Worked example

Reading a subnet mask octet of 11111100 and checking how many hosts it leaves.

  1. Enter 11111100 in binary → decimal 252.
  2. Six leading ones means a /30 boundary within the octet.
  3. Remaining bits: 2, so 2² = 4 addresses.

252 in decimal, FC in hex, and four addresses per block — two of them usable.

Frequently asked questions

Why does hexadecimal use letters?+

Base 16 needs sixteen symbols; A–F cover the values ten to fifteen.

How many bits is one hex digit?+

Exactly four, which is why hex is such a compact way to write binary.

What happens with negative results?+

They are shown as unsigned 32-bit values, the same way a hardware register would represent them.

Is 1 KB 1,000 or 1,024 bytes?+

Both conventions exist. Storage vendors use 1,000; operating systems usually use 1,024 and increasingly label it KiB.

Last reviewed September 1, 2026. We review this page whenever the underlying formula, tax year, published rate or standard changes.

Related

More in General & Scientific