Reference

Subnetting cheat sheet

Block sizes, mask values and prefixes for every octet, plus the four-step method. Solve any IPv4 subnet without writing out binary. Press C on any page to open it as a popup.

Bit
Block size1286432168421
Mask value128192224240248252254255
Octet 4 prefix/25/26/27/28/29/30/31/32
Octet 3 prefix/17/18/19/20/21/22/23/24
Octet 2 prefix/9/10/11/12/13/14/15/16
Octet 1 prefix/1/2/3/4/5/6/7/8

Tap a bit number to highlight its column.

The method

  1. 1Interesting octet

    Where the prefix ends: /1–/8 octet 1, /9–/16 octet 2, /17–/24 octet 3, /25–/32 octet 4.

  2. 2Block size

    Find the prefix in the table and read the block size above it. It also equals 256 − mask.

  3. 3Network address

    Count in multiples of the block size in that octet. The largest multiple at or below the IP is the network.

  4. 4Range and broadcast

    First usable = network + 1. Broadcast = next network − 1. Last usable = broadcast − 1.