Subnet calculator (IPv4 & IPv6)
Calculate any IPv4 or IPv6 subnet: network address, netmask, wildcard, broadcast, usable host range and address count. Type a CIDR such as 192.168.1.0/24 or 2001:db8::/48. Results update as you type.
Result
How subnetting works
An IPv4 address is 32 bits, and an IPv6 address is 128 bits. A subnet splits those bits in two: the first n bits (the prefix) identify the network, and the remaining bits identify individual hosts on it. The prefix length after the slash in CIDR notation tells you where the split is. In 192.168.1.0/24, the first 24 bits (192.168.1) are the network, and the last 8 bits give 28 = 256 addresses. For IPv4 the first address is the network address and the last is the broadcast address, so a /24 has 254 usable hosts. Each extra prefix bit halves the subnet, and each bit less doubles it.
IPv4 subnet cheat sheet
| Prefix | Netmask | Addresses | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 |
| /32 | 255.255.255.255 | 1 | 1 |
Private ranges and special blocks
The calculator tells you what kind of block you entered. Private ranges (RFC 1918) are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are used inside homes and offices and never routed on the internet. 100.64.0.0/10 is reserved for carrier-grade NAT; if your router’s WAN address is in it, you are behind CGNAT. In IPv6, fc00::/7 is unique local (private), fe80::/10 is link-local and 2000::/3 is global unicast. Read more in public vs private IP addresses.
IPv6 subnetting in practice
IPv6 subnetting is simpler than IPv4 because addresses are plentiful. Every LAN gets a /64, which is 18 quintillion addresses, and that size is required for automatic address configuration (SLAAC). Your ISP typically delegates a /56 (256 LANs) or a /48 (65,536 LANs) to your router. There is no broadcast address in IPv6; multicast replaces it. When you enter an IPv6 prefix, the calculator shows how many /64 networks it contains. New to IPv6? Start with what IPv6 is.
Worked example
Say you need four networks of up to 60 devices each, carved out of 192.168.10.0/24. 60 hosts plus network and broadcast needs at least 62 addresses, so a /26 (64 addresses, 62 usable) fits. The four /26 networks are 192.168.10.0/26, .64/26, .128/26 and .192/26. Enter 192.168.10.64/26 above and you’ll see hosts .65 to .126 with broadcast .127.
Frequently asked questions
How many hosts are in a /24?
A /24 IPv4 subnet has 256 addresses. Two are reserved for the network and broadcast addresses, leaving 254 usable hosts. A /25 has 126 usable, a /26 has 62, a /27 has 30, a /28 has 14, a /29 has 6 and a /30 has 2.
What is CIDR notation?
CIDR notation writes a network as an address followed by a slash and the prefix length, e.g. 192.168.1.0/24. The prefix length is the number of leading bits that identify the network; the remaining bits identify hosts.
What is a subnet mask?
A subnet mask is the prefix length written as an address: /24 is 255.255.255.0, /16 is 255.255.0.0. A wildcard mask is its inverse (0.0.0.255) and is used in router ACLs.
Why do /31 and /32 have no broadcast address?
RFC 3021 allows /31 for point-to-point links, where both addresses are usable hosts. A /32 is a single host route. Neither reserves network or broadcast addresses.
What IPv6 subnet size should I use?
Use /64 for every LAN segment: SLAAC address auto-configuration requires it. ISPs typically delegate a /48 or /56 to a site, which contains 65,536 or 256 /64 subnets respectively.
More network tools
- WHOIS lookup (domains, IPs, ASNs)
- DNS lookup (A, AAAA, MX, TXT, NS, CNAME, SOA)
- Reverse DNS (PTR) lookup
- IP lookup with VPN/Tor/datacenter check
- What is my IP address?
API: GET /api/subnet?cidr=10.0.0.0/22 · MCP tool subnet_calc. Calculations run in your browser and on our server; nothing is stored.