IPv4 subnet calculator
Plug in an IPv4 address and CIDR prefix length, and you'll get back the network range, mask, broadcast, and how many hosts fit.
Results
IPv6 subnet calculator
Throw in an IPv6 address and prefix length to see the network prefix, first and last address in the subnet, and the size. Fair warning: IPv6 doesn't have broadcast addresses.
Results
How subnetting works (in plain English)
Here's the thing: a subnet is basically a way to split up IP addresses into groups. The CIDR prefix tells you how big that group is.
With IPv4, /24 means "the first 24 bits are the network part," and that leaves 8 bits for the actual hosts (256 addresses total).
IPv6 works the same way - just with bigger numbers, and you're usually dealing with way larger subnets (often /64).
CIDR Subnet Sizes Explained
CIDR (Classless Inter-Domain Routing) notation expresses a network as an IP address followed by a prefix length - for example, 192.168.1.0/24. The prefix length tells you how many bits are reserved for the network, and the remaining bits are available for hosts. The formula is simple: a /24 has 32 − 24 = 8 host bits, giving 28 = 256 total addresses and 254 usable hosts (network and broadcast are reserved).
How many IPs are in a /24, /16, or /8?
A /24 contains 256 total addresses (254 usable) and is the most common subnet in home and office networks - it maps directly to the familiar 255.255.255.0 subnet mask. A /16 contains 65,536 addresses and is often used inside large enterprises or cloud VPCs where room to grow matters. A /8 holds over 16 million addresses and is reserved for large ISPs or legacy Class A allocations like 10.0.0.0/8 used in private networks.
Small subnets: /30, /29, /28
When you only need a handful of addresses, small prefixes are the right tool. A /30 gives exactly 4 addresses (2 usable) and is the classic choice for point-to-point router links - just enough for each end. A /29 offers 8 addresses (6 usable), useful for small server clusters or DMZ segments. A /28 with 16 addresses (14 usable) works well for small VLANs, lab environments, or cloud subnets where you want to keep the blast radius small.
Special cases: /32 and /31
A /32 represents a single host - no network, no broadcast, just one IP. It is widely used in routing to advertise specific host routes, in firewall rules to target one machine, and in loopback interface configurations. A /31 is a two-address subnet defined in RFC 3021 for point-to-point links: both addresses are usable, eliminating the waste of a /30. Modern routers and cloud providers fully support /31 links.
Subnet mask vs CIDR: what is the difference?
Subnet masks and CIDR prefix lengths represent the same concept in two different formats. The mask 255.255.255.0 is identical to /24 - both mean the first 24 bits identify the network. CIDR notation is more compact and is preferred in routing protocols, cloud consoles, and firewall rules, while subnet masks still appear in older equipment and Windows network settings. This calculator supports both: enter any IP and prefix length and it will show you the corresponding subnet mask, wildcard mask, and full network range.
Wildcard masks and how they differ from subnet masks
A wildcard mask is the bitwise inverse of a subnet mask. Where a subnet mask uses 1s to mark network bits, a wildcard mask uses 0s - and 1s mark the bits that are "don't care." For /24, the subnet mask is 255.255.255.0 and the wildcard is 0.0.0.255. Wildcard masks are used heavily in Cisco ACLs and OSPF area configurations to match ranges of addresses flexibly. Use the calculator above to instantly see the wildcard mask for any prefix length.
Choosing the right subnet size
For home and small office networks, a /24 is almost always the right answer - it is simple, well-supported, and gives you 254 hosts. For cloud environments, start with the largest subnet you can justify (often a /16 for a VPC) and carve it into smaller subnets per availability zone or tier. For point-to-point links between routers, use /31 to save addresses. For loopbacks and host routes, use /32. When designing enterprise networks, plan for growth: a department that needs 50 hosts today should get a /25 (126 hosts) rather than a /26, so you have room to expand without renumbering.
What Is a Subnet Mask?
A subnet mask is a 32-bit number that divides an IP address into two parts: the network portion and the host portion. It looks like an IP address in dotted decimal notation, for example 255.255.255.0. Every device on a network uses it to determine which part of an IP address identifies the network and which part identifies the individual device.
The mask works by using binary 1s to mark the network bits and 0s to mark the host bits. 255.255.255.0 in binary is 11111111.11111111.11111111.00000000 - 24 network bits, 8 host bits - which is why it equals /24 in CIDR notation. The terms "subnet mask" and "network mask" are interchangeable; both refer to the same 32-bit value.
Subnet mask for home Wi-Fi
On home Wi-Fi networks the subnet mask is almost always 255.255.255.0 (/24), giving 254 usable addresses. Your router assigns it automatically via DHCP. To check yours: run ipconfig on Windows, or go to System Settings - Network - your Wi-Fi - Details on Mac.
How a subnet mask and IP address work together
An IP address and subnet mask always pair up. The IP address (e.g. 192.168.1.10) identifies the device; the mask (e.g. 255.255.255.0) tells it which bits belong to the network. Without a mask, a device cannot decide whether to send traffic directly to another device or route it through the gateway.
How subnet masks are used in practice
Subnet masks serve three roles: routing decisions on your device, dividing large networks into smaller subnets (subnetting), and populating router routing tables. Use the free calculator above to instantly see the network address, broadcast, usable range, and wildcard mask for any IP and prefix combination.
FAQ
How many IPs are in a /24?
A /24 contains 256 total IPv4 addresses. Typically 254 are usable hosts (network + broadcast are reserved).
What is a subnet mask?
A subnet mask is a 32-bit number that separates the network portion of an IP address from the host portion. It looks like an IP address, for example 255.255.255.0. The mask uses binary 1s to mark network bits and 0s for host bits. 255.255.255.0 is equivalent to /24 in CIDR notation.
What is the subnet mask for a home Wi-Fi network?
The subnet mask for almost all home Wi-Fi networks is 255.255.255.0, which equals /24. This gives 254 usable IP addresses. Your router assigns it automatically via DHCP.
What is the difference between a subnet mask and a network mask?
They are the same thing. Subnet mask and network mask are interchangeable terms for the 32-bit value that separates network bits from host bits in an IPv4 address.
What's the difference between CIDR and subnet mask?
They represent the same concept in different formats. CIDR uses a prefix length like /24. A subnet mask uses dotted decimal like 255.255.255.0. Both mean the first 24 bits identify the network.
How many IPs are in a /16?
A /16 contains 65,536 total IPv4 addresses with 65,534 usable hosts. The subnet mask is 255.255.0.0. It is commonly used for large enterprise networks and cloud VPCs.
What is a wildcard mask?
A wildcard mask is the bitwise inverse of a subnet mask. Where a subnet mask uses 1s for network bits, a wildcard uses 0s. For /24 the subnet mask is 255.255.255.0 and the wildcard is 0.0.0.255. Wildcard masks are used in Cisco ACLs and OSPF configurations.
Why does IPv6 have no broadcast address?
IPv6 was designed without broadcast. It uses multicast instead, and many operations that used broadcast in IPv4 work differently in IPv6.
Why do /31 and /32 look weird?
/32 is a single IPv4 address used for host routes and loopbacks. /31 has two addresses and is used for point-to-point links where both addresses are usable (RFC 3021).