IP Subnet / CIDR Calculator
Get network, broadcast, host range, mask and wildcard for any IPv4 CIDR block.
Enter an address with /prefix, or an address and pick a mask. Dotted masks like 10.0.0.0/255.255.255.0 also work.
- CIDR notation
- Network address
- Broadcast address
- First usable host
- Last usable host
- Usable hosts
- Total addresses
- Subnet mask
- Wildcard mask
- Prefix length
- Mask in binary
- IP in binary
- Address type
Divide into smaller subnets
| # | Subnet | First host | Last host | Broadcast |
|---|
How subnetting works
An IPv4 address is 32 bits. A CIDR prefix such as /24 says how many of those bits, counted from the left, identify the network; the rest identify hosts inside it. The subnet mask is the same idea written as four octets (255.255.255.0 for /24), and the wildcard mask is its inverse, which some router access lists use. ANDing the address with the mask gives the network address; ORing it with the wildcard gives the broadcast address. Everything between them is usable by hosts, except that /31 links have no broadcast and use both addresses (RFC 3021) and a /32 is a single host. This calculator does that arithmetic for you, shows the binary so you can see the boundary, tells you whether the range is private, loopback, link-local or public, and can split the block into equal smaller subnets for VLAN or cloud planning.
Prefix lengths and host counts
| Prefix | Mask | Usable hosts |
|---|---|---|
/8 | 255.0.0.0 | 16,777,214 |
/12 | 255.240.0.0 | 1,048,574 |
/16 | 255.255.0.0 | 65,534 |
/20 | 255.255.240.0 | 4,094 |
/22 | 255.255.252.0 | 1,022 |
/24 | 255.255.255.0 | 254 |
/25 | 255.255.255.128 | 126 |
/26 | 255.255.255.192 | 62 |
/27 | 255.255.255.224 | 30 |
/28 | 255.255.255.240 | 14 |
/29 | 255.255.255.248 | 6 |
/30 | 255.255.255.252 | 2 |
/31 | 255.255.255.254 | 2 |
/32 | 255.255.255.255 | 1 |
Notes
- Usable hosts for a prefix /n is 2^(32 − n) − 2, except /31 (2 hosts) and /32 (1 host).
- RFC 1918 private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16; they are never routed on the public internet.
- Cloud providers often reserve extra addresses in each subnet (AWS reserves five), so plan with a little headroom.
- The address you type does not have to be the network address: 192.168.1.37/24 resolves to the 192.168.1.0/24 block.
Privacy
All calculations happen in your browser. The addresses you enter are not sent anywhere or stored.