NUMBER SYSTEM CONVERTER

Precise conversions between Binary, Decimal, Hexadecimal, Octal & More

Convert Number Systems

[↕ Swap Bases]

Quick Reference Table

Decimal Binary Octal Hexadecimal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010
321000004020
64100000010040
1281000000020080
25511111111377FF

Powers of Two Reference

Power Decimal Value Binary Significance
2^011One bit
2^1210-
2^24100-
2^381000One byte (8 bits)
2^41610000Nibble/Hex digit
2^8256100000000One byte max value
2^101,02410000000000Kilo (KB)
2^1665,536-16-bit integer max
2^201,048,576-Mega (MB)
2^324,294,967,296-32-bit max

Understanding Number Systems

Binary (Base 2)

Definition: A number system using only two digits: 0 and 1. Each digit is called a "bit" (binary digit). The foundation of all digital computing.

History: Ancient Indian mathematician Pingala described binary in 200 BCE. Gottfried Leibniz formalized binary arithmetic in 1679. George Boole developed Boolean algebra (1847). Claude Shannon applied it to electrical circuits (1937), enabling modern computing.

Current Use: Fundamental to all digital electronics and computers. Processors execute binary instructions. Data stored as sequences of 1s and 0s. Network communication uses binary. Programming at machine level is binary. Digital signals are binary (on/off, high/low voltage).

Decimal (Base 10)

Definition: The standard number system using ten digits: 0-9. Each position represents a power of 10. Called "decimal" from Latin "decem" meaning ten.

History: Developed independently in India (around 500 CE) and transmitted to Europe through Arabic scholars (hence "Arabic numerals"). Replaced Roman numerals in Europe by 1500s. The positional decimal system revolutionized mathematics and commerce.

Current Use: Universal human counting system. All everyday mathematics, commerce, science communication. Programming languages accept decimal input. Though computers use binary internally, humans interact in decimal. Essential for human-computer interface design.

Hexadecimal (Base 16)

Definition: A number system using sixteen symbols: 0-9 and A-F (where A=10, B=11, C=12, D=13, E=14, F=15). Compact representation of binary.

History: Independently suggested by Swedish king Charles XII (early 1700s) and formalized in computing during 1960s. IBM popularized hex for representing machine code and memory addresses. Became standard in programming.

Current Use: Essential in computer programming and digital systems. Memory addresses written in hex. Color codes in web design (#FFFFFF for white). Assembly language programming. MAC addresses. IPv6 addresses. Debugging and low-level programming. One hex digit = 4 bits (nibble), making binary-hex conversion simple.

Octal (Base 8)

Definition: A number system using eight digits: 0-7. Each octal digit represents exactly three binary digits. Less common than hexadecimal today.

History: Swedish king Charles XII also proposed octal. Widely used in early computing (1960s-1970s) before hexadecimal became standard. Unix file permissions still use octal notation.

Current Use: Unix/Linux file permissions (chmod 755). Some embedded systems. Legacy code and documentation. Digital electronics occasionally. Less common than hex in modern programming but still relevant in specific domains like system administration.

Why These Bases? Binary (base 2) is fundamental to digital electronics (on/off states). Octal (base 8 = 2³) and hexadecimal (base 16 = 2⁴) are convenient for humans to read binary - each octal digit represents 3 bits, each hex digit represents 4 bits. Decimal (base 10) is natural for humans (ten fingers).

Frequently Asked Questions

How do I convert binary to decimal?

Each binary digit represents a power of 2. Starting from the right: rightmost is 2^0=1, next is 2^1=2, then 2^2=4, then 2^3=8, etc. Multiply each binary digit by its position value and sum. Example: 1011 in binary = (1×8) + (0×4) + (1×2) + (1×1) = 8+0+2+1 = 11 in decimal.

How do I convert decimal to binary?

Repeatedly divide by 2 and record remainders. Read remainders bottom-to-top. Example: 13 decimal: 13÷2=6 remainder 1, 6÷2=3 remainder 0, 3÷2=1 remainder 1, 1÷2=0 remainder 1. Reading upward: 1101 binary. Or subtract largest power of 2 repeatedly: 13 = 8+4+1 = 2³+2²+2⁰ = 1101.

What does 0xFF mean in programming?

0x prefix indicates hexadecimal notation. FF in hex equals 255 in decimal (F=15, so FF = 15×16 + 15 = 255). Commonly used for byte values (0-255 range), color codes (0x000000 to 0xFFFFFF), and memory addresses. Each F represents 4 bits set to 1 (1111), so FF = 11111111 in binary.

Why do programmers use hexadecimal?

Hexadecimal is compact and maps cleanly to binary. One hex digit = exactly 4 bits. A byte (8 bits) = 2 hex digits. Makes reading memory dumps easier. Example: binary 11111111 is hard to read; hex FF is clear. Color codes: #FF0000 (red) easier than rgb(255,0,0) or binary. Memory addresses manageable in hex.

What are Unix file permissions numbers?

Unix uses octal for permissions. Three octal digits represent owner, group, others. Each digit is sum of: 4=read, 2=write, 1=execute. Example: 755 means owner has 7 (4+2+1 = rwx), group has 5 (4+1 = r-x), others have 5 (4+1 = r-x). 644 = rw-r--r--. This is octal notation.

What is two's complement?

Method for representing negative numbers in binary. To negate: invert all bits (1→0, 0→1), then add 1. Example: +5 = 0101. Invert: 1010. Add 1: 1011 = -5. The leftmost bit indicates sign (0=positive, 1=negative). This system allows normal addition to work with negative numbers, simplifying computer hardware.

Why is binary called "base 2"?

The "base" indicates how many digits the system uses. Binary uses 2 digits (0,1), so base 2. Decimal uses 10 digits (0-9), so base 10. Hexadecimal uses 16 symbols (0-F), so base 16. Each position in a number represents base raised to a power: in decimal 123 = 1×10² + 2×10¹ + 3×10⁰.

Can I have a number system with any base?

Yes! Mathematically, any positive integer can be a base. Base 12 (dozenal) has been proposed. Base 60 (sexagesimal) is used for time (60 seconds/minute). Ancient Mayans used base 20. Computers use base 2 (binary), 8 (octal), 10 (decimal), and 16 (hex). Practical bases are typically powers of 2 or 10 for human use.

Common Uses for Number System Conversion

  • Computer Programming: Converting between hex, decimal, and binary for debugging
  • Web Development: Understanding hex color codes (#RRGGBB format)
  • Network Administration: Working with IP addresses and subnet masks
  • Digital Electronics: Designing circuits and understanding logic states
  • System Administration: Setting Unix/Linux file permissions (octal)
  • Assembly Language: Reading machine code and memory addresses
  • Computer Science Education: Learning fundamental concepts
  • Cybersecurity: Analyzing hex dumps and binary exploits

Number Conversion Tips

  1. Binary patterns: Memorize powers of 2 (1,2,4,8,16,32,64,128,256)
  2. Hex-Binary: Each hex digit = 4 binary bits (F = 1111, A = 1010)
  3. Octal-Binary: Each octal digit = 3 binary bits (7 = 111, 5 = 101)
  4. Quick hex to decimal: A=10, B=11, C=12, D=13, E=14, F=15
  5. Color codes: #RRGGBB format uses 2 hex digits per color channel
  6. Binary grouping: Group binary by 4s for easier reading (1011 0101)
  7. Prefixes matter: 0x for hex, 0b for binary, 0 for octal in programming

Interesting Number System Facts

  • First computer bug (1947): actual moth trapped in relay causing binary error
  • IPv4 address: 4 decimal bytes, each 0-255 (32 bits total)
  • RGB color: 16.7 million colors (256×256×256 = 16,777,216)
  • 8-bit era: consoles could display 256 colors simultaneously
  • Hexadecimal editing: "hex editors" for viewing raw file data
  • Binary clock: tells time using LED lights in binary format
  • Ancient Babylon: used base-60 (sexagesimal) still in time/angles
  • Mayan calendar: based on base-20 (vigesimal) system
  • Quantum computing: uses qubits (superposition of 0 and 1)
  • Gray code: binary variant where adjacent values differ by 1 bit
  • BCD: Binary-Coded Decimal represents each decimal digit in 4 bits
  • UTF-8 encoding: uses binary to represent all world characters

Number Systems in Computing

Machine Code

CPUs execute binary instructions. Assembly language uses hex for readability. Example: instruction "MOV AX, 5" becomes hex B8 05 00, which is binary 10111000 00000101 00000000. Programmers rarely work in pure binary - hex is the human-readable intermediate.

Memory Addresses

RAM locations identified by hexadecimal addresses. 32-bit systems: addresses 0x00000000 to 0xFFFFFFFF (4 GB). 64-bit systems: vastly larger address space. Debuggers display memory in hex. Pointer variables store hex addresses.

Character Encoding

ASCII: each character = 7-8 bits. 'A' = 65 decimal = 0x41 hex = 01000001 binary. Extended ASCII: 0-255 (00-FF hex). Unicode: vastly more characters, up to 0x10FFFF. UTF-8 uses variable-length binary encoding.

Color in Computing

24-bit color (True Color): 8 bits per channel (RGB). Each channel: 0-255 (00-FF hex). White: #FFFFFF (255,255,255). Black: #000000 (0,0,0). Red: #FF0000. Older systems: 8-bit (256 colors), 16-bit (65,536 colors).

Conversion Methods Explained

Decimal to Binary (Division Method)

Convert 25 to binary: 25÷2=12 R1, 12÷2=6 R0, 6÷2=3 R0, 3÷2=1 R1, 1÷2=0 R1. Read remainders upward: 11001. Verification: 16+8+1 = 25 ✓

Binary to Hexadecimal (Grouping Method)

Group binary digits in sets of 4 (from right). Convert each group to hex. Example: 11010110 → 1101 0110 → D 6 → D6 hex. If leftmost group has fewer than 4 digits, pad with zeros. 101 → 0101 → 5 hex.

Hexadecimal to Decimal (Position Method)

Each position is a power of 16. 2A3 hex: (2×16²) + (10×16¹) + (3×16⁰) = (2×256) + (10×16) + (3×1) = 512 + 160 + 3 = 675 decimal.

Octal to Binary (Direct Expansion)

Each octal digit becomes 3 binary digits. 745 octal → 7=111, 4=100, 5=101 → 111100101 binary. Reverse works by grouping binary by 3s from right.

More Converters: