How to convert decimal to binary: the division method
Take 37 as an example:
| Divide | Quotient | Remainder |
|---|---|---|
| 37 ÷ 2 | 18 | 1 |
| 18 ÷ 2 | 9 | 0 |
| 9 ÷ 2 | 4 | 1 |
| 4 ÷ 2 | 2 | 0 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Reading the remainders from the bottom up gives 100101. Check it: 32 + 4 + 1 = 37. The first remainder is always the rightmost digit, which is why you read upward.
The subtraction method
If you know the powers of 2 (1, 2, 4, 8, 16, 32, 64, 128...), you can work from the left instead. Find the largest power that fits, write a 1, subtract it, and move to the next power down, writing 1 if it fits and 0 if it doesn't. For 37: 32 fits (1, leaves 5), 16 no (0), 8 no (0), 4 fits (1, leaves 1), 2 no (0), 1 fits (1). Same answer, 100101.
Negative numbers
Binary itself has no minus sign, so computers use two's complement within a fixed number of bits. In 8 bits you can store -128 to 127; in 16 bits, -32,768 to 32,767. The converter asks for the width so it can tell you when a number won't fit. To check a result, paste it into the binary to decimal converter and switch to signed.
Want the binary for text rather than a number? That's a different conversion; use the text to binary converter.