Using the converter
Pick the base you have and the base you want, then type the number. 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.
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, 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/number-base-converter
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.
Another base to decimal: add up the place values
In decimal the digits count ones, tens, hundreds and so on, each place worth ten times the one to its right. Other bases work the same way with a different multiplier. In binary each place is worth twice the one to its right, so the places are 1, 2, 4, 8, 16 and so on. In hex they're 1, 16, 256, 4096.
To convert, multiply each digit by its place value and add the results. 1101 in binary is 1 × 8 + 1 × 4 + 0 × 2 + 1 × 1, which is 13. 1F in hex is 1 × 16 + 15 × 1, which is 31, because F stands for 15.
Binary to hex and octal: group the bits
Hex and binary line up neatly because 16 is 2 × 2 × 2 × 2. Every hex digit stands for exactly four bits, so there's no division to do. Split the binary into groups of four from the right, and swap each group for its hex digit. So 1001 1100 is 9C.
Octal does the same with groups of three, since 8 is 2 × 2 × 2. This is why programmers read binary in hex: two hex digits describe a byte exactly.
Questions
What is a number base?
It's how many digits a number system uses before it has to carry into the next place. Decimal is base 10, with the digits 0 to 9. Binary is base 2, octal base 8 and hexadecimal base 16.
Why does hexadecimal use letters?
It needs sixteen digits, and there are only ten numerals. The letters A to F stand for 10 to 15.
Can it convert fractions or decimals like 3.5?
No, only whole numbers. Fractions in other bases need a different method, multiplying rather than dividing, and most don't come out exactly.






