Other · Live
IPv4 subnets,
solved at the prompt.
A free IPv4 subnet calculator for network engineers. Enter any IPv4 address with a CIDR prefix or a dotted-decimal mask; get the network and broadcast addresses, the usable host range, total & usable host counts, the wildcard mask, and a bit-by-bit binary breakdown. Strict octet validation, /31 and /32 handled correctly.
Inputs
IPv4 address & mask
Mask format
- Notation
- 192.168.1.0/24
- Class
- C
- Type
- Private (RFC 1918)
network
192.168.1.0/24
192.168.1.1 – 192.168.1.254 · broadcast 192.168.1.255
Total
256
Usable
254
Mask
/24
| Network address | 192.168.1.0 |
| Broadcast address | 192.168.1.255 |
| First usable host | 192.168.1.1 |
| Last usable host | 192.168.1.254 |
| Subnet mask | 255.255.255.0 |
| Wildcard mask | 0.0.0.255 |
| CIDR notation | 192.168.1.0/24 |
| Total hosts | 256 addresses |
| Usable hosts | 254 addresses |
| IP class | C |
| IP type | Private (RFC 1918) |
binary breakdown
Field guide
How an IPv4 subnet actually works.
An IPv4 address is a 32-bit number written as four decimal octets (192.168.1.10). A subnet is a contiguous block of those addresses defined by a mask that splits each address into two parts: the network (the high bits, shared by every host in the subnet) and the host (the low bits, unique per device). CIDR notation (/24, /16, etc.) is just a count of leading 1-bits in the mask.
Network address & broadcast address
The network address is the IP with every host bit zeroed: it identifies the subnet itself and is not assignable to a device. The broadcast address is the IP with every host bit set to 1: a packet sent there reaches every host on the subnet. Both endpoints are reserved, which is why a normal subnet of total size 2^h (where h = 32 − prefix) has 2^h − 2 usable hosts.
broadcast = network OR (NOT mask)
Worked example: 192.168.1.10 / 24
With a /24 mask, the first 24 bits are the network and the last 8 are host bits, giving 256 addresses in total, 254 of them usable.
- IP ·
11000000.10101000.00000001.00001010 - Mask ·
11111111.11111111.11111111.00000000=255.255.255.0 - Network ·
192.168.1.0 - Broadcast ·
192.168.1.255 - Usable hosts ·
192.168.1.1–192.168.1.254
The /31 and /32 special cases
A /32 is a single-host route; the address identifies exactly one device, so the "first host" and "last host" are both that address itself. A /31 would normally have 0 usable hosts, but RFC 3021 repurposed it for point-to-point links between two routers: both addresses are usable, no broadcast is reserved. This calculator follows that convention.
Wildcard mask
The wildcard mask is the bitwise inverse of the subnet mask (NOT mask) and is what Cisco ACLs, OSPF area definitions, and many other configurations actually consume. For /24 it is 0.0.0.255; the zeroes mark the bits that must match exactly, the ones mark bits that don't care.
Classful addressing and why it's legacy
Pre-1993 IPv4 used five rigid classes determined entirely by the leading bits of the first octet:
- Class A: first octet 1–126 (default mask
/8) - Class B: first octet 128–191 (default mask
/16) - Class C: first octet 192–223 (default mask
/24) - Class D: 224–239, multicast
- Class E: 240–255, reserved
Classful routing was replaced by CIDR (Classless Inter-Domain Routing, RFC 4632) in 1993 because the rigid block sizes wasted enormous amounts of address space. Modern routing is purely prefix-length based; class labels survive only as a quick mental shorthand and as the label this tool reports for completeness.
Private & reserved ranges (RFC 1918 et al.)
10.0.0.0/8· private (RFC 1918)172.16.0.0/12· private (RFC 1918)192.168.0.0/16· private (RFC 1918)100.64.0.0/10· CGNAT (RFC 6598)127.0.0.0/8· loopback (RFC 1122)169.254.0.0/16· link-local APIPA (RFC 3927)224.0.0.0/4· multicast (RFC 5771)240.0.0.0/4· reserved (RFC 1112)
Calculating the host count quickly
The number of host bits is h = 32 − prefix. Total addresses = 2^h. Usable for normal subnets (≤ /30) = 2^h − 2. As prefix length grows by one, the block size halves: /24 = 256, /25 = 128, /26 = 64, /27 = 32, and so on.
How this calculator validates input
- Address must be exactly four numeric octets separated by dots; each octet must be
0–255. - CIDR prefix must be an integer
0–32. - Decimal masks must be a contiguous run of leading 1-bits followed by 0-bits; anything else (e.g.
255.0.255.0) is rejected.
Disclaimer
This is a maths tool, not a network audit. It tells you what a packet would do given the address and mask you typed; it does not know your routing table, your firewall, or whether the address you entered is actually reachable. For production network design, cross-check against your authoritative IPAM.
Reference
Subnet mask cheat sheet
CIDR prefix, dotted-decimal mask, wildcard mask, and host counts for every realistic IPv4 prefix length from /8 to /32.
| CIDR | Subnet mask | Total hosts |
|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 |
| /9 | 255.128.0.0 | 8,388,608 |
| /10 | 255.192.0.0 | 4,194,304 |
| /11 | 255.224.0.0 | 2,097,152 |
| /12 | 255.240.0.0 | 1,048,576 |
| /13 | 255.248.0.0 | 524,288 |
| /14 | 255.252.0.0 | 262,144 |
| /15 | 255.254.0.0 | 131,072 |
| /16 | 255.255.0.0 | 65,536 |
| /17 | 255.255.128.0 | 32,768 |
| /18 | 255.255.192.0 | 16,384 |
| /19 | 255.255.224.0 | 8,192 |
| /20 | 255.255.240.0 | 4,096 |
| /21 | 255.255.248.0 | 2,048 |
| /22 | 255.255.252.0 | 1,024 |
| /23 | 255.255.254.0 | 512 |
| /24 | 255.255.255.0 | 256 |
| /25 | 255.255.255.128 | 128 |
| /26 | 255.255.255.192 | 64 |
| /27 | 255.255.255.224 | 32 |
| /28 | 255.255.255.240 | 16 |
| /29 | 255.255.255.248 | 8 |
| /30 | 255.255.255.252 | 4 |
| /31 | 255.255.255.254 | 2 |
| /32 | 255.255.255.255 | 1 |