Instantly convert between decimal, binary, octal and hexadecimal number systems with two's complement support.
Valid range (signed): -128 to 127
A binary converter translates numbers between the positional number systems that computers use internally. The four most common bases are decimal (base-10), binary (base-2), octal (base-8) and hexadecimal (base-16). Mastering these conversions is a core skill for anyone studying computer science, cybersecurity or embedded systems.
At the hardware level, every piece of data — whether a text character, an image pixel or a network packet — is stored and processed as groups of binary digits (bits). This converter lets you explore those representations interactively.
The value of a number in any positional system equals the sum of each digit multiplied by the base raised to the power of its column position, starting from zero on the right.
Two's complement encodes negative integers by inverting all bits and adding 1. This elegant trick keeps addition and subtraction using the same logic gates, which is why virtually every modern CPU uses it.
The space character (ASCII 32) is 0010 0000 in 8-bit binary and 0x20 in hex. Many text-processing algorithms scan for this value to tokenize words or parse CSV files.
The US-common private network 192.168.1.1 has its last octet (1) as 0000 0001 in binary. Subnet masks like 255.255.255.0 are 1111 1111 1111 1111 1111 1111 0000 0000 in 32-bit binary.
The NYC area code 212 is 1101 0100 in 8-bit binary and 0xD4 in hex. Understanding binary helps decode legacy telecommunications protocols that packed fields at the bit level.
The red channel value 255 is 1111 1111 in 8-bit binary and FF in hex. Web designers, game developers and UI engineers work with these hex color codes daily.
Type or paste a number in any of the four fields — decimal, binary, octal or hexadecimal.
Select the appropriate bit width for your context (8-bit for a byte, 32-bit for a standard int).
The tool parses the input and validates it against the selected base and signed range.
The decimal equivalent is computed and then re-expressed in all other bases in real time.
Negative decimals are displayed in two's complement binary for the chosen bit width, with matching octal and hex values.
Transistors have two stable voltage states — high and low — which map naturally to 1 and 0. Using decimal would require ten distinct voltage levels per digit, making circuits far more complex and error-prone.
Two's complement encodes negative integers: invert all bits, then add 1. It allows CPUs to use the same adder circuit for both addition and subtraction, simplifying hardware design significantly.
Split the binary number into groups of four bits from the right, padding with leading zeros if needed. Each 4-bit group maps to one hex digit: 0000=0, …, 1010=A, 1111=F.
Unsigned treats all bits as positive magnitude (0 to 2ⁿ−1). Signed two's complement reserves the most significant bit to indicate sign, yielding a range of −2ⁿ⁻¹ to 2ⁿ⁻¹−1.
Hex is compact: one byte is always two hex digits. Memory addresses, color codes, bitfields, and network masks are all conventionally written in hex for readability.
Bit width (e.g. 8, 16, 32) determines the valid signed range and the two's complement representation. An 8-bit signed integer ranges from −128 to 127; a 32-bit one ranges from −2,147,483,648 to 2,147,483,647.