Introduction
This IPv4 Subnet Calculator splits an IP network into smaller parts called subnets. Type an IP address, pick a subnet mask or CIDR prefix, and you get the full breakdown of that block.
You get the network address, broadcast address, usable host range, wildcard mask, and the number of hosts and subnets. You also see the IP in binary, hex, and integer form, plus its class and type (public or private).
The color-coded binary view shows which bits are network bits and which are host bits. A step-by-step section shows how each answer was found, so you can learn the method and not just copy the result. Two tables list every subnet in the block, with your subnet highlighted.
Network admins, students, and anyone studying for CCNA or Network+ can use this tool to plan IP ranges fast and check their work.
How to use our IPv4 Subnet Calculator
Type an IPv4 address and pick a subnet mask. The calculator shows the network address, usable host range, broadcast address, wildcard mask, host counts, binary breakdown, step-by-step math, and full subnet tables.
IPv4 Address: Enter the IP you want to check, like 142.93.55.87. Use four numbers from 0 to 255, split by dots.
IP Class Filter: Choose Any, A, B, or C. This sets which prefix lengths show up in the mask list. Any gives you /1 to /32.
Subnet Mask & CIDR: Pick a mask such as 255.255.255.0. The box next to it shows the matching CIDR prefix, like /24.
Hosts per Subnet: Pick how many usable hosts you need. The mask and CIDR change to match your pick.
Number of Subnets: Pick how many subnets you want inside the parent block. The mask and host count update to match.
Calculate: Click this button to see your results, charts, and subnet tables.
Clear: Click this to reset the IP, class, and mask back to the default values.
What Is IPv4 Subnetting?
An IPv4 address is the number that names a device on a network, like 142.93.55.87. It has four parts called octets, and each octet is a number from 0 to 255. Behind the scenes, the whole address is just 32 ones and zeros.
Subnetting means splitting one big block of IP addresses into smaller blocks. Each smaller block is a subnet. Networks are split this way to save addresses, cut down on extra traffic, and keep groups of devices apart for better speed and safety.
The Subnet Mask and CIDR
A subnet mask tells you which bits of the address name the network and which bits name the host (the device). Network bits come first and are always the 1 bits in the mask. Host bits come last.
CIDR notation is a short way to write the same thing. A slash and a number, like /24, means "the first 24 bits are network bits." So 255.255.255.0 and /24 mean exactly the same thing.
Key Parts of Every Subnet
- Network address: the first address in the block. All host bits are 0. It names the subnet and is not given to a device.
- Broadcast address: the last address in the block. All host bits are 1. Data sent here goes to every device in the subnet.
- Usable host range: all the addresses in between. These are the ones you can hand out to computers, phones, printers, and routers.
- Wildcard mask: the flipped version of the subnet mask. Cisco routers use it in access lists and OSPF setups.
How the Math Works
A subnet has 2(32 − prefix) total addresses. A /24 has 28 = 256 addresses. Take away the network address and the broadcast address, and you get 254 usable hosts. Two special cases break this rule: a /31 gives you 2 usable addresses for point-to-point links (RFC 3021), and a /32 is a single host.
Common Subnet Sizes
| CIDR | Subnet Mask | Total Addresses | Usable Hosts |
|---|---|---|---|
| /30 | 255.255.255.252 | 4 | 2 |
| /29 | 255.255.255.248 | 8 | 6 |
| /28 | 255.255.255.240 | 16 | 14 |
| /26 | 255.255.255.192 | 64 | 62 |
| /24 | 255.255.255.0 | 256 | 254 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
IP Classes
Older networks used classes based on the first octet. Class A runs 0 to 127 with a natural /8 mask. Class B runs 128 to 191 with a /16. Class C runs 192 to 223 with a /24. Class D (224 to 239) is for multicast and Class E (240 to 255) is reserved. Modern networks use CIDR instead, but classes still help you understand address ranges and older gear.
Private vs. Public Addresses
Public addresses work on the open Internet. Private addresses only work inside your own network and must pass through NAT to reach the Internet. The private ranges (RFC 1918) are:
- 10.0.0.0 to 10.255.255.255 (10.0.0.0/8)
- 172.16.0.0 to 172.31.255.255 (172.16.0.0/12)
- 192.168.0.0 to 192.168.255.255 (192.168.0.0/16)
Other special ranges include 127.0.0.0/8 for loopback and 169.254.0.0/16 for link-local (APIPA) addresses that show up when DHCP fails.
Other Ways to Write an IP
The same address can be shown as binary, as one big integer, in hex, as a reverse-DNS name ending in .in-addr.arpa, or mapped into IPv6 with the ::ffff: prefix. These forms show up in logs, packet captures, and config files, so it helps to recognize them.