|
Getting your Trinity Audio player ready...
|
Binary looks like a secret code, but converting it is just arithmetic — and it works the same way in both directions. To turn binary into decimal, you add up the place values. To turn decimal into binary, you divide by 2 and read the remainders backwards. That is the whole trick. This guide works through both methods with worked examples, covers fractions and negative numbers, and ends with a table you can use as a cheat sheet. If you would rather skip the hand-work, the free converters at the bottom do the same conversions instantly.
What Binary and Decimal Mean
Decimal is the number system you use every day. It has ten digits (0–9) and each position is worth ten times the one to its right: ones, tens, hundreds. Binary is the same idea with two digits (0 and 1), and each position is worth twice the one to its right: ones, twos, fours, eights, sixteens. A binary number is therefore just a number written with place values that double instead of multiplying by ten. The rightmost digit is the least significant bit, and the leftmost is the most significant bit. Once you see the place values, both conversions fall out naturally.
How to Convert Binary to Decimal
Multiply each binary digit by its place value and add the results. Start from the right: the rightmost digit is worth 1, the next is worth 2, then 4, 8, 16, and so on. Zeros contribute nothing, so you only add the places where the digit is 1.
Worked example: convert 1101 to decimal. Write the place values above the digits: 8, 4, 2, 1. Then 1101 = (1 × 8) + (1 × 4) + (0 × 2) + (1 × 1) = 8 + 4 + 0 + 1 = 13. So 1101 in binary is 13 in decimal.
A second example: 01011 in binary. The place values are 16, 8, 4, 2, 1. The 1s sit in the 8, 2 and 1 positions, so 01011 = 8 + 2 + 1 = 11.
A third, longer example: 10111 in binary. Place values 16, 8, 4, 2, 1 give (1 × 16) + (0 × 8) + (1 × 4) + (1 × 2) + (1 × 1) = 16 + 0 + 4 + 2 + 1 = 23.
There is a shortcut called the doubling method, which is handy for long numbers. Start from the leftmost digit and work right: double your running total, then add the next digit. For 110: start with 0, then (0 × 2) + 1 = 1, (1 × 2) + 1 = 3, (3 × 2) + 0 = 6. So 110 in binary is 6 in decimal. It gives the same answer as the place-value method, with less writing.
How to Convert Decimal to Binary
Divide the decimal number by 2, write down the remainder, and repeat with the quotient until the quotient is 0. Then read the remainders from bottom to top — that is the binary number. This is the formula to convert decimal to binary, and it works for any whole number.
Worked example: convert 13 to binary.
| Division by 2 | Quotient | Remainder |
|---|---|---|
| 13 ÷ 2 | 6 | 1 |
| 6 ÷ 2 | 3 | 0 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
Reading the remainders from bottom to top gives 1101. So 13 in decimal is 1101 in binary — the same pair as the first example above, in reverse.
A longer example: convert 174 to binary. Dividing by 2 repeatedly gives remainders 0, 1, 1, 1, 0, 1, 0, 1 (from the first division to the last). Read bottom-up: 10101110. Check it: 128 + 0 + 32 + 0 + 8 + 4 + 2 + 0 = 174.
And 156 to binary: the remainders are 0, 0, 1, 1, 1, 0, 0, 1, which read bottom-up as 10011100. Check: 128 + 0 + 0 + 16 + 8 + 4 + 0 + 0 = 156.
Fractions in Binary
Fractions work the same way, with place values that halve instead of doubling. After the binary point, the places are worth 1/2, 1/4, 1/8, and so on. So 0.11 in binary is (1 × 1/2) + (1 × 1/4) = 0.75 in decimal. And 101.11 in binary is 4 + 0 + 1 + 0.5 + 0.25 = 5.75.
To convert a decimal fraction to binary, multiply by 2 and write down the whole-number part, then repeat with the leftover fraction. For 0.75: 0.75 × 2 = 1.5, write 1, keep 0.5; 0.5 × 2 = 1.0, write 1. So 0.75 in decimal is 0.11 in binary. One honest warning: some fractions never terminate in binary. 0.1 in decimal repeats forever as 0.0001100110011…, so converters stop after a fixed number of bits and say so.
Negative Numbers in Binary
Computers store negative numbers using two’s complement. To write −7 in 8-bit binary: start with 7, which is 00000111. Flip every bit to get 11111000 (the 1’s complement), then add 1 to get 11111001. That is −7 in 8-bit two’s complement. The leftmost bit acts as the sign bit: 1 means negative, 0 means positive. The same number needs more bits if it does not fit — −128 is the smallest value an 8-bit signed number can hold.
Denary — the Same Thing, Different Word
If you learned maths in the UK, you may have met the word “denary” instead of “decimal”. Denary is simply the base-10 number system — the same ten digits, the same place values. So “convert binary to denary” and “convert binary to decimal” ask for exactly the same thing, and “denary to binary converter” is the same tool as a decimal to binary converter. This guide uses “decimal” throughout because it is the more searched term, but the method is identical either way.
Binary to Decimal and Decimal to Binary Table
Use this table as a cheat sheet for the numbers 0 to 20. Every value is exact.
| Decimal | Binary | Decimal | Binary |
|---|---|---|---|
| 0 | 0 | 11 | 1011 |
| 1 | 1 | 12 | 1100 |
| 2 | 10 | 13 | 1101 |
| 3 | 11 | 14 | 1110 |
| 4 | 100 | 15 | 1111 |
| 5 | 101 | 16 | 10000 |
| 6 | 110 | 17 | 10001 |
| 7 | 111 | 18 | 10010 |
| 8 | 1000 | 19 | 10011 |
| 9 | 1001 | 20 | 10100 |
| 10 | 1010 | 255 | 11111111 |
Two values worth memorising: 255 in binary is 11111111 (eight 1s), and 1024 in binary is 10000000000 (a 1 followed by ten 0s). And 611 in binary is 1001100011.
Common Mistakes
The most common mistake is reading the remainders top-to-bottom instead of bottom-to-top when converting decimal to binary — that gives the binary number backwards. The second is forgetting that the rightmost place value is 1, not 2, when converting binary to decimal; every place value doubles as you move left, starting from 1. The third is mixing up text and numbers: converting the text “255” to binary gives the binary for the characters 2, 5 and 5, not 11111111. Numbers and text are different conversions, and this site has a separate text to binary converter for the character version.
Try the Free Converters
Doing conversions by hand is the best way to learn them, but for real work a converter is faster. These free tools run entirely in your browser — nothing is uploaded:
- Decimal to Binary Converter — convert any decimal number to binary, including fractions, negatives and IP addresses.
- Binary to Decimal Converter — convert any binary number to decimal, with the place-value working shown.
- Binary Calculator — add, subtract, multiply and divide binary numbers, with bitwise AND, OR, XOR and complements.
- Binary to Hex Converter — convert binary to hexadecimal and octal, and back.
If you want the background first, the beginner’s guide to reading and writing binary explains bits, bytes and place values from scratch.
The ASCII binary table lists every character with its decimal, hex and binary values.
Frequently Asked Questions
What is the formula to convert decimal to binary?
Divide the decimal number by 2 and note the remainder. Divide the quotient by 2 and note the remainder again. Repeat until the quotient is 0, then read the remainders from bottom to top. That is the binary number.
How do I convert binary to decimal by hand?
Multiply each binary digit by its place value (1, 2, 4, 8, 16… from the right) and add the results. For 1101: 8 + 4 + 0 + 1 = 13.
What is 1101 in decimal?
13. The 1s sit in the 8, 4 and 1 positions, and 8 + 4 + 1 = 13.
What is denary?
Denary is another name for the decimal (base-10) number system, used mainly in UK maths teaching. “Binary to denary” means the same as “binary to decimal”.
Can binary numbers have decimal points?
Yes. A binary point works like a decimal point, with place values of 1/2, 1/4, 1/8 after it. For example, 101.11 in binary is 5.75 in decimal. Some fractions, such as 0.1, never terminate in binary.
What is 255 in binary?
11111111 — eight 1s. It is the largest number that fits in 8 bits unsigned.
Binary to decimal is addition of place values; decimal to binary is repeated division by 2. Learn those two methods and you can convert any whole number in either direction, check your work with the table above, and handle fractions and negatives with the same ideas. For anything longer than a few digits, the free converters linked above do the arithmetic for you — but now you know exactly what they are doing.