
Binary Hex and Octal Conversions by Hand in Under 30 Seconds
You do not need a calculator for base conversions. With one simple grouping trick binary to hex becomes a mental math exercise. Every four binary digits map to exactly one hex digit. Every three binary digits map to one octal digit. The grouping trick Binary to hex: group into fours from the right. Binary to octal: group into threes from the right. Binary: 11010110 To hex: 1101 0110 → D6 To octal: 11 010 110 → 326 Pad the leftmost group with zeros if needed: Binary: 10110 To hex: 0001 0110 → 16 To octal: 010 110 → 26 Why octal still exists Octal (base 8) seems obsolete but appears in two important contexts: Unix file permissions. chmod 755 uses three octal digits, each representing read (4), write (2), and execute (1) for owner, group, and others. The octal representation maps directly to three binary bits per digit: 7 = 111 (rwx), 5 = 101 (r-x). C/JavaScript octal literals. A leading zero in some languages means octal: 0755 in C is 493 in decimal, not 755. In JavaScript strict mode, o
Continue reading on Dev.to Tutorial
Opens in a new tab



