Binary Converter
Convert instantly between binary, decimal, hexadecimal, and octal — type in any field and all others update in real time.
Binary Visualization
Common Values Reference
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 4 | 100 | 4 | 4 |
| 8 | 1000 | 8 | 10 |
| 10 | 1010 | A | 12 |
| 15 | 1111 | F | 17 |
| 16 | 10000 | 10 | 20 |
| 32 | 100000 | 20 | 40 |
| 64 | 1000000 | 40 | 100 |
| 100 | 1100100 | 64 | 144 |
| 128 | 10000000 | 80 | 200 |
| 255 | 11111111 | FF | 377 |
| 256 | 100000000 | 100 | 400 |
| 512 | 1000000000 | 200 | 1000 |
| 1024 | 10000000000 | 400 | 2000 |
About the Binary Converter
Computers represent all data — numbers, text, images, code — as binary values: sequences of 0s and 1s. A binary converter translates between the binary number system (base 2) and the other number systems used in computing and everyday life: decimal (base 10), hexadecimal (base 16), and octal (base 8).
Understanding number bases is essential for programming, computer science, digital electronics, networking (IP addresses, subnet masks), and cybersecurity (hex values, byte inspection).
Number Systems Explained
Frequently Asked Questions
How do I convert binary to decimal?
To convert binary to decimal, multiply each bit by 2 raised to its position power (starting from 0 on the right), then sum the results. For example, binary 1010: (1×2³) + (0×2²) + (1×2¹) + (0×2⁰) = 8 + 0 + 2 + 0 = 10 in decimal.
How do I convert decimal to binary?
To convert decimal to binary, repeatedly divide the number by 2 and record the remainders from bottom to top. For example, 42 ÷ 2 = 21 R0, 21 ÷ 2 = 10 R1, 10 ÷ 2 = 5 R0, 5 ÷ 2 = 2 R1, 2 ÷ 2 = 1 R0, 1 ÷ 2 = 0 R1. Reading remainders from bottom: 101010 = 42.
Why is hexadecimal used in programming?
Hexadecimal is a shorthand for binary. Each hex digit represents exactly 4 binary bits (a nibble), making it easy to read and write large binary values compactly. For example, the byte 11111111 (255 in decimal) is simply FF in hex. This is why hex is used for colors (#RRGGBB), memory addresses, and byte values.
What is a bit and a byte?
A bit is the smallest unit of data in computing, representing either 0 or 1 (binary digit). A byte is 8 bits, which can represent 256 (2⁸) different values (0–255). A kilobyte (KB) is 1024 bytes, a megabyte (MB) is 1024 KB, and so on. All digital data — text, images, video — is stored as binary bits.
What is octal used for in programming?
Octal (base 8) is most commonly used for Unix/Linux file permissions. When you run chmod 755, those are octal values: 7 (read + write + execute = 111 in binary), 5 (read + execute = 101 in binary), 5. It was also used in early computing systems like PDP computers, and is still seen in some assembly languages.
How many binary digits (bits) does a number need?
A decimal number n requires ⌊log₂(n)⌋ + 1 bits to represent. For example: decimal 10 needs 4 bits (1010), decimal 255 needs 8 bits (11111111), decimal 256 needs 9 bits (100000000). In practice, numbers are padded to standard sizes: 8-bit (byte), 16-bit (short), 32-bit (int), or 64-bit (long).