Decimal to Binary Converter
Convert decimal numbers to binary instantly. Enter any whole number and see its base-2 form, hex equivalent, and the division-by-2 steps explained.
Updated 2026-06-14 · Free · No sign-up · Runs privately in your browser
Show the division-by-2 steps
How the Decimal to Binary Converter Works
This tool turns a normal decimal (base 10) whole number into its binary (base 2) representation, made up only of 0s and 1s. Enter any non-negative integer and it instantly shows the binary string, the hexadecimal equivalent, and the step-by-step division working.
The Method
The standard way to convert decimal to binary is repeated division by 2:
Divide the number by 2, write down the remainder (0 or 1), and repeat with the quotient until it reaches 0. Read the remainders bottom to top to get the binary result.
The remainders are the binary digits, and the last remainder you find is the leftmost (most significant) bit.
Worked Example
Convert decimal 45 to binary:
| Division | Quotient | Remainder |
|---|---|---|
| 45 ÷ 2 | 22 | 1 |
| 22 ÷ 2 | 11 | 0 |
| 11 ÷ 2 | 5 | 1 |
| 5 ÷ 2 | 2 | 1 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Reading the remainders from bottom to top gives 101101. So decimal 45 equals binary 101101.
Why It Is Useful
Knowing how to translate decimal into binary is essential whenever you work close to the hardware:
- Programming — setting and reading individual bit flags or masks.
- Data sizes — understanding why a byte holds values from 0 to 255.
- Networking — building subnet masks and reading IP address octets.
The hexadecimal output is included because it is a compact way to write binary: each hex digit equals four binary bits, so it keeps long numbers readable.
Frequently asked questions
How do you convert decimal to binary?+
Divide the number by 2 and write down the remainder (0 or 1). Keep dividing the quotient by 2 until it reaches 0, then read the remainders from bottom to top to get the binary number.
What is 10 in binary?+
Decimal 10 is 1010 in binary: 10 / 2 = 5 r0, 5 / 2 = 2 r1, 2 / 2 = 1 r0, 1 / 2 = 0 r1. Reading bottom to top gives 1010.
What is 255 in binary?+
Decimal 255 is 11111111 in binary, which fills all eight bits of a single byte with 1s.
What is the binary for 0?+
Zero in binary is simply 0. There are no 1s because the value is empty in every place.
Why convert decimal numbers to binary?+
Computers store and process everything in binary, so converting helps with programming, setting bit flags, understanding memory, and working with low-level hardware or networking.