Subnet Calculator
e.g. 10.0.0.5/22 or 10.0.0.5 255.255.252.0
| 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 | |
| Total addresses | 256 | |
| Usable hosts | 254 | |
| Subnet mask | 255.255.255.0 | |
| Wildcard mask | 0.0.0.255 | |
| CIDR notation | 192.168.1.0/24 | |
| IP class | Class C (legacy) | |
| Address type | Private (RFC 1918) | |
| IP address (binary) | 11000000.10101000.00000001.00000000 | |
| Subnet mask (binary) | 11111111.11111111.11111111.00000000 |
■ network bits ■ host bits
| Requested hosts | CIDR | First host | Last host | Broadcast | Usable hosts |
|---|
Runs entirely in your browser. Nothing you enter is sent to a server.
How to use the subnet calculator
Type an IPv4 address followed by a CIDR prefix (for example 10.0.0.5/22) or a subnet mask (10.0.0.5 255.255.252.0). Results update as you type. Every value has a copy button, and the page URL updates with your input so you can bookmark or share the calculation. Use the Split / VLSM tab to divide the network into smaller subnets by count or by required hosts.
Worked example: 192.168.10.37/27
A /27 prefix means the first 27 bits are the network and the last 5 bits are hosts. 2⁵ = 32 addresses per subnet, so subnets start every 32 addresses in the last octet: .0, .32, .64, .96, and so on. The address .37 falls in the block that starts at .32.
| Field | Value |
|---|---|
| Network address | 192.168.10.32 |
| Broadcast address | 192.168.10.63 |
| Usable host range | 192.168.10.33 – 192.168.10.62 |
| Total addresses | 32 |
| Usable hosts | 30 |
| Subnet mask | 255.255.255.224 |
| Wildcard mask | 0.0.0.31 |
In binary, the last octet of the address is 001|00101. The first three bits (001) belong to the network; setting the five host bits to 0 gives the network address (.32), and setting them to 1 gives the broadcast address (.63).
How subnetting works
Network and host bits
An IPv4 address has 32 bits. The prefix length says how many of those bits identify the network; the rest identify hosts inside it. The subnet mask is the same information written as four octets: 24 ones followed by 8 zeros is 255.255.255.0.
Usable hosts: why we subtract 2
In a normal subnet, the first address (all host bits 0) is the network address and the last (all host bits 1) is the broadcast address. Neither can be assigned to a device, so usable hosts = 2ⁿ − 2, where n is the number of host bits.
/31 and /32 subnets
A /31 has only two addresses. RFC 3021 allows both to be used on point-to-point links, so this calculator shows 2 usable hosts and no broadcast. A /32 is a single address, used for loopbacks and host routes.
Subnet mask reference
| Prefix | Subnet mask | Addresses | Usable hosts |
|---|---|---|---|
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 (point-to-point) |
| /32 | 255.255.255.255 | 1 | 1 (single host) |
See the full table from /0 to /32 in the subnet cheat sheet. Each prefix links to its own page (e.g. /24 subnet).
Frequently asked questions
How do I calculate a subnet mask from a CIDR prefix?
Write as many 1 bits as the prefix length, fill the rest of the 32 bits with 0s, and convert each group of 8 bits to decimal. /26 is 11111111.11111111.11111111.11000000, which is 255.255.255.192.
How many hosts are in a /24?
256 addresses, of which 254 are usable: 192.168.1.0 is the network address and 192.168.1.255 is the broadcast address.
What is a wildcard mask?
The inverse of the subnet mask (255.255.255.255 minus the mask). Cisco ACLs and OSPF use it. The wildcard for 255.255.255.224 is 0.0.0.31.
How do I find the network address of an IP?
Do a bitwise AND of the IP and the subnet mask. For 192.168.10.37/27, the last octet is 37 AND 224 = 32, so the network is 192.168.10.32.
What subnet should I use for 50 hosts?
You need at least 52 addresses (50 + network + broadcast), so the smallest fit is a /26 with 62 usable hosts.
Is my data sent anywhere?
No. The calculator runs entirely in your browser; nothing you type leaves your device.