Number bases: binary, octal, hex and 255 in four forms
Why 255 is 11111111₂, 377₈ and FF₁₆, how four-bit hex and three-bit octal map to bytes and Unix modes, and where BigInt keeps long values exact.
2026-12-03
Same value, four notations
Place value does the work in every base. In base 10, 255 means 2 × 100 + 5 × 10 + 5. The same integer is 11111111 in base 2, 377 in base 8 and FF in base 16; the subscript is a label for the base, not part of the digits.
Two anchors save a lot of head arithmetic: 0x1F is 31, and 1024 is 0b10000000000 or 0x400. From there, nearby values are mostly nibble counting or a shift by a power of two, which is why 0x400 reads as 1024 bytes long before anyone works out the decimal.
Four bits per hex digit, three per octal
A hex digit covers exactly four bits, so a byte is two hex digits and a 32-bit word is always eight. That alignment is why dumps, colour codes and hash digests are written in hex: the digit boundaries match the byte boundaries, and nothing needs padding arithmetic.
An octal digit covers three bits. It does not align with bytes, but it aligns with permission triples, which is the whole design of Unix modes. The same three-bit grouping is what makes a binary row easy to scan in the Number Base Converter when you are checking a mode by hand.
Unix modes: 755 is not decimal
chmod 755 is octal. It equals decimal 493 and binary 111 101 101. Read as triples: the owner gets 111 (rwx), the group gets 101 (r-x), others get 101 (r-x). That leading 7 is full access, not the digit seven in a decimal number.
The usual file mode 644 is 110 100 100, or decimal 420. A mode such as 4755 adds a setuid bit in front, which is why file managers usually offer checkboxes or a dropdown instead of a free-text field. Mixing octal and decimal widens or narrows access silently, so confirm the base before trusting a value.
Colour codes are packed bytes
A colour like #FF8800 holds three bytes: R = FF = 255, G = 88 = 136, B = 00 = 0. As one 24-bit integer the same colour is 16,746,496. Converting that decimal back to hex restores the channels, and the leading 00 in blue must survive because it is a channel value, not padding.
The 0x prefix is a notation convention, not part of the number. CSS writes #FF8800, C writes 0xFF8800, and some APIs store the decimal. When pasting into the Number Base Converter, drop the # or let auto mode handle 0x; otherwise the parser rejects a character that is not a digit. A Base64 Image pipeline tends to move raw bytes around as hex strings for the same reason: two characters per byte are easy to log and compare.
Big integers, signs and the limits
Parsing uses BigInt, so a 64-bit address or a long decimal ID does not lose its tail past 2^53. Input stops at 4096 digits. A digest from the Hash Generator is a hex string rather than a number to do arithmetic on, but converting it to binary is a quick check of its length and grouping; the tool will not recover the hashed data.
Only whole numbers are accepted; a decimal point or a fraction is refused instead of rounded. Negative input is shown as a minus sign plus the magnitude, so -10 becomes -1010 in binary. Two's complement is deliberately absent because it depends on a width: -1 is 11111111 in 8 bits, but sixteen ones in 16 bits and thirty-two in 32 or 64. Printing one width without asking would be a guess, and a wrong bit pattern is worse than no pattern.
Choose the base, paste, read four rows
Select the input base, or leave auto mode on and let the 0x, 0b and 0o prefixes decide. Prefixes are honoured in auto mode and when they match an explicit base; with no prefix the fallback is decimal. Paste the value, spaces and underscores are ignored, then read binary, octal, decimal and hex together with the bit length and byte string. Every row has its own copy button.
The mistakes are mechanical. Pasting 0x1F while the selector is on decimal fails, because a prefix only changes the reading in auto mode or when the base agrees. A G in a hex field is not a digit, and the parser names the character and the base instead of truncating quietly. Finally, know the scope: 0x0F keeps the low four bits and 0xF0 the high four, but combining them is a bitwise AND or OR, which this tool does not perform; it only changes notation.