Back to Blog
Conversion Tools

Binary, Decimal, and Hex Conversion: A Developer's Quick Reference

2025-11-25 5 min read

Computers speak binary, humans use decimal, and developers often work in hex. Learn how to convert between all three number systems with formulas and examples.

Computers think in binary; humans think in decimal; developers often work in hexadecimal. Understanding how to convert between these number systems is a fundamental computer science skill that comes up in networking, debugging, and low-level programming.

Decimal (Base 10)

The number system we use daily. 10 symbols: 0โ€“9. Each position represents a power of 10. The number 347 = 3ร—10ยฒ + 4ร—10ยน + 7ร—10โฐ = 300 + 40 + 7.

Binary (Base 2)

Only 2 symbols: 0 and 1. Each position is a power of 2. Binary 1010 = 1ร—2ยณ + 0ร—2ยฒ + 1ร—2ยน + 0ร—2โฐ = 8 + 0 + 2 + 0 = decimal 10.

Decimal to Binary: Divide by 2, record remainders, read in reverse.

13 รท 2 = 6 remainder 1
 6 รท 2 = 3 remainder 0
 3 รท 2 = 1 remainder 1
 1 รท 2 = 0 remainder 1
Reading remainders bottom to top: 1101 (= 13 in decimal) โœ“

Hexadecimal (Base 16)

16 symbols: 0โ€“9 and Aโ€“F (A=10, B=11, C=12, D=13, E=14, F=15). Each hex digit represents exactly 4 binary digits (a nibble). This makes hex a compact human-readable representation of binary.

  • 0xFF = 255 (11111111 in binary)
  • 0x1A = 26 (1ร—16 + 10 = 26)
  • 0xFF5733 = RGB color (red=255, green=87, blue=51)

Where You See Each System

  • Binary: File permissions (755 = rwxr-xr-x), bitwise operations, network masks
  • Hex: Color codes, memory addresses, MAC addresses, hash values, Unicode code points
  • Octal (base 8): Unix file permissions (chmod 755)

Convert between number systems with our Number Base Converter.

binary decimal hexadecimal conversion developer

More Articles