Convert between binary and decimal numbers.
Decimal uses ten digits and place values that are powers of ten. Binary uses two digits and place values that are powers of two: 1, 2, 4, 8, 16, 32, 64, 128 and onward.
Reading binary is a matter of adding the place values where a 1 appears. The byte 1011 is 8 + 0 + 2 + 1 = 11. Converting the other way, repeatedly divide by two and read the remainders from bottom to top.
Computers use binary because a transistor has two reliable states โ conducting or not. Distinguishing two voltage levels is robust; distinguishing ten would be far more error-prone.
A bit is one binary digit. Eight bits make a byte, which can represent 256 distinct values โ enough for one character in older encodings.
The persistent confusion is between decimal and binary prefixes. Storage manufacturers use decimal: one gigabyte is 1,000,000,000 bytes. Operating systems have historically used binary: one gibibyte is 1,073,741,824 bytes. That is why a "1 TB" drive shows as roughly 931 GB โ nothing is missing, the two figures simply count differently.
Network speeds add another trap by using bits rather than bytes. A 100 Mbps connection delivers around 12.5 MB per second at best, because there are eight bits in a byte.
Hex uses sixteen digits โ 0 to 9 then A to F. Its value is that one hex digit maps exactly to four binary digits, so a byte is always two hex characters. This makes hex a compact, lossless shorthand for binary, which is why it appears in colour codes, memory addresses, and MAC addresses.
Converting between hex and binary requires no arithmetic at all: substitute each hex digit for its four-bit pattern. Decimal, by contrast, does not align with binary place values, which is why programmers reach for hex constantly and decimal rarely.