A prefix splits 32 bits in two: network = IP AND mask, and usable hosts = 2^(32 − prefix) − 2. Enter an address and a prefix for the network address, broadcast, first and last host, wildcard and mask — plus the bits themselves with the network/host boundary drawn on, a block splitter, and the full /0 to /32 chart.
Paste a whole CIDR block and it will split itself
How many of the 32 bits identify the network
Type a dotted-decimal mask and the prefix follows
192.168.1.0 names the network and 192.168.1.255 is the broadcast, so neither can be given to a machine.
An IPv4 address is not really four numbers. It is one 32-bit integer that we write in four chunks of eight bits because that is easier to say out loud. Subnetting is the act of drawing a line through those 32 bits: everything on the left names a network, everything on the right names a host inside it. Move the line and you trade network count against host count — that is the whole subject.
The mask is how a machine finds that boundary without being told where it is. It is 32 bits of solid ones followed by solid zeros, and it is used with one operation: bitwise AND. AND returns one only when both inputs are one, so ANDing an address with a mask keeps the network bits and wipes the host bits to zero. What is left is the network address.
| Address bit | Mask bit | AND |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Four steps take you from an address and a prefix to every number a router cares about. None of them need a calculator once the powers of two are familiar.
Write n ones, then 32 − n zeros, and read the result back in octets. A prefix that is not a multiple of eight leaves one octet part-full — that is the only one worth thinking about.
Every host bit becomes zero and every network bit survives. The result is the network address — the name of the subnet, and the address you write in a routing table.
The top of the block is the directed broadcast. Equivalently, add 2^(32 − n) − 1 to the network address, or OR the wildcard mask onto it. Both give the same answer.
The block holds 2^(32 − n) addresses. Take out the network and broadcast and the rest are assignable, running from one above the network to one below the broadcast.
The exam question, done the long way once so the shortcut makes sense: take a /24, borrow bits from the host side, and enumerate the subnets that fall out. Every figure below is computed by the same code the calculator above runs on.
The network is 192.168.10.0/24. Twenty-four ones in the mask means the first three octets are fixed and the last eight bits are yours to hand out.
Each bit you move from the host side to the network side doubles the number of subnets. Four subnets needs two bits, because two bits count to four. Always round up to the next power of two — you cannot borrow half a bit.
The prefix grows by the number of bits borrowed. Those two extra ones sit at the top of the fourth octet, which in decimal is 128 + 64 = 192.
Subtract the interesting mask octet from 256 and you have the step between consecutive subnets. That number — the block size, or magic number — is the only arithmetic you need to enumerate them.
Start at the parent network and add the block size repeatedly. Each result is a network address; the address one below the next network is that subnet's broadcast, and everything strictly between them is assignable.
| Subnet | Network | Host range | Broadcast |
|---|---|---|---|
| 1 | 192.168.10.0/26 | 192.168.10.1 – 192.168.10.62 | 192.168.10.63 |
| 2 | 192.168.10.64/26 | 192.168.10.65 – 192.168.10.126 | 192.168.10.127 |
| 3 | 192.168.10.128/26 | 192.168.10.129 – 192.168.10.190 | 192.168.10.191 |
| 4 | 192.168.10.192/26 | 192.168.10.193 – 192.168.10.254 | 192.168.10.255 |
The same arithmetic across the block sizes people actually deploy — an office LAN, a router link, a campus split, a small DMZ, and four networks merged back into one. Switch tabs to watch the working move.
A single office needs addresses for laptops, printers and phones. The default private /24 is the obvious allocation and nobody has to think about masks again.
The whole last octet is host space, so the mask lines up with the dots and every address in the office shares the first three numbers.
Give it a parent block and the size you want the pieces to be. It borrows the bits, works out how many subnets that makes, and lists each one with its network, host range and broadcast address. Long lists are capped at the first sixty-four rows; the rest continue the same fixed step.
The network you have been allocated
Every piece comes out the same size
192.168.1.0/24 borrows 2 bits → 2^2 = 4 subnets of 64 addresses
| # | Network | First host | Last host | Broadcast |
|---|---|---|---|---|
| 1 | 192.168.1.0/26 | 192.168.1.1 | 192.168.1.62 | 192.168.1.63 |
| 2 | 192.168.1.64/26 | 192.168.1.65 | 192.168.1.126 | 192.168.1.127 |
| 3 | 192.168.1.128/26 | 192.168.1.129 | 192.168.1.190 | 192.168.1.191 |
| 4 | 192.168.1.192/26 | 192.168.1.193 | 192.168.1.254 | 192.168.1.255 |
Equal-size subnetting wastes space the moment your departments are different sizes. VLSM fixes it by sizing each subnet to its own requirement, largest first, packing them from the bottom of the block. The rule that makes it work: every subnet must begin on a multiple of its own size, so the big blocks have to be placed before the small ones.
| Segment | Hosts needed | Prefix | Network | Host range | Broadcast | Spare |
|---|---|---|---|---|---|---|
| Sales floor | 100 | /25 | 192.168.4.0 | 192.168.4.1 – 192.168.4.126 | 192.168.4.127 | 26 |
| Engineering | 50 | /26 | 192.168.4.128 | 192.168.4.129 – 192.168.4.190 | 192.168.4.191 | 12 |
| Operations | 25 | /27 | 192.168.4.192 | 192.168.4.193 – 192.168.4.222 | 192.168.4.223 | 5 |
| Guest Wi-Fi | 10 | /28 | 192.168.4.224 | 192.168.4.225 – 192.168.4.238 | 192.168.4.239 | 4 |
| Link to branch A | 2 | /31 | 192.168.4.240 | 192.168.4.240 – 192.168.4.241 | — | 0 |
| Link to branch B | 2 | /31 | 192.168.4.242 | 192.168.4.242 – 192.168.4.243 | — | 0 |
192.168.4.0/24 · 244 of 256 addresses allocated, 12 left for growth. An equal-size split able to hold the largest segment would need /25 blocks of 126 hosts and would run out after two.
Round the requirement up to the next power of two, then remember the two reserved addresses. Always size for the machines you will have, not the ones you have today.
| Hosts needed | Smallest prefix | Mask | Usable |
|---|---|---|---|
| 2 | /31 | 255.255.255.254 | 2 |
| 5 | /29 | 255.255.255.248 | 6 |
| 10 | /28 | 255.255.255.240 | 14 |
| 25 | /27 | 255.255.255.224 | 30 |
| 50 | /26 | 255.255.255.192 | 62 |
| 100 | /25 | 255.255.255.128 | 126 |
| 200 | /24 | 255.255.255.0 | 254 |
| 500 | /23 | 255.255.254.0 | 510 |
| 1,000 | /22 | 255.255.252.0 | 1,022 |
| 5,000 | /19 | 255.255.224.0 | 8,190 |
| 60,000 | /16 | 255.255.0.0 | 65,534 |
Nobody subnets in binary at a whiteboard. They use the block size: find the one octet the mask is neither all ones nor all zeros in, subtract that octet from two hundred and fifty-six, and you have the step between consecutive networks. Count in that step and the subnet boundaries fall out.
The complete table: the dotted-decimal mask, the wildcard mask, how many addresses the block holds, how many of those can be assigned to machines, and how it compares to a /24. All thirty-three rows, computed rather than typed.
| Prefix | Subnet mask | Wildcard mask | Addresses | Usable hosts | Relative to a /24 | Note |
|---|---|---|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 | 16,777,216 × /24 | The whole IPv4 space / default route |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 | 8,388,608 × /24 | |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 | 4,194,304 × /24 | |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 | 2,097,152 × /24 | |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 | 1,048,576 × /24 | |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 | 524,288 × /24 | |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 | 262,144 × /24 | |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 | 131,072 × /24 | |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | 65,536 × /24 | One classful class A |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 | 32,768 × /24 | |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 | 16,384 × /24 | |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 | 8,192 × /24 | |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 | 4,096 × /24 | |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 | 2,048 × /24 | |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 | 1,024 × /24 | |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 | 512 × /24 | |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | 256 × /24 | One classful class B |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | 128 × /24 | |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | 64 × /24 | |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | 32 × /24 | |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | 16 × /24 | |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | 8 × /24 | |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | 4 × /24 | |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | 2 × /24 | |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | 1 × /24 | One classful class C |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | 1/2 of a /24 | |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | 1/4 of a /24 | |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | 1/8 of a /24 | |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | 1/16 of a /24 | |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | 1/32 of a /24 | |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | 1/64 of a /24 | Classic point-to-point link |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 | 1/128 of a /24 | Point-to-point, RFC 3021 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | 1/256 of a /24 | Single host route |
/31 and /32 break the minus-two rule on purpose: a /31 is a two-address point-to-point link under RFC 3021 and a /32 is a single host route.
Not every IPv4 block is routable on the public internet. These are the reservations you will actually meet — the three RFC 1918 private ranges everyone builds on, plus the blocks that look private but are not.
| Block | Range | Addresses | Name | RFC | What it is for |
|---|---|---|---|---|---|
| 255.255.255.255/32 | 255.255.255.255 – 255.255.255.255 | 1 | Limited broadcast | RFC 919 | Reaches every host on the local link and is never routed. |
| 192.0.2.0/24 | 192.0.2.0 – 192.0.2.255 | 256 | Documentation (TEST-NET-1) | RFC 5737 | Reserved for examples and manuals so no real network is disrupted. |
| 198.51.100.0/24 | 198.51.100.0 – 198.51.100.255 | 256 | Documentation (TEST-NET-2) | RFC 5737 | A second documentation block, used when an example needs two networks. |
| 203.0.113.0/24 | 203.0.113.0 – 203.0.113.255 | 256 | Documentation (TEST-NET-3) | RFC 5737 | A third documentation block, common in RFC examples. |
| 169.254.0.0/16 | 169.254.0.0 – 169.254.255.255 | 65,536 | Link-local (APIPA) | RFC 3927 | Self-assigned when DHCP fails. Reachable only on the local link. |
| 198.18.0.0/15 | 198.18.0.0 – 198.19.255.255 | 131,072 | Benchmarking | RFC 2544 | Set aside for testing network devices, not for production traffic. |
| 172.16.0.0/12 | 172.16.0.0 – 172.31.255.255 | 1,048,576 | Private (RFC 1918) | RFC 1918 | 16 contiguous /16s. The usual choice for medium campus networks. |
| 192.168.0.0/16 | 192.168.0.0 – 192.168.255.255 | 65,536 | Private (RFC 1918) | RFC 1918 | 256 /24s. What almost every home router hands out. |
| 100.64.0.0/10 | 100.64.0.0 – 100.127.255.255 | 4,194,304 | Carrier-grade NAT | RFC 6598 | Shared address space an ISP uses between its NAT and your router. |
| 10.0.0.0/8 | 10.0.0.0 – 10.255.255.255 | 16,777,216 | Private (RFC 1918) | RFC 1918 | 16.7 million addresses. The default for large enterprise networks. |
| 127.0.0.0/8 | 127.0.0.0 – 127.255.255.255 | 16,777,216 | Loopback | RFC 1122 | Traffic never leaves the host. 127.0.0.1 is localhost. |
| 0.0.0.0/8 | 0.0.0.0 – 0.255.255.255 | 16,777,216 | This network | RFC 1122 | Only valid as a source address while a host is still learning its own. |
| 224.0.0.0/4 | 224.0.0.0 – 239.255.255.255 | 268,435,456 | Multicast | RFC 5771 | One-to-many group addresses. Not assigned to an interface. |
| 240.0.0.0/4 | 240.0.0.0 – 255.255.255.255 | 268,435,456 | Reserved (class E) | RFC 1112 | Held back for future use and dropped by most stacks. |
Before 1993 the prefix was not written down at all — it was inferred from the first few bits of the address. That system, classful addressing, allowed exactly three network sizes, and the middle one was so much bigger than most organisations needed that the address space was being burned through at an alarming rate. CIDR replaced it by making the prefix explicit and free to sit anywhere.
| Class | Leading bits | First octet | Implied prefix | Notes |
|---|---|---|---|---|
| A | 0 | 0.0.0.0 – 127.255.255.255 | /8 | 128 networks of 16,777,214 hosts each. |
| B | 10 | 128.0.0.0 – 191.255.255.255 | /16 | 16,384 networks of 65,534 hosts each. |
| C | 110 | 192.0.0.0 – 223.255.255.255 | /24 | 2,097,152 networks of 254 hosts each. |
| D | 1110 | 224.0.0.0 – 239.255.255.255 | — | Multicast — not assigned to interfaces. |
| E | 1111 | 240.0.0.0 – 255.255.255.255 | — | Reserved, never allocated for general use. |
Six facts that decide whether a subnetting answer is right, most of which are the edge cases a quick formula gets wrong.
Almost every wrong answer in a subnetting exercise is one of these six, and none of them are arithmetic slips.
IPv6 keeps CIDR notation and throws away almost everything else that makes IPv4 subnetting fiddly. The address is 128 bits rather than 32, written as eight groups of four hex digits, and the prefix means exactly what it means here: how many leading bits identify the network.
The calculator above is IPv4 only. The one habit worth carrying across: normalise to the network address before you compare anything, in either protocol.
The handful of prefixes that cover most real questions, answered in one line each.

CD interest follows A = P(1 + r/n)^(nt). Why banks quote APY and not the rate, how compounding frequency moves the total, and what breaking early costs.

To lose weight, eat fewer calories than you burn each day. Find your maintenance calories with TDEE = BMR × activity, then subtract a deficit to set a daily target. This guide works the full chain end to end.

To set macros for weight loss, start from a calorie target below your TDEE, pick a split, then convert each percentage to grams: grams = calories × percent ÷ kcal per gram. Protein stays high on a cut.