Binary to Decimal Converter — Number System Converter
Type in any field and all others update instantly. Converts between decimal (base 10), binary (base 2), hexadecimal (base 16), and octal (base 8). Shows step-by-step conversion work.
Converting 255 to binary by repeated division by 2: 255 ÷ 2 = 127 remainder 1 127 ÷ 2 = 63 remainder 1 63 ÷ 2 = 31 remainder 1 31 ÷ 2 = 15 remainder 1 15 ÷ 2 = 7 remainder 1 7 ÷ 2 = 3 remainder 1 3 ÷ 2 = 1 remainder 1 1 ÷ 2 = 0 remainder 1 Reading remainders bottom-to-top: 11111111 255 (decimal) = 11111111 (binary)
Converting 255 to hexadecimal (base 16): 255 ÷ 16 = 15 remainder 15 (F) 15 ÷ 16 = 0 remainder 15 (F) Reading remainders bottom-to-top: FF 255 (decimal) = FF (hex)
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 8 | 10 |
| 9 | 1001 | 9 | 11 |
| 10 | 1010 | A | 12 |
| 11 | 1011 | B | 13 |
| 12 | 1100 | C | 14 |
| 13 | 1101 | D | 15 |
| 14 | 1110 | E | 16 |
| 15 | 1111 | F | 17 |
Number Systems Explained
A number system is a method for representing quantities. The number we write as "twelve" can be expressed in many different ways depending on the base (radix) used. The base tells you how many unique digits the system uses before "rolling over" to the next positional column.
All number systems share the same underlying positional principle: the value of a digit depends on both the digit itself and its position. The position represents a power of the base.
Decimal (Base 10)
Decimal is the number system humans use in everyday life. It uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Each position represents a power of 10: ones (10&sup0;), tens (10¹), hundreds (10²), thousands (10³), and so on.
Example: the number 2,394 = (2 × 10³) + (3 × 10²) + (9 × 10¹) + (4 × 10&sup0;) = 2,000 + 300 + 90 + 4.
Decimal likely became the dominant number system because humans have ten fingers. Many ancient civilizations independently converged on base-10 counting for this reason.
Binary (Base 2)
Binary uses only two digits: 0 and 1. Each position represents a power of 2. Binary was formalized by Gottfried Leibniz in 1703 (influenced by Chinese I Ching hexagrams) and became the foundation of all digital computing.
Example: binary 1101 = (1 × 2³) + (1 × 2²) + (0 × 2¹) + (1 × 2&sup0;) = 8 + 4 + 0 + 1 = 13 (decimal).
Common binary patterns in computing:
- 1 bit — the smallest unit; one binary digit
- 1 nibble — 4 bits; range 0–15 (0000 to 1111)
- 1 byte — 8 bits; range 0–255 (00000000 to 11111111)
- 1 kilobyte — 1,024 bytes (210 bytes). Use our Data Storage Converter to convert between KB, MB, GB, and TB
- 32-bit integer — 4 bytes; range 0–4,294,967,295 (unsigned)
Hexadecimal (Base 16)
Hexadecimal uses sixteen symbols: 0–9 for the first ten values, then A–F for 10–15. A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
The key advantage: one hex digit represents exactly 4 binary bits (a nibble). This makes hex a compact shorthand for binary. A byte (8 bits) is exactly 2 hex digits. A 32-bit value is exactly 8 hex digits.
Example: hex FF = (15 × 16¹) + (15 × 16&sup0;) = 240 + 15 = 255 (decimal) = 11111111 (binary).
Where you see hex every day:
- CSS/HTML color codes: #FF5733 = R:255, G:87, B:51 in decimal RGB. Each channel is a percentage of 255
- MAC addresses: 00:1A:2B:3C:4D:5E
- IPv6 addresses: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
- Debugging memory dumps and error codes
- SHA and MD5 hash values
- Unicode code points: U+1F600 (the grinning face emoji)
Octal (Base 8)
Octal uses eight digits: 0–7. Each octal digit represents exactly 3 binary bits. Octal was prevalent in early computing (the PDP-8, IBM System/360) because it maps neatly to groupings of 3 binary digits, making it easier to read binary by hand.
Example: octal 377 = (3 × 8²) + (7 × 8¹) + (7 × 8&sup0;) = 192 + 56 + 7 = 255 (decimal) = 11111111 (binary).
Octal is still widely used in Unix/Linux file permissions. The chmod command uses three-digit octal numbers:
- chmod 755 = rwxr-xr-x (owner: read+write+execute; group/others: read+execute)
- chmod 644 = rw-r--r-- (owner: read+write; group/others: read only)
- chmod 777 = rwxrwxrwx (everyone: full permissions — use cautiously)
Each permission group (owner, group, others) has 3 bits: read (4), write (2), execute (1). A digit of 7 = 4+2+1 = all three permissions. A digit of 5 = 4+0+1 = read and execute only.
Conversion Cheat Sheet
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 8 | 1000 | 8 | 10 |
| 10 | 1010 | A | 12 |
| 15 | 1111 | F | 17 |
| 16 | 10000 | 10 | 20 |
| 64 | 1000000 | 40 | 100 |
| 128 | 10000000 | 80 | 200 |
| 255 | 11111111 | FF | 377 |
| 256 | 100000000 | 100 | 400 |
| 1024 | 10000000000 | 400 | 2000 |
| 65535 | 1111111111111111 | FFFF | 177777 |
Frequently Asked Questions
How do I convert decimal to binary?
To convert decimal to binary, repeatedly divide the number by 2 and record the remainders. Then read the remainders from bottom to top. Example: 13 ÷ 2 = 6 R1, 6 ÷ 2 = 3 R0, 3 ÷ 2 = 1 R1, 1 ÷ 2 = 0 R1. Reading remainders bottom-to-top: 1101. So 13 in decimal = 1101 in binary.
How do I convert binary to decimal?
To convert binary to decimal, multiply each binary digit (bit) by its positional value (powers of 2) starting from the right, then sum the results. Example: 1101 = (1 × 2³) + (1 × 2²) + (0 × 2¹) + (1 × 2⁰) = 8 + 4 + 0 + 1 = 13.
Why do computers use binary?
Computers use binary (base-2) because electronic circuits have two easily distinguishable states: high voltage (1) and low voltage (0). These two states map directly to binary digits. Representing three or more states reliably at high speeds would require much more complex and error-prone hardware. All digital data — text, images, video, programs — is ultimately stored and processed as binary.
What is hexadecimal used for?
Hexadecimal (base-16) is used extensively in computing because it provides a compact way to represent binary data. Each hex digit represents exactly 4 binary bits, so a byte (8 bits) can be written as 2 hex digits instead of 8 binary digits. Common uses: color codes in HTML/CSS (e.g., #FF5733), memory addresses, MAC addresses, error codes, and assembly language programming.
What is octal and where is it used?
Octal (base-8) uses digits 0–7. Each octal digit represents exactly 3 binary bits. Octal was commonly used in older computer systems and Unix file permissions. In Unix/Linux, file permissions are often expressed as three-digit octal numbers (e.g., chmod 755 sets permissions to rwxr-xr-x). While less common in modern programming than hexadecimal, octal appears in many legacy systems and low-level programming contexts.
Related Calculators
- Scientific Calculator — expression parsing using mathjs
- Factor Calculator — prime factorization and factor lists
- Exponent Calculator — powers and roots with step-by-step work
- Roman Numeral Converter — convert numbers to/from Roman numerals