Skip to content

Binary Converter

Convert instantly between binary, decimal, hexadecimal, and octal — type in any field and all others update in real time.

Decimal: Bits needed: Hex bytes:

Binary Visualization

Enter a number above to see the bit visualization

Common Values Reference

DecimalBinaryHexOctal
0000
1111
21022
410044
81000810
101010A12
151111F17
16100001020
321000002040
64100000040100
100110010064144
1281000000080200
25511111111FF377
256100000000100400
51210000000002001000
1024100000000004002000

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

Base 2
Binary
Digits: 01
Used internally by all computers. Each digit is a bit (0 or 1), and 8 bits make a byte.
Base 10
Decimal
Digits: 0-9
The standard number system humans use daily. Numbers 0 through 9.
Base 16
Hexadecimal
Digits: 0-9, A-F
Widely used in computing to represent binary compactly. Colors in HTML (#FF5733), memory addresses, byte values.
Base 8
Octal
Digits: 0-7
Used in Unix file permissions (chmod 755), older computing systems, and some PDP systems.

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).