Study and homework
Check answers for computer science, digital logic and number system exercises, and see the steps behind them.
Type a number and see its binary, octal and hex form straight away. It handles very large whole numbers, fractions such as 0.625, and negative values in two's complement with 8, 16, 32 or 64 bits. You can also check an answer by converting binary back to decimal.
–––Learn how decimal numbers become binary and how to read the result.
Decimal is the base-10 system we use every day, with digits 0 to 9. Binary is base 2 and uses only 0 and 1, which is how computers store numbers. Converting from decimal to binary means writing the same value using powers of 2 instead of powers of 10.
Type a number and the binary, octal and hexadecimal forms appear at once. It handles very large whole numbers, decimals such as 0.625 and negative numbers. To go the other way, use the check box here or the Binary to Decimal Converter.
Check answers for computer science, digital logic and number system exercises, and see the steps behind them.
Write bit masks, flags, permissions and register values, or read binary output while debugging.
Work with IP address octets, subnet masks and microcontroller values that are written in bits.
For a whole number, divide by 2 again and again, write down each remainder, then read the remainders from the last one to the first.
For a fraction, multiply by 2 instead. The digit before the point becomes the next binary digit, and you keep multiplying what is left. 0.625 gives 0.101 because 0.625 = 1/2 + 1/8.
| Decimal | Binary | Hex |
|---|---|---|
| 1 | 1 | 1 |
| 2 | 10 | 2 |
| 8 | 1000 | 8 |
| 10 | 1010 | A |
| 15 | 1111 | F |
| 16 | 10000 | 10 |
| 100 | 1100100 | 64 |
| 255 | 11111111 | FF |
| 256 | 100000000 | 100 |
| 1024 | 10000000000 | 400 |
Computers store negative whole numbers in two's complement. Pick a bit width and -42 becomes 11010110 in 8 bits. The tool shows an error if the value does not fit the chosen width.
The simple form writes a minus sign in front of the binary value, so -42 becomes -101010. This is easier to read and fine for homework.
Some decimals cannot be written exactly in binary. 0.1 repeats forever, so the result is cut after the number of places you choose and a note is shown.
Automatic uses the shortest of 8, 16, 32 or 64 bits that fits. Pick a width to pad positive numbers with leading zeros, such as 5 as 00000101.
Numbers are converted in your browser. Nothing is sent to our server or stored. Only your option choices are remembered on your device.
Input is limited to 400 digits. Floating-point formats such as IEEE 754 are not shown, only the exact binary value of the number you type. Two's complement is for whole numbers.
Type the number into the box and the binary form appears at once. By hand, divide the number by 2 repeatedly, note each remainder, and read the remainders from the last to the first.
10 in decimal is 1010 in binary, because 8 + 2 = 10. You can try any other value with the example buttons or by typing it.
Yes. 0.625 is exactly 0.101 in binary. 0.1 cannot be written exactly and repeats forever, so the result is cut at the number of fraction places you choose and a note says so.
Choose Minus sign to put a minus in front of the binary value, or Two's complement to see how a computer stores it. Two's complement needs a bit width, and Automatic picks 8, 16, 32 or 64 bits for you.
It sets the length of the result. A width of 8 shows 5 as 00000101, and in two's complement it also sets the range, so 8 bits holds -128 to 127.
Whole numbers can have up to 400 digits, which is far beyond the 64-bit limit, because the tool uses exact big-number maths. Two's complement stops at 64 bits unless you leave the width on Automatic.
Yes. Use the check box under the results and type a binary value, including a fraction such as 101.101. The decimal value is exact.
No. The conversion happens in your browser and nothing leaves your device. Only your option choices are remembered for next time.
The homepage features dozens more free tools that don't require an API key.
No matching question.
Share your thoughts on this tool with other visitors.