Subnet Calculator
Enter an IPv4 address with a prefix or mask to get the network, broadcast, usable host range, wildcard and address type, see it in binary, and split the network into smaller subnets.
Last checked
Address
Subnet
| Network | 192.168.1.0/24 |
|---|---|
| Subnet mask | 255.255.255.0 |
| Wildcard mask | 0.0.0.255 |
| Broadcast | 192.168.1.255 |
| First host | 192.168.1.1 |
| Last host | 192.168.1.254 |
| Usable hosts | 254 |
| Total addresses | 256 |
| Address type | Private (RFC 1918) |
| Class (historic) | C |
| Address as integer | 3232235786 (0xC0A8010A) |
| Reverse DNS zone | 1.168.192.in-addr.arpa |
Is an address in this subnet?
Type an IPv4 address to see if it is inside 192.168.1.0/24.
In binary
| Address | 11000000.10101000.00000001.00001010 |
|---|---|
| Mask | 11111111.11111111.11111111.00000000 |
| Network | 11000000.10101000.00000001.00000000 |
Highlighted bits are the network part; the rest identify hosts.
Split into smaller subnets
IPv4 CIDR chart
| Prefix | Subnet mask | Wildcard | Addresses | Usable hosts |
|---|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
Usable hosts leave out the network and broadcast addresses, except /31 (two hosts on a point-to-point link, RFC 3021) and /32 (one host).
How to use it
- Type an address with a prefix, such as 10.0.0.5/20, or with a mask, such as 10.0.0.5 255.255.240.0. Drag the slider to try other prefix lengths. For IPv6 type an address such as 2001:db8::/48.
- Read the network, broadcast and host range on the right. Copy the details or a link that opens the same subnet.
- Enter the number of hosts you need to get the smallest prefix that fits, or pick a longer prefix under Split to list the smaller subnets.
What it checks and why
An IPv4 address is 32 bits. The prefix length, the number after the slash, says how many of the first bits name the network; the rest number the hosts. The subnet mask is the same thing written as an address: /24 is 255.255.255.0. The wildcard mask, used in Cisco access lists and OSPF, is the mask with every bit flipped.
In a normal subnet the first address is the network and the last is the broadcast, so a /24 has 256 addresses and 254 usable hosts. Two prefixes are different: RFC 3021 lets a /31 use both of its addresses on a point-to-point link, and a /32 is a single host. The calculator applies both rules.
Some ranges are not routed on the public internet. 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private (RFC 1918), 100.64.0.0/10 is shared address space for carrier-grade NAT (RFC 6598), 169.254.0.0/16 is link-local and 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are for documentation. The address type comes from the IANA special-purpose registry.
Classes A, B and C come from the original addressing plan and were replaced by CIDR in 1993 (now RFC 4632). They no longer decide the mask, but exams and old documentation still use them, so the class is shown as historic.
Reverse DNS zones sit on octet boundaries. A /24 has one zone, 1.168.192.in-addr.arpa for 192.168.1.0/24, but a /20 spans sixteen /24 zones, and a network smaller than a /24 has no zone of its own: RFC 2317 describes how the parent zone delegates it with names such as 64/26.1.168.192.in-addr.arpa. The calculator lists the zones that apply.
IPv6 addresses are 128 bits written as eight groups of hex digits. RFC 5952 sets the short form: lower case, no leading zeros, and the longest run of zero groups replaced by ::. A LAN is normally a /64, and a site usually gets a /48 or a /56, so the calculator shows how many /64 subnets fit. IPv6 has no broadcast address.
Specs and sources
- RFC 4632: Classless Inter-domain Routing (CIDR)
- RFC 1918: Address Allocation for Private Internets
- RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links
- RFC 2317: Classless IN-ADDR.ARPA delegation
- RFC 4291: IP Version 6 Addressing Architecture
- RFC 5952: A Recommendation for IPv6 Address Text Representation
- IANA IPv4 Special-Purpose Address Registry
Limits
- The split list shows and copies the first 256 subnets; the total count is always shown. IPv6 splits go up to 64 bits longer than the network prefix.
- IPv6 address types cover the main blocks, not every entry in the IANA IPv6 special-purpose registry.
- Variable-length subnetting (VLSM) for several different host counts at once is not planned automatically; split the space step by step instead.
- Address types cover the main special-purpose ranges, not every entry in the IANA registry.
Questions
- How many hosts are in a /24 subnet?
- A /24 has 256 addresses. The first is the network and the last the broadcast, which leaves 254 usable host addresses.
- What is the subnet mask for /26?
- 255.255.255.192. It leaves 6 host bits, so each /26 has 64 addresses and 62 usable hosts, and a /24 splits into four of them.
- How do I find the network and broadcast address?
- The network address is the IP with all host bits set to 0, the broadcast address the IP with all host bits set to 1. Type the address and prefix and the calculator shows both.
- What is a wildcard mask?
- The subnet mask with every bit inverted, so 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF network statements use it to say which bits must match.
- Is 172.20.0.1 a private IP address?
- Yes. 172.16.0.0/12 covers 172.16.0.0 to 172.31.255.255, one of the three private ranges in RFC 1918. The calculator labels the address type for any IP you enter.
- How many /24 subnets are in a /16?
- 256. Each extra prefix bit doubles the number of subnets, and a /24 is 8 bits longer than a /16, so 2 to the power of 8. Pick /24 under Split to list them.
- What is the difference between a /30 and a /31?
- A /30 has 4 addresses: network, two hosts and broadcast. A /31 has 2 addresses and, on a point-to-point link, uses both as hosts with no network or broadcast address (RFC 3021). Both give two usable hosts; the /31 wastes none.
- How many /64 subnets are in a /48?
- 65,536, because 64 minus 48 is 16 bits and 2 to the power of 16 is 65,536. Type the /48 and the calculator shows the count, or split it into /56 or /64 networks.
- Can a /31 subnet have hosts?
- Yes, on point-to-point links. RFC 3021 lets both addresses of a /31 be used as hosts, with no network or broadcast address, which saves addresses on router links.