IPv4 Subnet Calculator
Last updated: 21 August 2026
Reviewed by Gavin ยท Research and drafting assisted by AI
IPv4 Subnet Calculator
Compute the network, broadcast, host range, subnet mask and wildcard for any IPv4 CIDR block (RFC 4632 / RFC 950). Enter either 192.168.1.0/24 or an IP plus a netmask (255.255.255.0).
IPv4 Subnet Calculator
An IPv4 subnet calculator takes an IP address and a prefix length (or dotted-quad subnet mask) and returns every property of the resulting CIDR block: the network address, the broadcast address, the first and last usable host, the total and usable host counts, the subnet mask in dotted-quad and hexadecimal, the wildcard mask, the binary mask, and the prefix length. The calculator on this page implements the rules defined in RFC 4632 (CIDR), RFC 950 (subnetting procedure), RFC 1812 (router requirements), and RFC 3021 (the special case of /31 point-to-point links). It is intended for system administrators, network engineers, cloud architects, and students preparing for certifications such as CompTIA Network+, CCNA, or AWS Advanced Networking.
How to Use
- Choose an input mode. The default is CIDR notation, where you type the IP address followed by a slash and the prefix length, for example
192.168.1.0/24. Switch to "IP + Netmask" mode to enter the address and the dotted-quad mask separately (192.168.1.0and255.255.255.0). Both modes produce identical results. - Type or paste the input. The result block updates live as you type. Validation runs in the browser; no network request is made, so the tool works offline.
- Read the result block. The top section shows the network address, broadcast address, host range, and usable-host count in a single highlighted panel. The grid below breaks out every supporting field: subnet mask (with hexadecimal and binary forms), wildcard mask, prefix length, IP class, and the address type (private, public, multicast, loopback, link-local, CGNAT, or one of the IETF-reserved ranges).
- Use the presets for fast checks. Twelve common prefix lengths (
/8through/30) and eight domain presets (RFC 1918 private space, /30 point-to-point links, cloud VPC subnets, the/0default route, host routes, and the documentation-only TEST-NET ranges) let you verify canonical examples without typing.
The Formula
Subnetting uses a 32-bit subnet mask. The mask has prefix consecutive 1-bits followed by (32 โ prefix) 0-bits. For a /24, the mask is 11111111.11111111.11111111.00000000, that is, 255.255.255.0 or 0xffffff00.
The core operations are all bitwise:
Network address = IPv4 address AND subnet mask
Wildcard mask = bitwise NOT of subnet mask
Broadcast = network address OR wildcard mask
First usable = network address + 1
Last usable = broadcast โ 1
Total addresses = 2^(32 โ prefix)
Usable hosts = 2^(32 โ prefix) โ 2 (classic RFC 950, prefix โค 30)
For /31, RFC 3021 allows both addresses to be used on a point-to-point link, there is no reserved network or broadcast address because only two devices can ever be on the link. For /32, the single address serves as both network and host (a host route).
Worked Examples
Example 1, Small office LAN. You are designing a 50-workstation office and need a single subnet. Each workstation plus the default gateway and one server gives 52 devices. With a /26 (62 usable hosts), the block 192.168.10.0/26 covers the range 192.168.10.1 through 192.168.10.62, with 192.168.10.0 as the network address and 192.168.10.63 as the broadcast. Subnet mask: 255.255.255.192. Hex mask: 0xffffffc0.
Example 2, Point-to-point router link. Two routers, R1 and R2, connect two sites. Traditional subnetting would waste two addresses per link (network and broadcast), so RFC 3021 specifies /31 to keep both addresses usable. Assign 10.10.10.0/31 to the link: usable addresses are 10.10.10.0 (R1) and 10.10.10.1 (R2). Total addresses: 2. Subnet mask: 255.255.255.254. Hex: 0xfffffffe.
Example 3, AWS VPC subnet sizing. A VPC reserves five addresses per subnet (network address, VPC router, DNS, future use, broadcast), so a /24 in an AWS VPC gives 256 โ 5 = 251 usable IPs, not 254. A /26 gives 64 โ 5 = 59, and a /28 gives 16 โ 5 = 11. If you plan to grow, choose a /23 (510 โ 5 = 505) and split later with secondary CIDR blocks if needed.
Example 4, Default route. Entering 0.0.0.0/0 returns the entire IPv4 address space. Subnet mask is 0.0.0.0, wildcard is 255.255.255.255, and the broadcast is 255.255.255.255. This represents "every destination", exactly what a router matches when it has no more-specific route.
Example 5, Documenting a host route. A loopback address is conventionally announced as /32. For 192.168.1.50/32, the network, broadcast, and only usable host are all the same address: 192.168.1.50. Subnet mask is 255.255.255.255. The result panel highlights that usable hosts = 0 (no other device can occupy this address).
Where It Shows Up
- System administration. Documenting address plans, troubleshooting "this machine can't reach that machine" tickets, verifying DHCP scopes against the actual subnet range.
- Cloud networking. Planning VPCs, subnets, route tables, and security groups on AWS, Azure, GCP, and Oracle Cloud; allocating CIDR blocks that peer without overlap.
- Network engineering. Designing campus and WAN topologies, writing ACLs and firewall rules, building prefix lists for BGP route filtering.
- DevOps and SRE. Container networking (Calico, Cilium), Kubernetes pod CIDRs (
--pod-network-cidr), service mesh sidecar addressing. - Security. Identifying suspicious source addresses (multicast, reserved, link-local), reviewing firewall configurations for off-by-one host-range errors.
- Education. CCNA, CompTIA Network+, JNCIA, and AWS Advanced Networking specialty exam preparation. Most networking curricula teach CIDR subnetting in the first weeks of study.
Common Mistakes
- Treating
/31as having 0 usable hosts. Pre-RFC 3021 textbooks do this; modern networks (and most router vendors) treat both addresses as usable on point-to-point links. The calculator shows both interpretations. - Forgetting that AWS, Azure, and GCP reserve five addresses per subnet. The calculator gives the RFC 950 count; subtract 5 for cloud VPCs (3 for GCP, 5 for Azure, 5 for AWS).
- Using
192.168.x.yfor production infrastructure reachable from the internet. Private ranges (RFC 1918) are not routable on the public internet. Public clouds assign routable CIDR blocks from their own pools. - Confusing the wildcard mask with the subnet mask. The wildcard mask is the bitwise inverse, it is
0.0.0.255for/24, not255.255.255.0. Wildcards are used in Cisco ACLs and OSPF network statements; subnet masks are used everywhere else. - Assuming a
/23has 512 usable hosts. It has 510. The2^n โ 2rule applies wheneverprefix โค 30.
Frequently Asked Questions
Q: What is the difference between a subnet mask and a wildcard mask? A: The subnet mask identifies the network portion of an address with 1-bits. The wildcard mask (used in Cisco ACLs and some routing protocols) identifies the host portion, it is the bitwise inverse of the subnet mask. For 255.255.255.0 (subnet mask), the wildcard is 0.0.0.255. Wildcards can also be non-contiguous in advanced ACL configurations, but CIDR masks are always contiguous 1-bits followed by 0-bits.
Q: How do I choose the right prefix length for my network? A: Pick the smallest prefix (largest block) that still gives you enough host bits. Count the devices you need today plus roughly 50% headroom for growth, then round up to the next power of two. For 100 devices you need 7 host bits, so use /25 (126 usable). For 500 devices you need 9 host bits, so use /23 (510 usable). For 1,000 devices you need 10 host bits, so use /22 (1,022 usable).
Q: Should I use /30 or /29 for point-to-point router links? A: Use /30 if your routers and software follow RFC 950 strictly (it gives 2 usable hosts out of 4, with the network and broadcast addresses reserved). Use /31 (RFC 3021) if both endpoints support it, it gives 2 usable hosts out of 2, with no waste, and is now the recommended choice on modern Cisco IOS, Junos, and Linux. /29 is rarely used on point-to-point links; it gives 6 usable hosts, which is wasted unless you are running a hub-and-spoke topology or running a network with redundant links.
Q: How does subnetting work inside an AWS VPC, Azure VNet, or GCP VPC? A: The math is the same, RFC 4632 CIDR, but each cloud platform reserves a small number of addresses per subnet for its own use. AWS reserves 5 (network, router, DNS, future, broadcast). Azure reserves 5. GCP reserves 4. So a /24 in AWS gives 251 usable IPs, not 254. Plan your subnet sizes accordingly and avoid overlapping CIDR blocks if you intend to peer VPCs or transit gateways.
Q: What is the special meaning of 0.0.0.0/0, 127.0.0.0/8, 169.254.0.0/16, 224.0.0.0/4, and 240.0.0.0/4? A: These five blocks are reserved by IANA and have non-routable or special-purpose meaning. 0.0.0.0/0 is the default route ("any destination"). 127.0.0.0/8 is the IPv4 loopback range, every address from 127.0.0.0 to 127.255.255.255 refers to the local host (conventionally only 127.0.0.1 is configured). 169.254.0.0/16 is link-local, used by operating systems when DHCP fails ("APIPA" on Windows). 224.0.0.0/4 is multicast (one-to-many delivery). 240.0.0.0/4 is reserved for future use and should never appear on a production network, its presence often indicates a routing loop, a misconfigured device, or a deliberate attack.
Q: How can I tell if an IP address is private or public? A: Three ranges are reserved by RFC 1918 for private networks: 10.0.0.0/8 (16,777,216 addresses), 172.16.0.0/12 (1,048,576 addresses), and 192.168.0.0/16 (65,536 addresses). Any address inside one of these blocks is private and unroutable on the public internet. The calculator's "Address type" field labels these explicitly, along with the CGNAT range (100.64.0.0/10, RFC 6598), the documentation ranges (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24), and the multicast and reserved classes.
Q: What is VLSM, and why would I use it? A: Variable Length Subnet Masking (VLSM) means using different prefix lengths inside the same parent block to match the actual number of hosts each subnet needs. A /20 (4,096 addresses) can be carved into one /21 (2,046 hosts), two /22s (1,022 hosts each), four /23s (510 hosts each), and so on. VLSM eliminates the waste of using a single prefix length for all subnets and is essential for efficient address planning in any network larger than a single site.
q: can the IPv4 Subnet Calculator, CIDR, Mask, Broadcast be used for professional or commercial purposes? a: yes, the IPv4 Subnet Calculator, CIDR, Mask, Broadcast provides mathematically correct results that are suitable for professional, commercial, and educational use. For high-stakes applications (production routing changes, security-critical firewall rules, financial-network segmentation), verify results with a second tool or a network engineer. The formulas used are well-established and validated against reference standards (RFC 950, RFC 4632, RFC 1812, RFC 3021).
For the IPv4 Subnet Calculator, CIDR, Mask, Broadcast, How often are the IPv4 Subnet Calculator, CIDR, Mask, Broadcast formulas updated? A: The formulas are based on IETF standards that have been stable for decades (RFC 950 from 1985, RFC 4632 from 2006, RFC 3021 from 2000) and rarely require updates. when standards change, the IPv4 Subnet Calculator, CIDR, Mask, Broadcast is updated to reflect the current authoritative source.
References
- RFC 4632, Classless Inter-Domain Routing (CIDR): The Internet Address Allocation and Routing Architecture (2006). Fuller, V., Li, T. https://www.rfc-editor.org/rfc/rfc4632
- RFC 950, Internet Standard Subnetting Procedure (1985). Mogul, J., Postel, J. https://www.rfc-editor.org/rfc/rfc950
- RFC 1812, Requirements for IP Version 4 Routers (1995). Baker, F. https://www.rfc-editor.org/rfc/rfc1812
- RFC 3021, Using 31-Bit Prefixes on IPv4 Point-to-Point Links (2000). Retana, A., et al. https://www.rfc-editor.org/rfc/rfc3021
- RFC 5735, Special Purpose IP Address Registries (2010). https://www.rfc-editor.org/rfc/rfc5735
- IANA IPv4 Special-Purpose Address Registry, current authoritative list. https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml