Convert between binary, decimal, hexadecimal, and octal number systems. Perfect for programming, computer science, and digital electronics.
Number systems are different ways of representing quantities. Each system uses a different base, which determines how many unique digits are available before you need to carry over to the next position.
Divide the decimal number by 2 repeatedly, keeping track of remainders. Read the remainders from bottom to top. Example: 42 ÷ 2 = 21 R0, 21 ÷ 2 = 10 R1, 10 ÷ 2 = 5 R0, 5 ÷ 2 = 2 R1, 2 ÷ 2 = 1 R0, 1 ÷ 2 = 0 R1. Reading bottom-up: 101010 (binary).
Multiply each bit by 2 raised to its position power (starting from 0 on the right) and sum the results. Example: 101010 = (1×32) + (0×16) + (1×8) + (0×4) + (1×2) + (0×1) = 32 + 8 + 2 = 42.
Hexadecimal is widely used in programming and computer science: memory addresses, color codes (like #FF5733), MAC addresses, error codes, and representing binary data in a compact, readable format. Four binary bits equal one hex digit, making conversion easy.
Computers use binary because digital circuits have two stable states: high voltage (1) and low voltage (0), or on and off. This makes binary perfect for representing data electronically. It's more reliable than trying to distinguish between many voltage levels, and simpler circuitry means faster, cheaper computers.
Each hex digit represents exactly 4 binary bits. Convert each hex digit separately: 0=0000, 1=0001, 2=0010, through F=1111. Example: 2A in hex = 0010 1010 in binary. To convert binary to hex, group bits into sets of four from right to left, then convert each group.
Octal (base 8) is commonly used in Unix/Linux file permissions (like chmod 755) and was popular in early computing. Each octal digit represents exactly 3 binary bits. While less common than hex today, it's still useful for certain applications where grouping by 3 bits makes sense.
This calculator works with positive integers (unsigned numbers). For negative numbers, computers use two's complement representation, which requires a fixed bit width (like 8-bit or 32-bit). The process involves flipping all bits and adding 1, which is beyond this basic converter's scope.
The number of bits needed is the ceiling of log₂(number + 1). For example, numbers 0-255 need 8 bits, 0-65535 need 16 bits, 0-4294967295 need 32 bits. Our calculator shows you exactly how many bits your binary representation uses.
“Perfect for my computer science homework! The visual bit representation helped me finally understand binary conversions. Great for learning!”
“Use this daily for embedded programming. Converting between hex and binary is instant and accurate. The export feature is handy for documentation!”
“Excellent teaching tool! My students love seeing the visual representation of how different number systems relate to each other. Bookmarked!”