IP Subnet Calculator (IPv4 CIDR)
Work out any IPv4 subnet instantly. Enter an address with a CIDR prefix or subnet mask to get the network, broadcast, usable host range, number of hosts, wildcard mask and binary view.
Subnet details
How to use the subnet calculator
- Type an IPv4 address with a prefix, like 10.0.5.20/22, or type the address and pick a subnet mask from the list.
- Read the network and broadcast addresses, the usable host range and count, and the masks.
- The binary view shows exactly which bits belong to the network and which to hosts.
Subnetting basics
An IPv4 address is 32 bits. The CIDR prefix (the number after the slash) says how many of those bits identify the network; the rest identify hosts. A /24 leaves 8 host bits, so 256 addresses, of which 254 are usable because the first is the network address and the last is the broadcast address. Each step down in prefix doubles the size: /23 is 512 addresses, /22 is 1,024.
The subnet mask is the same information written as an address: /24 is 255.255.255.0 and /26 is 255.255.255.192. The wildcard mask is its inverse, used in router access lists and OSPF configuration. Two special cases: a /31 is used for point-to-point links with two usable addresses (RFC 3021), and a /32 identifies a single host.
Private ranges for internal networks are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918). 100.64.0.0/10 is carrier-grade NAT space, 169.254.0.0/16 is link-local, and 127.0.0.0/8 is loopback. The calculator labels these automatically.
Need a different tool? Suggest it here — we read every message.
Frequently asked questions
How many hosts are in a /24?
256 addresses and 254 usable hosts.
What is 255.255.255.192 in CIDR?
/26: 64 addresses and 62 usable hosts.
Why are two addresses unusable?
The first address identifies the network and the last is the broadcast address. /31 and /32 are exceptions.
Does it support IPv6?
This calculator covers IPv4. IPv6 subnets are almost always /64 for LANs.