Binary, Decimal and Hex Converter
Convert numbers between binary, decimal, hexadecimal and octal. Type in any box and the others update. There is also an IP address to binary converter for subnetting practice. Everything runs in your browser.
How binary works
Each bit in an 8-bit octet has a value. Add up the values of the bits that are 1.
| Bit | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
For example, 11000000 is 128 + 64 = 192, and 255 is all eight bits on: 11111111. One hex digit is exactly four bits, so 0xC0 is 1100 0000.
Converter FAQ
How do I convert binary to decimal?
Write the place values (128, 64, 32, 16, 8, 4, 2, 1) above the bits and add up the ones under a 1.
How do I convert decimal to binary?
Take away the largest place value that fits, write a 1 there, and repeat with what is left. Write 0 for every place value you skip.
Why does subnetting use binary?
A subnet mask is a run of 1 bits followed by 0 bits. A /26 is 26 ones, which makes the last octet 11000000, or 192.
Keep going
Use the subnet calculator, test yourself with subnetting practice or read the subnetting cheat sheet. Then try the free Network+ practice test or the free A+ Core 1 practice test.
- QuizPorts quiz10 random questions on common port numbers and protocols, with an explanation after each answer.
- CalculatorRAID calculatorUsable capacity and how many drive failures RAID 0, 1, 5, 6 and 10 survive.
- Quiz60-second readiness checkSix real questions for Network+, Security+, A+ Core 1 or CCNA, with your weak domains and what to study next.
Network+ N10-009769 real exam questions, US$39Free: 192 questionsGet the full pack