How the subnet calculator works
The calculator finds the network containing an IP address, its address range and its size. The prefix after the slash specifies the network bits. Increasing the prefix makes the block smaller; decreasing it makes the block larger.
- 1Enter an address and prefix. Choose IPv4 or IPv6. Enter an address such as 10.0.5.70/26 or 2001:db8::1/64. IPv4 also accepts a dotted-decimal subnet mask, such as 255.255.255.192.
- 2Check the prefix. IPv4 prefixes run from /0 to /32; IPv6 prefixes run from /0 to /128. A CIDR mask must contain consecutive network bits followed by host bits, without gaps.
- 3Split the network if needed. Choose a target prefix, a required subnet count or a required address capacity. The splitter creates equal-size blocks within the parent network.
IPv4 results include the network, subnet mask, wildcard mask, broadcast address, usable host range and counts. IPv6 results show the network, range boundaries and total addresses, without a broadcast address. The binary display separates network bits from host bits, and the working shows how the boundaries are calculated.
The IPv4 subnet formulas
An IPv4 address has 32 bits, written as four decimal octets. A /26 prefix leaves six host bits, so its block contains 64 addresses.
The host formula applies to ordinary IPv4 unicast subnets through /30. The /31 and /32 cases are treated separately.
AND and OR operate bit by bit. The broadcast equation applies to ordinary IPv4 subnets.
The wildcard mask flips every subnet-mask bit. In dotted decimal, subtract each mask octet from 255. The ordinary usable range starts one address after the network and ends one before the broadcast. These arithmetic counts do not deduct gateways, DHCP exclusions or other reservations.
Worked example: 10.0.5.70/26
- Host bits: 32 − 26 = 6, giving 26 = 64 addresses.
- Subnet mask: 255.255.255.192. Wildcard mask: 0.0.0.63.
- Network: 10.0.5.64/26.
- Broadcast: 10.0.5.127.
- Usable range: 10.0.5.65 to 10.0.5.126, containing 62 host addresses.
In the last octet, 70 is 01000110 and 192 is 11000000. AND gives 01000000, or 64. Setting the six host bits to 1 gives 01111111, or 127.
Common IPv4 subnet masks
| Prefix | Subnet mask | Addresses | Usable hosts |
|---|---|---|---|
| /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 |
| /26Example | 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 on point-to-point links |
| /32 | 255.255.255.255 | 1 | 1 individual address |
RFC 3021 permits both /31 addresses as endpoints on a point-to-point link; neither is a subnet-directed broadcast. A /32 identifies one address, commonly as a host route. Do not subtract two for either case, and do not interpret the upper boundary as a broadcast address.
Divide a network into equal-size subnets
Applies to IPv4 and IPv6. The new prefix cannot be shorter than the parent prefix or exceed the address width.
Splitting a /24 into /26 blocks borrows two bits and creates four subnets. When you request a subnet count, the calculator rounds up to a power of two: requesting three equal subnets produces four available blocks. Each successive subnet starts one block size after the previous one.
For ordinary IPv4 host sizing, add two to the requested hosts, then round up to a power of two. A request for 50 hosts needs 64 addresses, so /26 fits. Select /31 or /32 deliberately for their special uses. IPv6 address-capacity sizing needs no IPv4-style two-address allowance.
| Subnet | Usable IPv4 range | Broadcast |
|---|---|---|
| 192.168.1.0/26 | 192.168.1.1 to 192.168.1.62 | 192.168.1.63 |
| 192.168.1.64/26 | 192.168.1.65 to 192.168.1.126 | 192.168.1.127 |
| 192.168.1.128/26 | 192.168.1.129 to 192.168.1.190 | 192.168.1.191 |
| 192.168.1.192/26 | 192.168.1.193 to 192.168.1.254 | 192.168.1.255 |
IPv6 ranges and address counts
IPv6 uses 128 bits. This counts addresses in the prefix, not connected devices.
For 2001:db8::1/64, the network is 2001:db8::/64 and the last address is 2001:db8::ffff:ffff:ffff:ffff. The block contains 18,446,744,073,709,551,616 addresses. IPv6 has no broadcast address, so the calculator does not subtract network and broadcast addresses. Special uses, including subnet-router anycast, still affect individual assignments.
Hexadecimal output uses lowercase and omits leading zeros. It compresses the longest run of two or more zero groups with ::, choosing the first run when tied. Mixed IPv4 syntax is accepted but displayed in hexadecimal: ::ffff:192.0.2.1 becomes ::ffff:c000:201.
Address types and special ranges
Private IPv4 ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Other special ranges include shared address space at 100.64.0.0/10, loopback at 127.0.0.0/8 and link-local at 169.254.0.0/16. A mathematically valid range does not establish permission to assign or route its addresses.
IPv6 special ranges include unspecified ::/128, loopback ::1/128, unique-local fc00::/7, link-local fe80::/10 and multicast ff00::/8. Documentation ranges include 2001:db8::/32 and 3fff::/20. IANA's registries contain further exceptions, so unlisted addresses should not automatically be labeled publicly reachable.
Legacy IPv4 class labels are historical: class A used /8, class B /16 and class C /24. The entered prefix determines the calculation, not the class label.
Check your subnet plan
- 1Allow for reservations. Include gateways, infrastructure addresses and planned growth when choosing an IPv4 host requirement.
- 2Check the parent block. Every child subnet must fit entirely inside the parent without overlapping another assigned subnet.
- 3Match the actual configuration. Use the prefix configured on the interface or supplied by your network administrator, not a guess based on the address.
Frequently asked questions
What is the subnet mask for /24?
The mask is 255.255.255.0, with 24 network bits and eight host bits. An ordinary IPv4 /24 contains 256 addresses and 254 usable host addresses.
How many hosts are in a /26?
An ordinary IPv4 /26 has 62 usable host addresses. Its 64 total addresses include the network and broadcast addresses.
How many /64 subnets fit in a /48?
A /48 contains 65,536 /64 subnets. The difference is 16 prefix bits, so the count is 216.
Does the calculator check whether an IP address is available?
No, it calculates address boundaries and capacity. It does not check active devices, DHCP leases, routing or firewall rules.
Can I create subnets of different sizes?
The splitter creates equal-size subnets in each operation. For a variable-length subnet mask plan, split a block, then split selected child blocks again without overlapping existing assignments.
Sources
- 1RFC 4632: Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan · RFC Editor · Accessed November 2026
- 2RFC 950: Internet Standard Subnetting Procedure · RFC Editor · Accessed November 2026
- 3RFC 1878: Variable Length Subnet Table For IPv4 · RFC Editor · Accessed November 2026
- 4RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links · RFC Editor · Accessed November 2026
- 5RFC 4291: IP Version 6 Addressing Architecture · RFC Editor · Accessed November 2026
- 6RFC 5952: A Recommendation for IPv6 Address Text Representation · RFC Editor · Accessed November 2026
- 7IPv4 Special-Purpose Address Space · Internet Assigned Numbers Authority · Accessed November 2026
- 8IPv6 Special-Purpose Address Space · Internet Assigned Numbers Authority · Accessed November 2026