Subnet Calculator
Enter any IPv4 address and CIDR prefix or subnet mask to instantly get the network address, broadcast address, usable host range, and wildcard mask.
Subnetting an IPv4 address by hand means splitting it into a network portion and a host portion, then working out where that network starts, where it ends, and which addresses in between are actually usable. This calculator does that math for you — enter an IP address and a CIDR prefix (like /26) or a dotted subnet mask (like 255.255.255.192), and it'll break down every value you'd normally have to calculate on paper.
If you're still learning how to get these values yourself rather than just checking an answer, work through the subnetting practice problems page first — it walks through the method step by step and then quizzes you on it.
| Network address | |
| Broadcast address | |
| First usable host | |
| Last usable host | |
| Usable hosts | |
| Subnet mask | |
| CIDR notation | |
| Wildcard mask | |
| Address class / type |
Binary
What each value means
- Network address — the first address in the subnet, used to identify the subnet itself. It's never assigned to a device.
- Broadcast address — the last address in the subnet, reserved for sending a message to every host on it. It's also never assigned to a device.
- Usable host range — every address between the network and broadcast address, the ones that can actually be assigned to a device.
-
Subnet mask / CIDR — two ways of writing the same thing: how many bits of the address are the network portion. A
/26prefix is the same as a255.255.255.192mask. - Wildcard mask — the inverse of the subnet mask, used by access control lists and routing protocols like OSPF instead of a normal subnet mask.
For a /30 and smaller you'll notice the usable host count is always two less than the total number of addresses — that's the network and broadcast address getting subtracted out. A /31 is a special case used for point-to-point links where both addresses are usable, and a /32 identifies a single host.
Worked example
The calculator above starts with 192.168.1.130 /26 loaded in, so here's what it did with those values. A /26 prefix is a 255.255.255.192 subnet mask, which leaves 6 host bits and puts 64 addresses in every subnet on that network. Counting up by 64 in the last octet gives subnet boundaries at 0, 64, 128, and 192 — 130 falls between 128 and 192, so it's part of the 128 subnet.
- Network address:
192.168.1.128— the start of that subnet - Broadcast address:
192.168.1.191— one less than the next subnet (192) - Usable hosts:
192.168.1.129through192.168.1.190, 62 addresses in total
Change the IP address or prefix in the fields above and hit Calculate to see the same breakdown for your own values.
Quick reference
| CIDR | Subnet mask | Usable hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /29 | 255.255.255.248 | 6 |
| /30 | 255.255.255.252 | 2 |
| /31 | 255.255.255.254 | 2 (point-to-point) |
CIDR notation vs. dotted-decimal subnet masks
A subnet mask and a CIDR prefix describe the exact same thing two different ways — both say how many of the address's 32 bits belong to the network portion. 255.255.255.192 written in binary is 26 one-bits followed by 6 zero-bits, which is exactly what /26 means. Networking gear and documentation use both interchangeably, so this calculator (and the practice problems) accept either one in the same field.
Dotted-decimal masks only ever contain the values 255, 254, 252, 248, 240, 224, 192, 128, or 0 in each octet — if you see anything else, it's not a valid subnet mask.
Public and private IP address ranges
Not every IPv4 address is routable on the public internet. RFC 1918 sets aside three ranges for private networks — the ones you'll find behind almost every home router and school network:
-
10.0.0.0–10.255.255.255(a full Class A block,10.0.0.0/8) -
172.16.0.0–172.31.255.255(172.16.0.0/12) -
192.168.0.0–192.168.255.255(192.168.0.0/16)
Everything else — outside of a handful of other reserved ranges like loopback (127.0.0.0/8) and multicast (224.0.0.0/4) — is public address space. The calculator's "Address class / type" row flags which of these an address falls into.
Frequently asked questions
What's the difference between a network address and a subnet mask?
The subnet mask defines the size of the subnet. The network address is the specific address that identifies one particular subnet of that size — it's what you get when you apply the mask to a given IP address.
Why can't I use the network or broadcast address for a device?
The network address identifies the subnet itself, and the broadcast address is reserved for sending a message to every host on it at once. Routers and switches treat both specially, so assigning either to a single device would break routing or flood traffic unexpectedly.
How many usable hosts are in a /24?
254. A /24 has 256 total addresses, minus 1 for the network address and 1 for the broadcast address.
What is a wildcard mask used for?
It's the inverse of a subnet mask, used by Cisco access control lists and routing protocols like OSPF to match a range of addresses instead of defining a subnet's boundaries.
Want to build this skill instead of just checking an answer? The subnetting practice problems page explains the manual method step by step and then generates random problems for you to work through. Once that's comfortable, VLSM practice applies the same math to fitting several differently-sized subnets into one address block.