Skip to content
Visual lab

Learn subnetting visually

11 short lessons, from binary to IPv6. Change the inputs and watch every value update.

Lesson 1 of 11Beginner

Binary basics

Why binary?
An IPv4 address is 32 bits, written as four 8-bit octets in decimal, like 192.168.1.10. Subnetting is deciding which of those bits name the network and which name the host, so it helps to read one octet in binary first.

Flip the bits

An octet is 8 bits. Each bit has a place value. Add up the place values of the bits that are on.

128 + 32 + 4 =164

Binary 10100100 is decimal 164. The largest octet is 11111111 = 255, which is why IPv4 numbers stop at 255.

Decimal to binary: the subtraction method

Walk the place values from 128 down. If the value fits, write 1 and subtract it. If not, write 0.

  1. 128172 ≥ 128, so 172 − 128 = 441
  2. 6444 < 64, skip0
  3. 3244 ≥ 32, so 44 − 32 = 121
  4. 1612 < 16, skip0
  5. 812 ≥ 8, so 12 − 8 = 41
  6. 44 ≥ 4, so 4 − 4 = 01
  7. 20 < 2, skip0
  8. 10 < 1, skip0
Result10101100

The 8 mask values

A subnet mask fills bits from the left. Each new bit adds the next place value, so only eight numbers can ever appear in a mask octet.

Bits onBinaryValue
110000000128
211000000192
311100000224
411110000240
511111000248
611111100252
711111110254
811111111255
Memorize this row
128 192 224 240 248 252 254 255. If a mask octet is any other number, the mask is not valid.

Try it

Three quick conversions. Nothing is saved; this is just a self-check.

  1. 1. Write as 8 bits
    245
  2. 2. Write as decimal
    10000101
  3. 3. Write as 8 bits
    29

Lock it in

Drill the “Binary and decimal” skill until it is automatic.

Lesson 1 of 11
Next: The 7 attributes