IPv4 subnet calculatorNetwork, host range, broadcast, mask and wildcard for any IPv4 blockIPv6 subnet calculatorPrefix ranges, /64 counts, splits and a ULA prefix generatorVLSM calculatorSize subnets by host count, with AWS, Azure, GCP and OCI rulesVisual subnet plannerSplit and join blocks, label them, then share or export the planCIDR and IP range calculatorTurn any start and end address into the fewest CIDR blocksSupernet and route summarySummarise networks into one route or merge them exactlyWildcard mask calculatorACL wildcards, matched ranges and ready Cisco linesSubnetting practiceExam-style questions, checked instantly with the working shownSubnet mask cheat sheetEvery prefix from /0 to /32 with mask, wildcard and hostsIPv6 cheat sheetPrefix sizes, address types and the reserved rangesGuidesHow subnetting works, explained with worked examples

How to subnet an IPv4 network, step by step

Two methods that always give the right answer: the binary AND you can prove on paper, and the block-size shortcut you can do in your head in under 20 seconds.

Updated Nov 20, 20269 min readFigures tested
Network = address AND mask 192.168.10.77/26 11000000101010000000101001001101address 11111111111111111111111111000000mask 11000000101010000000101001000000network 256 − 192 = 64block size in the 4th octet .64 to .127
Key facts
  • A prefix like /26 means the first 26 bits are the network and the remaining 6 are hosts.
  • Network address = IP address AND subnet mask.
  • Block size = 256 minus the mask value in the interesting octet.
  • Usable hosts = 2host bits minus 2, except /31 and /32.
IPv4 subnet calculator

Network, host range, broadcast, mask and wildcard for any IPv4 block

Open the tool

What a subnet mask really says

An IPv4 address is 32 bits, written as four decimal octets. A subnet mask is another 32 bits that splits the address into two parts. Every 1 in the mask marks a network bit and every 0 marks a host bit. The ones always come first, so a mask can be written as a count of ones: 255.255.255.192 is 26 ones followed by 6 zeros, which is why we call it a /26.

Everything else follows from that split. Hosts that share the same network bits are on the same subnet and can talk directly. The host bits number the devices inside it. With 6 host bits there are 26 = 64 addresses in the block.

PrefixMaskNetwork bitsHost bitsAddresses
/24255.255.255.0248256
/26255.255.255.19226664
/20255.255.240.020124,096
/29255.255.255.2482938

Method 1: the binary AND

This is the method behind every calculator, including ours. Take 192.168.10.77/26.

  1. Write the address in binary: 11000000.10101000.00001010.01001101.
  2. Write the /26 mask in binary: 11111111.11111111.11111111.11000000.
  3. AND them bit by bit. A bit survives only where both are 1: 11000000.10101000.00001010.01000000.
  4. Convert back to decimal. The network address is 192.168.10.64.
  5. Now set all six host bits to 1: …01111111. That is the broadcast, 192.168.10.127.

The usable hosts are everything between: 192.168.10.65 to 192.168.10.126, which is 62 addresses. The binary method is slow, but it is the proof. When the shortcut gives an answer that looks odd, come back to it.

Method 2: the block-size shortcut

Most people subnet in their head with the block size, also called the magic number.

  1. Find the interesting octet: the one where the mask is neither 255 nor 0. For /26 that is the fourth octet, where the mask is 192.
  2. Block size = 256 − 192 = 64. Subnets in that octet start at 0, 64, 128 and 192.
  3. Find the multiple of 64 at or below the address value, 77. That is 64, so the network is 192.168.10.64.
  4. The next subnet starts at 128, so the broadcast is one less: 192.168.10.127.
Octets to the left of the interesting one copy straight from the address. Octets to the right are 0 in the network address and 255 in the broadcast.

Worked example: a /20

Find the network and broadcast for 172.20.141.9/20.

  • /20 is 255.255.240.0, so the interesting octet is the third.
  • Block size = 256 − 240 = 16. Multiples of 16: 128, 144... The largest at or below 141 is 128.
  • Network: 172.20.128.0. The next block starts at 144, so the broadcast is 172.20.143.255.
  • Hosts: 172.20.128.1 to 172.20.143.254, that is 212 − 2 = 4,094 usable.

Check it in the calculator with this address loaded.

Worked example: a /29

Find the usable range for 10.33.7.203/29.

  • /29 is 255.255.255.248. Block size = 8.
  • Multiples of 8 near 203: 200 and 208. The network is 10.33.7.200.
  • Broadcast: 10.33.7.207. Usable hosts: .201 to .206, which is 6 hosts.

How many subnets and hosts

When you split a network you borrow host bits for the subnet number. Borrowing n bits gives 2n subnets, and every borrowed bit halves the hosts in each one.

Split a /24 intoNew prefixBits borrowedUsable hosts each
2 subnets/251126
4 subnets/26262
8 subnets/27330
16 subnets/28414
64 subnets/3062

To fit a host count instead, add 2 for the network and broadcast and round up to a power of two. 50 hosts need 52 addresses, which rounds up to 64, so a /26. When subnets need different sizes, use VLSM.

Mistakes that cost marks

  • Using the wrong octet. A /20 changes the third octet, not the fourth. Always find where the mask stops being 255 first.
  • Forgetting the minus two. A /27 has 32 addresses but only 30 usable hosts.
  • Treating /31 as unusable. Since RFC 3021 a /31 holds two usable addresses on point-to-point links. See our /31 guide.
  • Off-by-one on the broadcast. The broadcast is the next network minus one, never the next network itself.
  • Classful thinking. 10.1.2.3/24 is a valid subnet even though 10.x was class A. Classes stopped mattering with CIDR in 1993.

The fastest way to get reliable is repetition. Try twenty questions in subnetting practice, where each wrong answer shows these same steps.

How we check this page

Every figure on this site comes from the same calculation engine as the tools, and that engine is tested on each build against more than 6,600 cases generated by Python's standard ipaddress module. Rules are taken from the RFCs and vendor documents listed under Sources. Last reviewed November 20, 2026.

Sources

  1. RFC 950: Internet Standard Subnetting Procedure
  2. RFC 4632: Classless Inter-domain Routing (CIDR)
  3. RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links