Subnet Calculator
This free subnet calculator turns an IP address and prefix into its network address, broadcast address, usable host range and masks, for IPv4 and IPv6, right in your browser.
Works for IPv4 and IPv6. Everything is calculated in your browser, so nothing you type is sent to us.
What is a subnet?
A subnet is a block of IP addresses that share the same leading bits. The prefix length, the /24 in 192.168.1.0/24, says how many of those bits are fixed. The bits left over number the devices inside the block.
A /24 holds 256 addresses. The first one is the network address and the last one is the broadcast address, so 254 are left for devices. Each extra bit in the prefix halves the block: a /25 has 128 addresses, a /26 has 64.
CIDR notation, subnet masks and wildcard masks
CIDR notation and a subnet mask say the same thing in two ways. The mask is the prefix written out as bits, 1s for the fixed part and 0s for the rest, so /24 is 255.255.255.0 and /20 is 255.255.240.0.
A wildcard mask is the mask flipped: 0.0.0.255 for a /24. Cisco access lists and some firewall rules use it instead of the subnet mask. A mask must be one run of 1s followed by 0s, so we flag masks like 255.0.255.0 as invalid.
The /31 and /32 special cases
A /32 is a single address. You'll see it on loopback interfaces, in firewall rules for one host, and in routes to one server.
A /31 has just two addresses. RFC 3021 lets point-to-point links between two routers use both of them, with no network or broadcast address, which saves addresses. That's why we show two usable hosts for a /31.
Private, shared and reserved ranges
Some ranges never appear on the public internet. RFC 1918 sets aside 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks, which is why your home router hands out 192.168 addresses.
100.64.0.0/10 (RFC 6598) is used by internet providers for carrier-grade NAT, 169.254.0.0/16 (RFC 3927) is what a device gives itself when DHCP fails, and 127.0.0.0/8 is loopback. We label every address so you can see at a glance which kind it is.
IPv6 subnets
IPv6 subnetting works the same way with 128 bits instead of 32. A /64 is the standard size for one network, and providers usually give a whole site a /48 or a /56 to divide up.
IPv6 has no broadcast address, so we show the first and last address of the range and the total count. Addresses are written in the short form from RFC 5952: lowercase, leading zeros dropped and the longest run of zero groups replaced by ::.
Frequently asked questions
How many usable hosts are in a /24?
254. A /24 has 256 addresses, and the first (network) and last (broadcast) can't be given to a device.
How do I split a network into smaller subnets?
Enter the network and how many subnets you need. We borrow enough bits to make at least that many equal subnets, so splitting a /24 into 4 gives four /26 networks with 62 usable hosts each.
Can I really use a /31?
Yes, on point-to-point links. RFC 3021 allows both addresses of a /31 to be used on a link between exactly two devices. On a normal LAN, stick to /30 or larger.
What size IPv6 subnet should a network use?
A /64 for each network segment. Stateless address autoconfiguration (SLAAC) expects a /64, so smaller IPv6 subnets cause problems on ordinary LANs.
Is anything I type sent to a server?
No. The calculator runs entirely in your browser. You can even disconnect from the internet after the page loads and it keeps working.