Decimal to Binary Converter
Convert decimal numbers to binary instantly.
Divide by 2 and collect the remainders
Halve the number, note whether there was a remainder (1) or not (0), and keep halving the quotient until it reaches 0. Read the remainders from the bottom up. For 45:
| Number | ÷ 2 | Remainder |
|---|---|---|
| 45 | 22 | 1 |
| 22 | 11 | 0 |
| 11 | 5 | 1 |
| 5 | 2 | 1 |
| 2 | 1 | 0 |
| 1 | 0 | 1 |
From the bottom up the remainders read 101101, the converter's answer. The last remainder is the leftmost bit, which is why you read upwards. The panel below the result shows the same number in octal (55) and hex (2D).
What the binary form tells you
- Which flags are set. 13 is
1101, so the flags worth 8, 4 and 1 are on and the flag worth 2 is off. - How many bits a value needs. Count the digits in the result. 2026 is
11111101010, 11 bits, so it doesn't fit in one byte but fits in two. - Powers of two. They come out as a 1 followed by zeros: 256 is
100000000. A result like that is a quick way to confirm a buffer size or a subnet block.
Padding the result to 8, 16 or 32 bits
The converter gives the shortest form, with no leading zeros. 5 comes out as 101 and 100 as 1100100. Exercises, network diagrams and hardware documentation usually want a full byte, so add zeros on the left until you reach the width: 00000101 and 01100100. Adding zeros on the left never changes the value. Adding them on the right doubles it each time.
Negative numbers, fractions and separators
- Negative numbers keep a minus sign: −5 gives
-101. Computers usually store −5 in two's complement instead, which in 8 bits is11111011(the binary for 256 − 5 = 251). Work it out that way when you need the stored form. - Fractions are dropped. 0.5 gives 0 and 6.9 gives 110, the binary for 6.
- Commas end the number:
1,024gives 1. Type 1024 to get10000000000. - Very large values above 9007199254740991 are rounded before conversion, so the last bits can be wrong.
Frequently asked questions
What is 10 in binary?+
1010, which is eight plus two. The reverse is a common mix-up: the binary number 10 is decimal 2.
Is there a quicker way to do this in my head?+
Subtract the largest power of two that fits, then repeat with what's left. For 45: take 32, leaving 13; take 8, leaving 5; take 4, leaving 1; take 1. Write a 1 for each power you used and a 0 for each you skipped, from 32 down to 1: 101101.
Does it convert numbers typed with a plus sign or spaces?+
Yes. A leading plus sign is accepted, and spaces are removed before conversion, so 1 024 is read as 1024.
Embed this tool on your website
Free to use on blogs, school sites and intranets. Paste this code into your page's HTML; please keep the credit line.
<iframe src="https://utilityapp.lat/embed/convert/decimal-to-binary" title="Decimal to Binary Converter" width="100%" height="420" style="border:0;max-width:760px" loading="lazy"></iframe> <p style="font-size:13px"><a href="https://utilityapp.lat/convert/decimal-to-binary">Decimal to Binary Converter</a> by UtilityApp</p>