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.

More free tools

Network+ N10-009769 real exam questions, US$39Free: 192 questionsGet the full pack

All free tools