Binary to Decimal Conversion
Binary (base 2) uses only digits 0 and 1. To convert to decimal, multiply each bit by 2 raised to its position power and sum the results.
Example: 10110 = 16+4+2 = 22.
Binary is the fundamental language of computers, encoding every piece of data as sequences of 0s and 1s. This calculator handles two essential tasks: base conversion (binary, decimal, hex, octal with ASCII display) and binary arithmetic (addition, subtraction, multiplication, division, plus bitwise AND, OR, XOR, and NOT). It supports unsigned integers and two's complement signed representation in 8, 16, and 32-bit widths, and shows carry-bit details for addition so you can follow each step of the computation.
Select Conversion to translate between number bases, or Arithmetic to perform binary operations.
Type a number and select its base (binary, decimal, hex, or octal).
See the converted value in all bases, or the arithmetic result with step-by-step binary working.
To convert binary to decimal, multiply each bit by 2 raised to its position and sum the results. For example, 1011 = 1x8 + 0x4 + 1x2 + 1x1 = 11.
Value = sum(digit * base^position)
Each hex digit maps to exactly 4 binary bits, making hex-to-binary conversion straightforward
Two's complement flips all bits and adds 1 to represent negative numbers
Binary addition follows the same column rules as decimal: 1+1 = 10 (carry the 1)
Use bit widths (8/16/32) to see how numbers are stored in actual computer memory
AND, OR, XOR operate bit-by-bit and are fundamental to digital logic design
Convert numbers between binary, decimal, hexadecimal, and octal instantly. Perform binary addition, subtraction, multiplication, division, and bitwise operations with full step-by-step explanations. Supports unsigned and two's complement signed representation in 8, 16, and 32-bit widths.
Binary (base 2) uses only digits 0 and 1. To convert to decimal, multiply each bit by 2 raised to its position power and sum the results.
Example: 10110 = 16+4+2 = 22.
Binary addition, subtraction, multiplication, and division follow the same principles as decimal arithmetic but with only two digits.
This calculator shows carries, borrows, and partial products step by step.
Bitwise AND, OR, XOR, and NOT operate on individual bits and are fundamental to computing.
Two's complement representation allows negative numbers in binary, with the most significant bit indicating the sign.
To convert a decimal number to binary, repeatedly divide it by 2 and record each remainder, then read the remainders from bottom to top.
For example, 22 becomes: 22/2=11 R0, 11/2=5 R1, 5/2=2 R1, 2/2=1 R0, 1/2=0 R1, giving 10110.
Binary is the base-2 positional system defined in international standard ISO/IEC/IEEE 60559 and ISO 80000-1, where each position represents a power of 2.
Because computers store all data as two-state signals, base-2 is the natural encoding, and this remainder method reliably converts any non-negative integer into its binary form.
To convert binary to hexadecimal, group the bits into sets of 4 from the right and map each group to one hex digit (0000=0 through 1111=F); for octal, group into sets of 3 (000=0 through 111=7).
For example, binary 11111111 = FF in hex and 377 in octal.
This works because 16 = 2^4 and 8 = 2^3, so each hex digit encodes exactly 4 bits and each octal digit exactly 3 bits.
The hexadecimal and octal notations are standardized in ISO/IEC 9899 (the C language standard), making them compact shorthands widely used by programmers to read long binary strings.
To find the two's complement of a binary number, invert every bit (one's complement) and then add 1.
For example, in 8 bits, +5 is 00000101, so -5 is 11111010 + 1 = 11111011.
Two's complement is the standard signed-integer representation described in ISO/IEC 9899 and used by virtually every modern processor because addition and subtraction work identically for signed and unsigned values.
The value range depends on the bit width:
The most significant bit acts as the sign bit.
Computers use binary because electronic circuits reliably distinguish just two states, on and off, mapped to 1 and 0.
This two-level signaling tolerates noise far better than trying to hold ten distinct voltage levels for decimal, so binary underpins the digital logic and memory described in IEEE and ISO/IEC computing standards. Every character, image, and instruction is ultimately stored as bits.
The International Electrotechnical Commission (IEC 80000-13) formalizes the bit as the fundamental unit of information and the byte as 8 bits, which is why data sizes and memory addresses are expressed in powers of 2 throughout computer architecture.
One byte equals 8 bits, and data sizes use two different prefix systems.
Binary prefixes defined by IEC 80000-13 use powers of 1024:
Decimal SI prefixes from BIPM use powers of 1000:
This distinction explains why a drive labeled 1 TB (10^12 bytes) shows as roughly 0.909 TiB in operating systems that count in powers of 1024. Using KiB/MiB avoids this ambiguity, which is why the IEC introduced the binary prefixes.
Binary powers nearly every digital technology:
Understanding binary conversion and arithmetic helps programmers, network engineers, and hardware designers reason about how data is actually represented and manipulated.
Binary addition follows four rules, column by column from right to left:
For example, 1011 + 1101 = 11000, matching 11 + 13 = 24 in decimal.
Subtraction uses borrowing, where 0-1 borrows from the next column to make 10-1=1. In practice, most computers subtract by adding the two's complement, which avoids a separate borrow circuit.
This calculator displays each carry and borrow bit so you can verify the arithmetic step by step.
Several errors trip people up when working with binary:
Data sourced from trusted institutions
All formulas verified against official standards.