How Positional Notation Works
Every base works the same way: each position is worth the base raised to the power of its distance from the right. Only the number of available digits changes, and with it how quickly you run out and have to carry.
Method
From decimal: divide repeatedly, keep remainders
1 hex digit = 4 bits, 1 octal digit = 3 bits
n bits hold values 0 to 2ⁿ − 1
Converting out of decimal is the mirror image: divide by the target base, note the remainder, repeat with the quotient, and read the remainders bottom to top. Converting 255 to hex gives remainder 15 (F) then 15 (F), so the answer is FF.
Why These Particular Bases
Binary, octal, and hexadecimal are not arbitrary choices — each maps cleanly onto the others because 8 and 16 are both powers of 2.
Binary — what the hardware actually stores
Two states map directly onto a voltage being high or low, so every digital circuit works in base 2. Everything else is a human-readable presentation of the same bits.
Hexadecimal — four bits per character
A byte is exactly two hex digits, so memory dumps, colour codes, MAC addresses, and hashes all use it. Reading 0xDEADBEEF is easier than reading its 32 binary digits, and the mapping back to bits is mechanical.
Octal — three bits per character
Largely historical now, but it survives in Unix file permissions, where each of owner, group, and other gets exactly three permission bits. That is why chmod 755 means what it does.
Literal Prefixes in Code
Most languages mark the base of a literal with a prefix: 0b for binary, 0o or a leading 0 for octal, and 0x for hexadecimal. Enter values here without the prefix and set the base explicitly instead.
The bare leading zero for octal in C and older JavaScript is a well-known trap — 0755 is 493 in decimal, not 755 — which is why modern languages require the explicit 0o form. Underscores and spaces used as digit separators are stripped automatically by this converter, so 1111_0000 and FF FF are accepted as written.