Home/Other Calculators & Tools/IP Subnet Calculator

IP Subnet Calculator

Free · No sign-up · Runs entirely in your browser

Find the network address, broadcast address, usable host range and host count for any IPv4 subnet — including the cloud-adjusted count and correct handling of /31 and /32.

Enter IP Address
IP Address
Subnet / CIDR
Subnet Mask
Subnet Details
Network
192.168.1.0/24
PropertyValue
⏱️ Last reviewed: 26 July 2026 · Written and reviewed by Mohsin Iqbal under our editorial policy and calculation methodology.
📖 Approx. 14 min read☁️ AWS & Azure counts🔄 Updated 26 July 2026

On this page

  1. What the Prefix Actually Means
  2. Why It Is Always a Power of Two
  3. CIDR Reference
  4. The Cloud Reserves Five, Not Two
  5. The Two Prefixes That Break the Rule
  6. How to Subnet by Hand
  7. VLSM: A Worked Allocation
  8. Private, Public and the Ranges People Forget
  9. Choosing a Private Range
  10. A Note on IPv6
  11. Segmentation and Security
  12. What Different Roles Need From This
  13. Common Mistakes
  14. Frequently Asked Questions
  15. Everything Follows From Where the Line Sits

🔑 Key Takeaways

What the Prefix Actually Means

An IPv4 address is 32 bits, usually written as four decimal numbers. The prefix after the slash says how many of those bits are fixed as the network portion — everything left over identifies individual hosts within it.

192.168.1.100/24

11000000.10101000.00000001.01100100
<———— network, 24 bits ————><— host —>

24 network bits → 8 host bits → 2⁸ = 256 addresses

That is the whole idea. Move the boundary right and you get more, smaller networks. Move it left and you get fewer, larger ones. Everything the calculator reports follows from where that line sits.

TermWhat it isIn 192.168.1.0/24
Network addressAll host bits zero — names the subnet itself192.168.1.0
Broadcast addressAll host bits one — reaches every host at once192.168.1.255
Usable rangeEverything between those two192.168.1.1 – 192.168.1.254
Subnet maskThe same prefix written as four octets255.255.255.0

Why It Is Always a Power of Two

Subnets cannot be any size you like. Each bit you take doubles or halves the block, so the sizes go 2, 4, 8, 16, 32, 64, 128, 256 and so on — never 100, never 60.

This is the single most useful thing to internalise. If you need room for 50 devices you cannot have a 50-address subnet. You take the next power of two that fits after subtracting the network and broadcast addresses: 64 addresses, a /26, giving 62 usable.

Devices neededSmallest subnetAddressesUsableSpare
2/30420
10/2816144
25/2732305
50/26646212
200/2425625454
300/23512510210
Notice the waste at 300 devices. A /24 falls 46 short, so you jump to a /23 and carry 210 unused addresses. That inefficiency is exactly why variable-length subnet masking exists: rather than giving every segment the same size, you allocate each one the smallest block that fits and use the remainder elsewhere.

CIDR Reference

The prefixes you will actually meet, with what each is normally used for.

CIDRSubnet maskAddressesUsableAWS / AzureTypical use
/8255.0.0.016,777,21616,777,21416,777,21110.0.0.0/8 private range
/12255.240.0.01,048,5761,048,5741,048,571172.16.0.0/12 private range
/16255.255.0.065,53665,53465,531Very large private network
/20255.255.240.04,0964,0944,091Large enterprise block
/22255.255.252.01,0241,0221,019Larger campus segment
/23255.255.254.0512510507Two joined /24s
/24255.255.255.0256254251Standard LAN / home network
/25255.255.255.128128126123Half a /24
/26255.255.255.192646259Medium LAN
/27255.255.255.224323027Small LAN
/28255.255.255.240161411Small office segment
/29255.255.255.248863Tiny subnet, 6 devices
/30255.255.255.252420Router-to-router links
/31255.255.255.25422n/aPoint-to-point (RFC 3021)
/32255.255.255.25511n/aSingle host / loopback

The Cloud Reserves Five, Not Two

This catches people out constantly, and it is not in most subnetting tutorials because those predate cloud networking.

On a traditional network, two addresses per subnet are unavailable: the network address and the broadcast address. AWS and Azure both reserve five.

AddressReserved for
First (.0)Network address
Second (.1)The VPC or virtual network router
Third (.2)DNS
Fourth (.3)Reserved for future use
Last (.255)Broadcast address
So a /24 in the cloud gives you 251 usable addresses, not 254. On a small subnet the effect is severe: a /28 drops from 14 usable to 11, and a /29 from 6 to just 3. Both AWS and Azure enforce a minimum subnet size of /28 for this reason — anything smaller would have almost nothing left. Plan cloud subnets with the five-address reservation in mind, or you will size a /28 for twelve instances and find it will not take them.

The calculator above shows both figures so you can see the difference at a glance.

The Two Prefixes That Break the Rule

The "subtract two" formula fails at the very small end, and these are exactly the prefixes network engineers use most often on infrastructure links.

PrefixAddressesUsableWhy
/3042The conventional choice for router-to-router links — but half the block is wasted on network and broadcast
/3122RFC 3021 defines this for point-to-point links. There is no broadcast on a link with exactly two endpoints, so both addresses are usable
/3211A single host — used for loopback interfaces, host routes and firewall rules matching one address
A /31 halves your address consumption on point-to-point links. A router with fifty such links using /30s consumes 200 addresses to carry 100 endpoints. The same links on /31s consume 100. Most modern routing platforms support /31 on point-to-point interfaces, and it is standard practice in service provider networks. Many subnet calculators still report zero usable hosts for a /31, which is the pre-RFC 3021 answer.

How to Subnet by Hand

Worth knowing even with a calculator, because it is on every networking exam and because it makes the results intuitive rather than magical.

Example: what subnet does 172.16.34.7/20 belong to?

StepWorkingResult
1. Find the interesting octet/20 falls in the third octet (bits 17–24)Third octet
2. Bits used in that octet20 − 16 = 4 bitsMask 11110000 = 240
3. Block size256 − 24016
4. Count up in blocks of 160, 16, 32, 48, 64…34 falls inside the 32 block
5. Network addressThird octet = 32, host bits zero172.16.32.0
6. BroadcastOne below the next block (48)172.16.47.255
7. Usable rangeBetween them172.16.32.1 – 172.16.47.254
The block size trick is the whole exam technique. Subtract the interesting octet's mask value from 256 and you get the block size; networks then fall on multiples of that number. A /26 has mask 192, so the block size is 64 and networks are at .0, .64, .128 and .192. A /28 has mask 240, block size 16, networks at .0, .16, .32 and so on. Memorise 128, 192, 224, 240, 248, 252, 254, 255 and their block sizes and you can subnet in your head.

VLSM: A Worked Allocation

Variable-length subnet masking means giving each segment the smallest block that fits, rather than the same size to everyone. Here is a single 192.168.10.0/24 divided across four segments with different needs.

SegmentCIDRNetworkUsable rangeBroadcastHosts
Guest Wi-Fi/25192.168.10.0192.168.10.1 – 192.168.10.126192.168.10.127126
Sales/26192.168.10.128192.168.10.129 – 192.168.10.190192.168.10.19162
HR/27192.168.10.192192.168.10.193 – 192.168.10.222192.168.10.22330
Servers/28192.168.10.224192.168.10.225 – 192.168.10.238192.168.10.23914
Unallocated/28192.168.10.240192.168.10.255reserved for growth
The rule that makes it work: allocate largest first. Every subnet must start on a boundary that is a multiple of its own size — a /26 can begin at .0, .64, .128 or .192, but never at .32. Assign the small segments first and you fragment the space so the large one no longer fits anywhere. Working down from biggest to smallest, each block lands naturally on its boundary.

Four segments, 240 of 256 addresses used, and a spare /28 left for growth. Compare that with the alternatives:

ApproachResult
VLSM (above)Fits in one /24 with 16 addresses spare
Equal /26 to every segmentExactly 256 addresses — but Guest Wi-Fi needs 126 hosts and a /26 provides 62. Does not fit
Equal /25 to every segmentWorks, but consumes 512 addresses — a whole /23 for the same four segments

That is the entire argument for VLSM: the same requirement in half the address space, with room left over. Run each network above through the calculator to check the boundaries yourself.

Private, Public and the Ranges People Forget

RangePurpose
10.0.0.0/8Private (RFC 1918) — 16.7 million addresses
172.16.0.0/12Private (RFC 1918) — 1 million addresses
192.168.0.0/16Private (RFC 1918) — 65,536 addresses
100.64.0.0/10Carrier-grade NAT (RFC 6598) — many ISPs use this
169.254.0.0/16Link-local (APIPA) — what you get when DHCP fails
127.0.0.0/8Loopback — localhost
224.0.0.0/4Multicast
0.0.0.0/8This network / unspecified
Two of those cause most of the confusion. If your device shows a 169.254.x.x address, DHCP failed and the device assigned itself a link-local address — it will talk to other machines on the same wire and nothing else. And if your router's external address is in 100.64.0.0/10, you are behind carrier-grade NAT: your ISP is sharing one public address among many customers, which is why port forwarding and hosting services from home will not work no matter how you configure the router.

Private ranges are not routable on the public internet. Anyone can use them internally, which is why 192.168.1.0/24 appears in millions of homes simultaneously without conflict — NAT translates them to a public address on the way out.

Choosing a Private Range

RangeBest forWatch out for
10.0.0.0/8Enterprises and cloud VPCs — 16.7 million addresses and room for clean hierarchyOverlap when merging networks or connecting VPNs
172.16.0.0/12Mid-size networks. Less commonly used, so less likely to collideThe range is 172.16–172.31, not 172.16–172.255
192.168.0.0/16Homes and small offices192.168.0.0/24 and 192.168.1.0/24 are router defaults — guaranteed to clash over VPN
If you will ever use a VPN, avoid the defaults. When your home network and the office network are both 192.168.1.0/24, the VPN cannot route between them — the machine has no way to tell which 192.168.1.50 you mean. Pick something unlikely, such as 192.168.147.0/24 or a slice of 10.0.0.0/8, and the problem never arises.

A Note on IPv6

This calculator handles IPv4 only. IPv6 works differently enough that most of the arithmetic above does not carry across.

IPv4IPv6
Address size32 bits128 bits
Total addresses~4.3 billion~3.4 × 1038
Written as192.168.1.12001:0db8:85a3::8a2e:0370:7334
Typical LAN subnet/24 — 254 hosts/64 — always, regardless of host count
Broadcast addressYes, the last address in the subnetNone at all
Private addressingRFC 1918 ranges plus NATUnique local addresses (fc00::/7); NAT generally unnecessary
Address assignmentDHCP or staticSLAAC, DHCPv6 or static
IPv6 has no broadcast address. Where IPv4 shouts at every host on the subnet, IPv6 uses multicast — traffic reaches only the devices subscribed to a particular group. That removes a whole class of broadcast noise, and it is why the "subtract two" rule has no IPv6 equivalent: there is no broadcast address to subtract.

IPv6 subnets are essentially always /64, whether the segment holds four devices or four thousand. A /64 contains more addresses than the entire IPv4 internet, so there is no reason to subdivide further — and stateless address autoconfiguration depends on that 64-bit boundary. Address conservation, which drives most IPv4 subnetting decisions, simply is not a consideration.

Segmentation and Security

Subnetting is not only about address efficiency. It is the foundation of network segmentation, which limits how far an intrusion can spread.

What Different Roles Need From This

RoleThe question being answered
Network administratorSizing VLANs per department, and checking a proposed subnet does not overlap an existing one
Cloud engineerPlanning VPC and virtual network CIDR blocks — where the five-address reservation and the /28 minimum both bite
DevOps engineerWriting CIDR blocks into Terraform or CloudFormation, and carving a VPC range into non-overlapping subnets across availability zones
Security professionalDefining segmentation boundaries, and writing firewall rules against ranges rather than individual hosts
Systems administratorDiagnosing why a server cannot reach a resource — usually a mask mismatch or a gateway outside the local range
CCNA and Network+ studentsChecking hand-worked answers, and practising the block-size method against a reliable reference
Home lab and self-hostersSplitting a home network so IoT devices and guests cannot reach the machines that matter

Common Mistakes

  1. Forgetting the cloud reserves five addresses. A /28 gives 14 usable on-premises but only 11 in AWS or Azure.
  2. Applying "minus two" to /31 and /32. A /31 point-to-point link has two usable addresses; a /32 has one.
  3. Sizing a subnet to the exact device count. Subnets come in powers of two, and networks grow. Fifty devices needs a /26, not a hypothetical /25-and-a-bit.
  4. Using 192.168.0.0/24 or 192.168.1.0/24 on anything that will use a VPN. Both are router defaults and will collide with the remote network.
  5. Assigning the network or broadcast address to a device. The first and last addresses in a subnet are not available for hosts.
  6. Thinking 172.16.0.0/12 runs to 172.255. It stops at 172.31.255.255. Anything above that is public address space belonging to somebody else.
  7. Treating classful A/B/C as current. CIDR replaced it in 1993. It survives in exam questions and in habits, not in how addresses are actually allocated.

Frequently Asked Questions

What is CIDR notation?

CIDR notation writes the subnet mask as a slash and the number of network bits, so 192.168.1.0/24 means the first 24 bits identify the network and the remaining 8 identify hosts. It replaced the old classful system in 1993, allowing networks to be any size rather than fixed at class A, B or C boundaries.

How many hosts are in a subnet?

Take 2 to the power of the host bits, then subtract two for the network and broadcast addresses. A /24 has 8 host bits, so 256 addresses and 254 usable. A /26 has 6 host bits: 64 addresses and 62 usable. The exceptions are /31, which has two usable addresses under RFC 3021, and /32, which is a single host.

Why does AWS give fewer usable addresses than my calculation?

AWS and Azure both reserve five addresses in every subnet rather than two — the network address, the router, DNS, one held for future use, and the broadcast address. A /24 therefore provides 251 usable addresses instead of 254, and a /28 provides 11 instead of 14. Both platforms enforce /28 as the smallest permitted subnet because of it.

What is a /24 subnet?

A /24 uses 24 bits for the network and 8 for hosts, giving 256 total addresses with 254 usable. Its subnet mask is 255.255.255.0. It is the most common size for home and small office networks — 192.168.1.0/24 is the default on a great many consumer routers.

What is a /30 subnet used for?

A /30 provides four addresses with two usable, which is exactly enough for a link between two routers. It has traditionally been the standard choice for point-to-point connections, though a /31 does the same job using half the addresses and is now widely supported.

Can a /31 subnet be used?

Yes, on point-to-point links. RFC 3021 recognises that a link with exactly two endpoints has no need for a broadcast address, so both addresses in a /31 are usable. Most modern routing platforms support it, and it is common in service provider networks. Older calculators report zero usable hosts for a /31 because they predate the standard.

What is the difference between a network address and a broadcast address?

The network address has all host bits set to zero and identifies the subnet itself — it is what appears in routing tables. The broadcast address has all host bits set to one and reaches every host on that subnet simultaneously. Neither can be assigned to a device, which is why usable hosts is two fewer than total addresses.

What are the private IP ranges?

RFC 1918 defines three: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are not routable on the public internet, so anyone can use them internally. Note that 172.16.0.0/12 covers 172.16 through 172.31 only — addresses above 172.31 are public space belonging to someone else.

Why is my IP address 169.254.something?

That is a link-local address, assigned automatically when a device cannot reach a DHCP server. It lets the device communicate with others on the same physical network segment but nothing beyond it. Seeing one usually means the DHCP server is down, the cable or wi-fi connection has a problem, or the device is on the wrong network.

What is 100.64.0.0/10?

It is the carrier-grade NAT range from RFC 6598, used by ISPs to share a single public address among many customers. If your router's external address falls in this range you do not have a genuinely public IP, which means inbound connections, port forwarding and hosting services from home will not work regardless of your router settings.

Are IP classes A, B and C still relevant?

Not for how addresses are actually allocated — CIDR replaced classful addressing in 1993 because rigid class boundaries wasted enormous amounts of address space. The terminology persists in certification exams, in documentation and in engineers' habits, so it is worth recognising, but no modern network is designed around it.

How do I subnet without a calculator?

Find the octet the prefix falls in, subtract the mask value in that octet from 256 to get the block size, then count up in blocks until you pass your address. For 172.16.34.7/20 the mask octet is 240, so the block size is 16, and counting 0, 16, 32, 48 shows that 34 sits in the 32 block — network 172.16.32.0, broadcast 172.16.47.255.

Everything Follows From Where the Line Sits

Network address, broadcast address, host range and host count all fall out of one decision: how many bits belong to the network. Get comfortable with that and subnetting stops being memorisation.

Two things to carry away that most tutorials skip: the cloud reserves five addresses per subnet rather than two, and /31 and /32 do not follow the minus-two rule.

For other tools in this section, the bandwidth calculator covers transfer times and data usage, and the password generator creates strong credentials for the devices you are configuring.

🌐 Internet & Tech Tools

IP Subnet Calculator — CIDR, network and host ranges (this page) Password Generator — strong random passwords Bandwidth Calculator — transfer times and data usage Base64 Encoder / Decoder URL Encoder / Decoder

📋 References & Further Reading

RFC 1519 — Classless Inter-Domain Routing (CIDR) RFC 1918 — Address allocation for private internets RFC 3021 — Using 31-bit prefixes on IPv4 point-to-point links RFC 6598 — IANA reserved address space for carrier-grade NAT