ToolsForWeb

Subnet Calculator

Enter an IPv4 address with a CIDR prefix (192.168.1.10/24) or a dotted netmask and get the network address, broadcast address, usable host range, host count, wildcard mask and more. Handles /31 and /32 edge cases.

Loading tool…

About this tool

Enter an IPv4 address with a CIDR prefix (192.168.1.10/24) or a dotted netmask and get the network address, broadcast address, usable host range, host count, wildcard mask and binary netmask. A bare address is treated as a /32 host route, and the calculator handles /31 point-to-point and /32 edge cases that simpler tools get wrong. IPv4 only; IPv6 addressing works differently and is not covered.

When to use it

Sizing a new network segment before assigning it in a router, firewall or cloud VPC.
Checking whether two IP addresses sit in the same subnet.
Writing firewall or ACL rules and needing the exact network and wildcard mask.
Planning DHCP scopes and reserving the network, broadcast and gateway addresses.

Questions

Why does a /31 show two usable addresses and no network or broadcast?

RFC 3021 defines /31 as a special point-to-point link where both addresses are usable, so there is no reserved network or broadcast address. A /32 is a single host route and counts its one address as usable.

How many usable hosts does a /24 have?

254. A /24 has 256 total addresses; the first is the network address and the last is the broadcast address.

What is a wildcard mask?

The inverse of the subnet mask. Cisco-style access control lists take wildcards instead of netmasks: a /24 netmask of 255.255.255.0 corresponds to a wildcard of 0.0.0.255.

Why was my netmask rejected?

Netmask bits must be contiguous — 255.255.0.0 is valid, 255.0.255.0 is not. A real prefix is always an unbroken run of 1-bits, so a broken mask is a typo, and the tool says so instead of computing a nonsense network.

What does /26 mean and when would I use one?

A /26 borrows two bits from the host portion of a /24, splitting it into four equal subnets of 64 addresses each. That leaves 62 usable hosts per subnet once the network and broadcast addresses are subtracted. It is the standard size for small subnets that should not grow past a couple of dozen devices — a department VLAN, a printer segment, a small DMZ — because 254 addresses in one broadcast domain is often more noise and blast radius than the segment needs.

How do I work out the wildcard mask for a /26?

Take the netmask the tool gives you and invert each octet (255 minus the value). A /26 netmask is 255.255.255.192, so the wildcard is 0.0.0.63 — the last octet is 255 - 192. Check it against the binary row in the output: the wildcard's 1-bits are exactly the host bits. A Cisco ACL permitting one /26 then reads permit ip 192.168.1.0 0.0.0.63.

Why do I get fewer usable hosts in AWS, Azure or GCP than the tool says?

The tool computes the mathematical answer, but cloud providers reserve addresses inside every subnet — and their reservation counts already include the network and broadcast addresses the tool subtracts. AWS and Azure hold five per subnet, GCP four, so a /24 that shows 254 usable here gives you 251 in AWS or Azure and 252 in GCP. Budget for the reservation when sizing VPC subnets — a /26 sized to 62 usable hosts leaves you 59 or 60 in practice.

How do I split a /24 into smaller subnets?

Pick the number of bits that matches how many pieces you need: one borrowed bit gives two /25s, two bits give four /26s, three give eight /27s. Each piece is 2^(32-prefix) addresses, and the network addresses land on that size — a /26 always starts at a multiple of 64 (.0, .64, .128, .192). Enter the original address with the new prefix in the tool to see each range, or calculate 192.168.1.64/26 directly to check one piece.

Related tools