IPv4 subnet calculator (CIDR, mask & IP range)
IP Subnet Calculator
Free, no sign-up. We only fetch the public URL you enter.
Short answer
Enter an IPv4 address in CIDR notation (192.168.1.0/24) or as address plus subnet mask (10.0.0.5 255.255.255.0). The calculator returns the network address, broadcast address, subnet mask, wildcard mask, first and last host address, the number of usable hosts, the address class and whether the range is private or public. A /24 gives 256 addresses, 254 of them usable for hosts. If the servers in that range run websites, monitordefend can watch them for downtime.
- Accepts CIDR (/8 to /32) or dotted subnet mask.
- Network, broadcast, mask, wildcard, host range, usable hosts.
- Shows address class and private or public range.
Network 192.168.1.0 Broadcast 192.168.1.255 Subnet mask 255.255.255.0 Wildcard mask 0.0.0.255 Host range 192.168.1.1 – 192.168.1.254 Usable hosts 254 · Class C · private
This free IPv4 subnet calculator turns an address and a prefix into everything you need to plan a network: the network address, the broadcast address, the subnet mask in dotted notation, the wildcard mask, the first and last usable host, the number of usable hosts, the historic address class and whether the range is private or public. Type a CIDR block such as 192.168.1.0/24 or an address with a mask such as 10.0.0.5 255.255.255.0, and the result appears instantly — no sign-up, no spreadsheet, no binary arithmetic on paper.
What is a subnet calculator?
A subnet calculator is a tool that takes an IP address and a subnet mask — or the equivalent CIDR prefix — and works out the boundaries of the network that address belongs to. Instead of converting four octets into 32 bits by hand and applying a logical AND, you get the network address, the broadcast address, the usable host range and the size of the block in one step.
Network administrators use it to split a large address space into smaller subnets for departments, VLANs or server zones. Developers and DevOps engineers use it when they define virtual networks in the cloud, write firewall rules, configure Kubernetes pod and service ranges or describe infrastructure as code, where a single wrong prefix can make two networks overlap and break routing in ways that are hard to debug later.
How to use the IPv4 subnet calculator
Type the address into the field above in one of two formats. CIDR notation writes the address followed by a slash and the number of network bits, for example 192.168.1.0/24 or 10.20.0.0/16. Alternatively, write the address and the dotted subnet mask separated by a space, for example 10.0.0.5 255.255.255.0. Both formats describe the same thing, so use whichever your router, firewall or cloud console shows you.
- Address 192.168.1.77
- Prefix /26 = 26 network bits
- Network 192.168.1.64
- Hosts .65 – .126 (62 usable)
You do not need to enter the network address itself. If you type any host address such as 192.168.1.77/26, the calculator determines the block that address sits in and shows its network address, 192.168.1.64, together with all the other values. That makes it handy for answering the everyday question of which subnet a particular machine is in and which neighbours share it.
- Network address — the first address of the block, identifies the subnet
- Broadcast address — the last address, reaches all hosts in the subnet
- Subnet mask and wildcard mask — the mask in dotted form and its inverse
- First and last host — the usable IP range for devices
- Usable hosts — total addresses minus network and broadcast
- Class and private/public — the historic class and RFC 1918 status
CIDR notation and the subnet mask
Classless Inter-Domain Routing, CIDR for short, replaced the rigid class system in the 1990s. The number after the slash says how many of the 32 bits of an IPv4 address belong to the network part; the remaining bits number the hosts. A /24 therefore leaves 8 host bits, which is 2 to the power of 8, or 256 addresses.
The subnet mask expresses the same split in dotted decimal: a one for every network bit, a zero for every host bit. /24 becomes 255.255.255.0, /26 becomes 255.255.255.192 and /30 becomes 255.255.255.252. Many older devices only accept the dotted mask, while cloud platforms and routing tables almost always use the prefix, so being able to switch between the two is a daily need.
How the calculation works
Behind every result is simple binary logic. The network address is the address combined with the mask by a bitwise AND, which sets all host bits to zero. The broadcast address sets all host bits to one. Every address in between can be given to a device, which is why the first host is the network address plus one and the last host is the broadcast address minus one.
Address 11000000.10101000.00000001.01|001101 Mask 11111111.11111111.11111111.11|000000 Network 11000000.10101000.00000001.01|000000 = .64 Broadc. 11000000.10101000.00000001.01|111111 = .127
The number of usable hosts follows from the host bits: 2 to the power of the host bits, minus two for the network and broadcast addresses. A /26 has 6 host bits, so 64 addresses and 62 usable hosts. Two special cases break that rule. A /31 has only two addresses and, under RFC 3021, both may be used on point-to-point links between two routers. A /32 describes exactly one address and is used for single hosts, loopbacks and firewall rules.
The wildcard mask
The wildcard mask is the bitwise inverse of the subnet mask: zeros where the mask has ones and the other way round. For 255.255.255.0 it is 0.0.0.255, for 255.255.255.192 it is 0.0.0.63. A zero means this bit must match, a one means this bit can be anything.
You need it mainly for access control lists and routing protocols on network equipment, for example in OSPF network statements or ACL entries on enterprise routers, which expect the wildcard form rather than the subnet mask. Calculating it by hand is a common source of typos, so the calculator shows it next to the mask.
Table of typical IPv4 subnets
The table lists the prefix lengths you meet most often, with their dotted mask, the total number of addresses and the usable hosts. Halving or doubling is the rule of thumb: every additional bit of prefix halves the block, every bit less doubles it.
| CIDR | Subnet mask | Addresses | Usable hosts | Typical use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Very large network, former class A |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 | Private range 172.16.0.0/12 |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Medium network, former class B, cloud VPC |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Large cloud subnet |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Campus or large office segment |
| /24 | 255.255.255.0 | 256 | 254 | Small network, former class C, home LAN |
| /25 | 255.255.255.128 | 128 | 126 | Half of a /24 |
| /26 | 255.255.255.192 | 64 | 62 | Quarter of a /24 |
| /27 | 255.255.255.224 | 32 | 30 | Small department or VLAN |
| /28 | 255.255.255.240 | 16 | 14 | Very small subnet, small server group |
| /29 | 255.255.255.248 | 8 | 6 | Small public block from a provider |
| /30 | 255.255.255.252 | 4 | 2 | Classic point-to-point link |
| /31 | 255.255.255.254 | 2 | 2 (RFC 3021) | Router-to-router links |
| /32 | 255.255.255.255 | 1 | 1 | Single host, loopback, firewall rule |
IP address classes
Before CIDR, the first bits of an address fixed the size of its network. Class A covered 1.0.0.0 to 126.255.255.255 with a /8 mask, class B 128.0.0.0 to 191.255.255.255 with a /16, class C 192.0.0.0 to 223.255.255.255 with a /24. Class D, 224.0.0.0 to 239.255.255.255, is reserved for multicast, and class E above that for experimental use.
Classes no longer determine routing, but they are still taught, asked about in certifications and used as shorthand, which is why the calculator reports the class the address falls into. Treat it as a label, not as a statement about the real size of the network — 10.1.2.0/24 is a class A address in a block of only 256 addresses.
Private and public address ranges
RFC 1918 reserves three ranges for private networks: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. These addresses are not routed on the public internet and can be reused in any number of separate networks; devices reach the internet through network address translation. Everything else is, with a few special exceptions such as loopback 127.0.0.0/8, link-local 169.254.0.0/16 and the carrier-grade NAT range 100.64.0.0/10, public address space.
The distinction matters for security and for troubleshooting. A server that should be reachable from the internet needs a public address or a port forwarding; a database that should never be reachable from outside belongs into a private range. The calculator tells you at once which side of that line your block is on.
Subnetting in the cloud and in infrastructure as code
Cloud providers ask for CIDR blocks the moment you create a virtual network, and each subnet inside it takes a slice of that block. Plan the large block first, for example a /16 per environment, and carve /20 or /24 subnets out of it per availability zone and tier. Leave room: changing a VPC range later usually means rebuilding resources.
Note that cloud platforms often reserve more than two addresses per subnet for their own routers, DNS and future use, so the number of addresses you can actually assign may be a few lower than the calculator’s usable-host count. In Terraform or similar tools, keep the blocks in variables and check them with the calculator before applying, so that staging, production and peered networks never overlap.
Common subnetting mistakes
Most subnetting problems come from a handful of errors that are easy to avoid once you know them. A quick check with the calculator before you change a router, a firewall or a cloud network catches nearly all of them.
- Using a host address as network address in a route or ACL
- Forgetting that network and broadcast addresses cannot be assigned
- Overlapping ranges between offices, VPN peers or peered VPCs
- Mixing up subnet mask and wildcard mask on network gear
- Choosing a block too small for growth, forcing a renumbering later
Keep the services in your subnets online
A correct subnet is the foundation, but it says nothing about whether the websites running on those addresses actually answer. monitordefend checks each website’s homepage every five minutes, confirms an outage with a second attempt and sends an email. Plans start with a 7-day free trial.
Frequently asked questions
How many usable hosts are in a /24?
A /24 contains 256 addresses. The first is the network address and the last the broadcast address, so 254 addresses remain for hosts, from .1 to .254.
What is the subnet mask for /27?
A /27 corresponds to 255.255.255.224. It contains 32 addresses, 30 of them usable, and its wildcard mask is 0.0.0.31.
Can I enter a host address instead of the network address?
Yes. The calculator works out the block any address belongs to. 192.168.1.77/26, for example, lies in the network 192.168.1.64 with the broadcast address 192.168.1.127.
Why does a /31 show two usable hosts?
On point-to-point links between two routers, RFC 3021 allows both addresses of a /31 to be used, because no network or broadcast address is needed there.
Does the calculator support IPv6?
This page handles IPv4. For IPv6 prefixes such as 2001:db8::/48, use the IPv6 subnet calculator.
Related pages
Monitor the websites in your network
Start for free and set up your first check in minutes.
Start for free