Subnet Calculator
Enter an IPv4 address and prefix length to get network, broadcast, host range, and masks instantly.
- Runs locally
- Works offline
- No uploads
Subnet calculator
About this tool
Type any IPv4 address and a prefix length (0-32) and the calculator instantly shows you the network address, broadcast address, usable host range, subnet mask, wildcard mask, and total usable hosts. You can also type a dotted subnet mask like 255.255.255.0 in the prefix field.
Everything runs locally in your browser. Nothing is sent to a server.
How CIDR works
- Prefix length: the number of fixed bits in the network portion. /24 means 24 fixed bits and 8 host bits.
- Network address: the IP address with all host bits set to 0.
- Broadcast address: the IP address with all host bits set to 1.
- Usable hosts: 2^(host bits) minus 2, because network and broadcast are reserved. For /31 and /32 special rules apply.
- Wildcard mask: the inverse of the subnet mask, used in ACLs and routing protocols.
Tips
- You can paste a full CIDR block like
10.0.0.0/8and then manually separate the IP and prefix parts into the two fields. - You can enter a dotted subnet mask (e.g.
255.255.255.0) in the prefix field instead of a number. - Use the Copy all results button to copy every value as plain text for documentation or scripts.
- /31 subnets have two addresses (both usable as point-to-point links per RFC 3021). /32 is a host route with a single address.
About the Subnet Calculator
Subnet math shows up constantly in networking work: configuring routers, writing firewall rules, setting up VPNs, or just checking whether two addresses are on the same subnet. This tool lets you enter any IPv4 address and prefix length and get all the derived values in one view, with no need to do the binary arithmetic by hand.
Network and broadcast addresses
The network address is found by ANDing the IP address with the subnet mask, zeroing out all host bits. The broadcast address is found by ORing the network address with the wildcard mask, setting all host bits to 1. Every device on the subnet must treat the broadcast address as a layer-3 multicast destination.
Usable host range
In a standard subnet the first usable host address is one above the network address and the last is one below the broadcast address. A /24 block has 256 addresses but only 254 are assignable. A /30 block has 4 addresses and 2 usable hosts, which is the smallest subnet you should normally assign to a point-to-point link (though /31 is also valid per RFC 3021).
Wildcard masks
A wildcard mask is the bitwise inverse of the subnet mask. Where the subnet mask has a 1 bit, the wildcard has a 0 (the bit must match), and vice versa. Cisco IOS uses wildcard masks in access control lists and OSPF network statements instead of subnet masks.
Frequently asked questions
What does /24 mean in an IP address?
/24 is a prefix length in CIDR notation. It means the first 24 bits of the address identify the network and the remaining 8 bits identify the host. A /24 block contains 256 addresses with 254 usable hosts.
How many hosts can a /28 subnet hold?
A /28 has a 4-bit host portion, giving 2^4 = 16 addresses. Subtract the network and broadcast addresses and you get 14 usable host addresses.
What is the difference between a subnet mask and a wildcard mask?
They are inverses of each other. A subnet mask uses 1 bits for the network portion and 0 bits for the host portion. A wildcard mask flips them: 0 bits mean "must match" and 1 bits mean "any value." For a /24 subnet the mask is 255.255.255.0 and the wildcard is 0.0.0.255.
Can I use /31 or /32 for real subnets?
Yes. /31 is defined by RFC 3021 for point-to-point links and has two addresses, both usable. /32 is a host route representing a single IP address with no broadcast, useful for loopback interfaces and null routes.