Subnet Calculator
Enter an IP address with its prefix or subnet mask to get the network, broadcast, usable host range and wildcard, bit by bit. This IPv4 and IPv6 subnet calculator is also a CIDR calculator and subnet mask calculator: it splits networks, plans VLSM and applies cloud rules.
Type it any way you have it: CIDR, a mask or a Cisco wildcard after the address, a range with a dash, or IPv6. Drag the line between the bits to change the prefix. Nothing leaves your browser.
254 usable hosts · 192.168.1.1 – 192.168.1.254
- 1
The mask
/24 is 24 ones, then 8 zeros
mask11111111.11111111.11111111.00000000255.255.255.0 - 2
Network = address AND mask
Keep the bits where the mask has a 1
address11000000.10101000.00000001.00000000192.168.1.0ANDmask11111111.11111111.11111111.00000000255.255.255.0network11000000.10101000.00000001.00000000192.168.1.0 - 3
Broadcast = network OR wildcard
Set every host bit to 1
network11000000.10101000.00000001.00000000192.168.1.0ORwildcard00000000.00000000.00000000.111111110.0.0.255broadcast11000000.10101000.00000001.11111111192.168.1.255 - 4
Hosts = 232 − 24 − 2 = 256 − 2 = 254
The network and broadcast addresses can't be given to a device
first host 192.168.1.1last host 192.168.1.254
Shortcut. The prefix ends on an octet edge: the network keeps 3 whole octets (192.168.1) and the rest are host bits.
What is a subnet and a subnet mask?
A subnet is a block of IP addresses that share the same leading bits, and the subnet mask says how many bits that is: in 192.168.1.10 with mask 255.255.255.0, the first 24 bits (192.168.1) name the network and the last 8 bits (10) name one device on it.
Every IPv4 address is 32 bits. The mask is 32 bits too: a run of ones over the network part and zeros over the host part, never mixed (RFC 1812). Devices whose addresses share the network bits reach each other directly; anything else goes through a router.
Within a subnet, the address with all host bits zero names the network itself and the one with all host bits one is its broadcast address, so a normal subnet has two addresses fewer than its size for devices (RFC 1122). A /24 holds 256 addresses and 254 hosts.
This subnet192.168.1.0/24
- 192.168.1.1
- 192.168.1.10
- 192.168.1.11
- 192.168.1.12
Another subnet192.168.2.0/24
- 192.168.2.1
- 192.168.2.10
- 192.168.2.11

Any notationCIDR, a subnet mask, a wildcard mask, a range or IPv6, typed the way you have it.The bitsNetwork bits and host bits side by side; drag the boundary to try another prefix.The answerNetwork, broadcast, the first and last usable host and how many there are.PlanSplit the network, fit subnets of different sizes, or apply a cloud's rules.How to subnet a network in 4 steps
Pick how many subnets or hosts you need, borrow that many bits from the host part, then step through the network in blocks of the new size: 192.168.1.0/24 split into four subnets becomes four /26 blocks of 64 addresses, 62 hosts each.
1. Count: four subnets need 2 extra network bits (2² = 4), so /24 becomes /26. For a host count instead, take the smallest block that holds it: 50 hosts need 64 addresses, a /26.
2. Block size: 2^(32 − 26) = 64 addresses per subnet, which makes the mask 255.255.255.192.
3. Step through: the networks start every 64 addresses: 192.168.1.0, .64, .128 and .192.
4. Ends: in each block the first address is the network, the last the broadcast, and the hosts are in between. So for 10.67.100.77/26 the network is 10.67.100.64, the hosts run from .65 to .126 and the broadcast is .127.
SubnetFirst host – Last hostBroadcast
The same method on two exam questions
10.67.100.77/264th octet · blocks of 64- Network
- 10.67.100.64
- First usable
- 10.67.100.65
- Last usable
- 10.67.100.126
- Broadcast
- 10.67.100.127
10.67.100.0/173rd octet · blocks of 128- Network
- 10.67.0.0
- First usable
- 10.67.0.1
- Last usable
- 10.67.127.254
- Broadcast
- 10.67.127.255
Not the network address: 10.67.100.0/17 → 10.67.0.0/17
CIDR notation: what /24 means
CIDR notation writes a network as an address, a slash and the number of network bits: 192.168.1.0/24 means the first 24 bits are the network, the same as mask 255.255.255.0 (RFC 4632).
Each step of one bit doubles or halves the block: a /23 is two /24s (512 addresses), a /25 is half of one (128). A /16 holds 256 /24s, and a /8 holds 65,536 of them.
CIDR replaced the old classes A, B and C in 1993 (RFC 1519, now RFC 4632). Since then the mask can't be guessed from the first octet, so it is always written out; the calculator shows the old class only as history.
- /221,024255.255.252.04 /24s
- /23512255.255.254.02 /24s
- /24256255.255.255.01 /24
- /25128255.255.255.128½ of a /24
- /2664255.255.255.192¼ of a /24
Subnet mask cheat sheet: /0 to /32
Every IPv4 prefix with its subnet mask, wildcard mask, addresses and usable hosts. Select a row to work it out in the calculator.
Usable hosts are the addresses minus the network and the broadcast, except at /31, where both addresses are hosts on a point-to-point link (RFC 3021), and /32, a single host.
| Prefix | Subnet mask | Wildcard | Addresses | Usable hosts | Compared with a /24 |
|---|---|---|---|---|---|
| /0 | 0.0.0.0255.255.255.255 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294Every IPv4 address | 16,777,216 /24s |
| /1 | 128.0.0.0127.255.255.255 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 | 8,388,608 /24s |
| /2 | 192.0.0.063.255.255.255 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 | 4,194,304 /24s |
| /3 | 224.0.0.031.255.255.255 | 31.255.255.255 | 536,870,912 | 536,870,910 | 2,097,152 /24s |
| /4 | 240.0.0.015.255.255.255 | 15.255.255.255 | 268,435,456 | 268,435,454 | 1,048,576 /24s |
| /5 | 248.0.0.07.255.255.255 | 7.255.255.255 | 134,217,728 | 134,217,726 | 524,288 /24s |
| /6 | 252.0.0.03.255.255.255 | 3.255.255.255 | 67,108,864 | 67,108,862 | 262,144 /24s |
| /7 | 254.0.0.01.255.255.255 | 1.255.255.255 | 33,554,432 | 33,554,430 | 131,072 /24s |
| /8 | 255.0.0.00.255.255.255 | 0.255.255.255 | 16,777,216 | 16,777,214Old class A size | 65,536 /24s |
| /9 | 255.128.0.00.127.255.255 | 0.127.255.255 | 8,388,608 | 8,388,606 | 32,768 /24s |
| /10 | 255.192.0.00.63.255.255 | 0.63.255.255 | 4,194,304 | 4,194,302 | 16,384 /24s |
| /11 | 255.224.0.00.31.255.255 | 0.31.255.255 | 2,097,152 | 2,097,150 | 8,192 /24s |
| /12 | 255.240.0.00.15.255.255 | 0.15.255.255 | 1,048,576 | 1,048,574 | 4,096 /24s |
| /13 | 255.248.0.00.7.255.255 | 0.7.255.255 | 524,288 | 524,286 | 2,048 /24s |
| /14 | 255.252.0.00.3.255.255 | 0.3.255.255 | 262,144 | 262,142 | 1,024 /24s |
| /15 | 255.254.0.00.1.255.255 | 0.1.255.255 | 131,072 | 131,070 | 512 /24s |
| /16 | 255.255.0.00.0.255.255 | 0.0.255.255 | 65,536 | 65,534Old class B size | 256 /24s |
| /17 | 255.255.128.00.0.127.255 | 0.0.127.255 | 32,768 | 32,766 | 128 /24s |
| /18 | 255.255.192.00.0.63.255 | 0.0.63.255 | 16,384 | 16,382 | 64 /24s |
| /19 | 255.255.224.00.0.31.255 | 0.0.31.255 | 8,192 | 8,190 | 32 /24s |
| /20 | 255.255.240.00.0.15.255 | 0.0.15.255 | 4,096 | 4,094 | 16 /24s |
| /21 | 255.255.248.00.0.7.255 | 0.0.7.255 | 2,048 | 2,046 | 8 /24s |
| /22 | 255.255.252.00.0.3.255 | 0.0.3.255 | 1,024 | 1,022 | 4 /24s |
| /23 | 255.255.254.00.0.1.255 | 0.0.1.255 | 512 | 510 | 2 /24s |
| /24 | 255.255.255.00.0.0.255 | 0.0.0.255 | 256 | 254Old class C size | 1 /24 |
| /25 | 255.255.255.1280.0.0.127 | 0.0.0.127 | 128 | 126 | 2 per /24 |
| /26 | 255.255.255.1920.0.0.63 | 0.0.0.63 | 64 | 62 | 4 per /24 |
| /27 | 255.255.255.2240.0.0.31 | 0.0.0.31 | 32 | 30 | 8 per /24 |
| /28 | 255.255.255.2400.0.0.15 | 0.0.0.15 | 16 | 14 | 16 per /24 |
| /29 | 255.255.255.2480.0.0.7 | 0.0.0.7 | 8 | 6 | 32 per /24 |
| /30 | 255.255.255.2520.0.0.3 | 0.0.0.3 | 4 | 2 | 64 per /24 |
| /31 | 255.255.255.2540.0.0.1 | 0.0.0.1 | 2 | 2Point-to-point link | 128 per /24 |
| /32 | 255.255.255.2550.0.0.0 | 0.0.0.0 | 1 | 1Single host | 256 per /24 |
Common IPv6 prefixes
| Prefix | Typical use | Addresses | /64 subnets |
|---|---|---|---|
| /32 | An ISP's allocation | 79,228,162,514,264,337,593,543,950,336296 | 4,294,967,296 |
| /48 | A site (business) | 1,208,925,819,614,629,174,706,176280 | 65,536 |
| /56 | A site (home) | 4,722,366,482,869,645,213,696272 | 256 |
| /64 | One subnet (SLAAC) | 18,446,744,073,709,551,616264 | 1 |
| /127 | Router-to-router link | 221 | – |
| /128 | One address | 120 | – |
How many usable hosts? /30, /31 and /32
A /30 has 4 addresses and 2 usable hosts, a /31 has 2 addresses and both are usable on a point-to-point link, and a /32 is one address: a single host.
The rule 2^n − 2 holds from /0 to /30. For links between two routers, RFC 3021 allows a /31 with no network or broadcast address, which uses half the addresses of a /30. Cisco supports it on point-to-point links (Cisco).
A /32 is a host route: one address, used for loopback interfaces and single-address routes. Clouds subtract more than two addresses in every subnet, so their counts differ; see the cloud section below.
198.51.100.4/302 usable
198.51.100.4/312 usablepoint-to-point (RFC 3021)
198.51.100.4/321 usableone host
Wildcard mask: the inverse of the subnet mask
A wildcard mask is the subnet mask with every bit flipped, so 255.255.255.0 becomes 0.0.0.255: a 0 bit must match and a 1 bit is ignored. Cisco access lists and OSPF network statements take wildcard masks.
For a normal mask, the wildcard is 255.255.255.255 minus the mask: /20's 255.255.240.0 gives 0.0.15.255. In an access list, permit 10.1.0.0 0.0.255.255 matches every address from 10.1.0.0 to 10.1.255.255 (Cisco).
Type a wildcard after an address (10.1.0.0 0.0.255.255) and the calculator reads it as the matching prefix, /16.
- Must match
- Any value
Matches 10.1.0.0 to 10.1.255.255
| /8 | 255.0.0.0 | 0.255.255.255 |
|---|---|---|
| /16 | 255.255.0.0 | 0.0.255.255 |
| /20 | 255.255.240.0 | 0.0.15.255 |
| /24 | 255.255.255.0 | 0.0.0.255 |
| /27 | 255.255.255.224 | 0.0.0.31 |
VLSM: subnets of different sizes in one network
Variable-length subnet masking (VLSM) gives each subnet only the size it needs: in one /24, a Wi-Fi network of 100 hosts gets a /25, an office of 50 a /26, servers a /27 and a router link a /30, with addresses left over.
This VLSM calculator places the largest subnet first and each next one at the following free address, so every block starts on a boundary of its own size and nothing overlaps. Routers have had to support masks of different lengths in one network since RFC 1812 (1995).
It reports how many addresses the plan uses and how many hosts it serves, lists the free blocks that remain, and names the subnet that doesn't fit when the network is too small.
- Wi-Fi100 hosts
192.168.1.0/25192.168.1.1 – 192.168.1.126 - Office50 hosts
192.168.1.128/26192.168.1.129 – 192.168.1.190 - Servers20 hosts
192.168.1.192/27192.168.1.193 – 192.168.1.222 - Router link2 hosts
192.168.1.224/30192.168.1.225 – 192.168.1.226 - Free
192.168.1.228/30 · 192.168.1.232/29 · 192.168.1.240/28
228 of 256 addresses used, 28 free
IPv6 subnetting: /48, /56 and /64
In IPv6 a subnet is normally a /64, and sites get a /48 (65,536 subnets) or a /56 (256 subnets) to divide. There is no broadcast address: only the Subnet-Router anycast address and the top 128 interface IDs, kept for anycast, are set aside.
A /64 is the size automatic addressing (SLAAC) needs: the last 64 bits are the device's interface ID (RFC 4291, RFC 7421). Longer prefixes are valid (RFC 7608), and a /127 is the IPv6 version of a /31 for links between routers (RFC 6164).
RIPE's best practice for ISPs is a /48 for businesses and a /48 or /56 for homes, and it strongly discourages anything longer than a /56 (RIPE-690). Subnet on 4-bit boundaries (/52, /56, /60) so each subnet is whole hex digits and reverse DNS delegates cleanly. The IPv6 Subnet Calculator plans those levels for you: sites, buildings and VLANs on whole hex digits, with a reserve for growth.
| Prefix | Bits to /64 | /64s inside | Addresses |
|---|---|---|---|
| /32 | 32 | 4,294,967,296 | 79,228,162,514,264,337,593,543,950,336296 |
| /48 | 16 | 65,536 | 1,208,925,819,614,629,174,706,176280 |
| /56 | 8 | 256 | 4,722,366,482,869,645,213,696272 |
| /64 | 0 | 1 | 18,446,744,073,709,551,616264 |
Cloud subnets: why a /24 in AWS has 251 usable addresses
AWS and Azure keep 5 addresses in every subnet, Google Cloud keeps 4 and Oracle Cloud 3, so a /24 has 251 usable addresses in AWS or Azure, 252 in Google Cloud and 253 in Oracle Cloud.
AWS keeps the network address, +1 for the VPC router, +2 for DNS, +3 for future use and the last address, and allows subnets from /16 to /28 (AWS). Azure keeps the network, the gateway, two addresses for Azure DNS and the last, from /2 to /29 (Azure).
Google Cloud keeps the first two and the last two addresses of a primary range, from /4 to /29, and none in secondary ranges (Google Cloud). Oracle Cloud keeps the network, the gateway and the last address, from /16 to /30 (Oracle). Choose a cloud in the calculator to apply its rules to a split or a VLSM plan.
AWS251 usable
.0network.1router.2DNS.3future250 more.254.255lastAzure251 usable
.0network.1gateway.2DNS.3DNS250 more.254.255lastGoogle Cloud252 usable
.0network.1gateway.2.3250 more.254future.255lastOracle Cloud253 usable
.0network.1gateway.2.3250 more.254.255last
- Network address
- Router or gateway
- DNS
- Future use
- Last address
Private and special IP ranges
Private networks use 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918); internet providers' carrier-grade NAT uses 100.64.0.0/10, and other blocks are kept for loopback, link-local, documentation, benchmarking and multicast.
The calculator checks the whole block against IANA's special-purpose registries (IPv4, IPv6), not only its first address. 10.0.0.0/7 is half private and half public, and 172.0.0.0/11 includes the private 172.16.0.0/12, so the calculator says what each one contains.
172.16.0.0/12 runs to 172.31.255.255, not only 172.16.x.x. 100.64.0.0/10 is not a private range like the others: it is meant only for the link between a provider's NAT and its customers (RFC 6598).
- Private
- Carrier-grade NAT
- Loopback and link-local
- Documentation and benchmarking
- Multicast
- Reserved
0.0.0.0/8This network16,777,216 addresses10.0.0.0/8Private16,777,216 addresses100.64.0.0/10Carrier-grade NAT4,194,304 addresses127.0.0.0/8Loopback16,777,216 addresses169.254.0.0/16Link-local65,536 addresses172.16.0.0/12Private1,048,576 addresses192.0.2.0/24Documentation256 addresses192.168.0.0/16Private65,536 addresses198.18.0.0/15Benchmarking131,072 addresses198.51.100.0/24Documentation256 addresses203.0.113.0/24Documentation256 addresses224.0.0.0/4Multicast268,435,456 addresses240.0.0.0/4Reserved268,435,456 addresses
Subnet calculator: questions and answers
How many usable hosts are in a /24?
What is the subnet mask for /27?
How do I find the subnet prefix length from a subnet mask?
How do I find the network address from an IP address and mask?
Why does a /31 have two usable hosts?
Can I use subnet zero and the all-ones subnet?
What's the difference between a subnet mask and a wildcard mask?
How many /24 subnets fit in a /16?
What is a /64 in IPv6, and how many are in a /48?
Is what I type sent anywhere?
Missing something?Suggest a feature or a new tool
Related tools
IPv6 Subnet Calculator
Split any IPv6 prefix into /64s, plan sites and VLANs on whole hex digits, and make a ULA /48, with exact counts
IP Lookup
Look up IP address geolocation, ISP, and network details instantly
What Is My IP
Your public IPv4 and IPv6 at once, with the network, location and a VPN check
Port Checker
Test port connectivity and service availability