Using the converter
Type a decimal number and the binary appears as you type. Binary can come back as one run of bits or in groups of four. Several numbers can go in at once, separated by spaces, commas or new lines. Prefixes like 0x and 0b are fine, and so is the _ character used to group digits, as in 1001_1100. Numbers can be as long as you like and can be negative, but they have to be whole: there's no decimal point.
To turn words into binary rather than numbers, use the text to binary converter.
Show the steps opens the working under the answer, line by line, the same way you'd set it out on paper. It shows the first four numbers when there are several.
Decimal to another base: divide and keep the remainders
Divide the number by the base you're converting to, and write down the remainder. Divide the answer by the base again, and keep going until the answer is 0. The remainders, read from the last one back up to the first, are the digits of the new number.
For 13 in binary: 13 ÷ 2 is 6 remainder 1, 6 ÷ 2 is 3 remainder 0, 3 ÷ 2 is 1 remainder 1, and 1 ÷ 2 is 0 remainder 1. Reading up from the bottom gives 1101.
Hex works the same way, dividing by 16. A remainder from 10 to 15 is written as a letter, A to F, so 255 ÷ 16 is 15 remainder 15, and both 15s become F, giving FF.
The other way: subtract powers of two
Some people find it quicker to work from the top. Find the largest power of two that fits, 128 for 156, and write a 1. Take it away, leaving 28, and go down the powers: 64 doesn't fit, 0; 32 doesn't, 0; 16 does, 1, leaving 12; 8 does, 1, leaving 4; 4 does, 1, leaving 0; then 0 for 2 and 0 for 1. That gives 10011100, the same answer the division reaches.
Decimal, binary, octal and hex from 0 to 32
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 17 | 10001 | 21 | 11 |
| 18 | 10010 | 22 | 12 |
| 19 | 10011 | 23 | 13 |
| 20 | 10100 | 24 | 14 |
| 21 | 10101 | 25 | 15 |
| 22 | 10110 | 26 | 16 |
| 23 | 10111 | 27 | 17 |
| 24 | 11000 | 30 | 18 |
| 25 | 11001 | 31 | 19 |
| 26 | 11010 | 32 | 1A |
| 27 | 11011 | 33 | 1B |
| 28 | 11100 | 34 | 1C |
| 29 | 11101 | 35 | 1D |
| 30 | 11110 | 36 | 1E |
| 31 | 11111 | 37 | 1F |
| 32 | 100000 | 40 | 20 |
Decimal, binary, octal and hex from 0 to 32stringmash.com/decimal-to-binary
Questions
What is 10 in binary?
1010, which is 8 + 2.
How do I write a negative number in binary?
On paper, with a minus sign, which is what this converter does. Computers usually store negative numbers another way, called two's complement, which depends on how many bits the number has.
Why does 5 come out as 0101 in groups of four?
Grouping pads the front with zeros so every group has four bits. It doesn't change the value.






