Convert numbers between binary, octal, decimal, and hexadecimal instantly.
Input base
—
—
—
—
Computers store data in binary (base 2) because transistors have two states: on/off. Hexadecimal (base 16) is used by programmers as a compact representation of binary, where each hex digit represents exactly 4 bits. Decimal (base 10) is what humans naturally use.
Only uses 0 and 1. Each digit position represents a power of 2. The binary number 1010 = (1×8) + (0×4) + (1×2) + (0×1) = 10 in decimal. Used in all digital computing at the hardware level.
Uses digits 0–7. Each octal digit represents 3 binary bits. File permissions in Unix/Linux use octal. For example, 755 means the owner can read/write/execute (7=111), group and others can read/execute (5=101).
Uses 0–9 and A–F (where A=10, B=11, C=12, D=13, E=14, F=15). Colors in web design are hex: #FF5733 means Red=255, Green=87, Blue=51. Memory addresses are typically shown in hex.
To convert decimal to binary: repeatedly divide by 2 and note the remainders. Read remainders bottom-to-top. For example, 13 ÷ 2 = 6 R1, 6 ÷ 2 = 3 R0, 3 ÷ 2 = 1 R1, 1 ÷ 2 = 0 R1 → binary is 1101.
Negative numbers in binary use two's complement notation. To negate a number: flip all bits, then add 1. For example, +5 in 8-bit is 00000101; -5 is 11111010 + 1 = 11111011. This makes addition circuits simpler for hardware.
Convert numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Type in any field and all other bases update instantly.
Decimal 255
Binary: 11111111 | Octal: 377 | Hex: FF
Hex FF
Decimal: 255 | Binary: 11111111 | Octal: 377
Binary 1010
Decimal: 10 | Octal: 12 | Hex: A
Decimal 16
Binary: 10000 | Octal: 20 | Hex: 10
Convert decimal 42 to binary
Decimal 42 = Binary 101010
Convert hex 1F to decimal
Hex 1F = Decimal 31
Binary is the native language of computers because transistors have exactly two stable states: on and off. Hexadecimal became popular with programmers because it compactly represents binary data — each hex digit maps exactly to 4 binary bits, making it easy to read memory addresses, colour codes, and byte values at a glance.
Common bases include binary (2), octal (8), decimal (10), and hexadecimal (16), with digits chosen according to the selected base. Decimal uses 0–9; hexadecimal adds A–F. Enter a value that is valid for the source base, because a digit such as 8 cannot be part of a binary or octal number.
Binary is natural for digital logic, octal appears in some permissions and legacy notation, decimal is used for everyday quantities, and hexadecimal is compact for bytes, colours, memory addresses, and debugging. Converting the representation does not change the underlying quantity; it only changes how the same value is written.
Hexadecimal place values are powers of 16, and A through F represent 10 through 15. A prefix such as 0x is a programming convention rather than part of the numeric value in every context. Keep leading zeroes when the value represents a fixed-width byte, colour channel, address, or protocol field.
A negative value has a sign, but software may represent its magnitude or use a fixed-width two’s-complement bit pattern. Those interpretations can produce different-looking binary or hexadecimal output. Confirm the target field width and signedness before copying a converted negative value into code or a protocol.