Using the converter
Type a binary number, made of 0s and 1s, and its decimal value appears as you type. Several numbers can go in at once, separated by spaces, commas or new lines. A prefix is fine when it matches the base, like 0x on hex or 0b on binary. 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.
This converts numbers. To turn binary back into letters and words, use the binary translator instead.
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.
How to convert binary to decimal
Write the place values over the bits, starting from 1 on the right and doubling each time: 1, 2, 4, 8, 16, 32, 64, 128. Add up the place values that have a 1 under them and skip the ones with a 0.
For 10011100 the 1s sit under 128, 16, 8 and 4. 128 + 16 + 8 + 4 is 156.
Practice binary on screen
Type the answer and press Check.
0 answered
File permissions in octal
Unix file permissions are three bits each, one bit for read, one for write and one for execute, which is why they're written in octal. Read is worth 4, write 2 and execute 1, and each octal digit adds up one set, for the file's owner, its group and everyone else in turn. A mode of 754 gives the owner 4 + 2 + 1, everything, the group 4 + 1, read and execute, and everyone else 4, read only.
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/binary-to-decimal
Checking your answer
To check a conversion, go back the other way by halving. 156 halves to 78 with nothing left over, 78 to 39 with nothing, 39 to 19 remainder 1, 19 to 9 remainder 1, 9 to 4 remainder 1, 4 to 2 with nothing, 2 to 1 with nothing, and 1 to 0 remainder 1. Read the remainders from the last one up: 10011100, the number you started with. The decimal to binary converter sets this out step by step.
In the classroom
Ages 8 and up, about 20 minutes. Five pupils stand in a row holding cards worth 16, 8, 4, 2 and 1. Each card is either shown (1) or hidden (0). Call out a number and the row works out which cards to show; then show a pattern and the class reads the number.
Take it further: with five cards the biggest number is 31. Ask what a sixth card would be worth and how far it lets them count. CS Unplugged's binary numbers lessons build on the same cards.
Questions
What is 11111111 in decimal?
255, which is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1. It's the largest number a byte can hold.
Why is binary used in computers?
Each bit only has to be one of two states, on or off, which is simple to build reliably in electronics.
Does it handle spaces between groups of bits?
Yes. Groups of four bits with spaces between them are read as one number, so 1001 1100 is 156. That way the grouped output can be swapped straight back. Any other space starts a new number. To keep groups of four apart, put a comma or a new line between them. You can also join groups with _, as in 1001_1100.
Sources
Added . Last updated and reviewed . What's new






