Subnet Calculator
Enter an IPv4 address and prefix length to find the network address, subnet mask, broadcast address, host range and number of usable hosts.
What the subnet calculator does
Enter an IPv4 address and a prefix length such as /24. The tool returns the network address, subnet mask, broadcast address, the first and last usable host, and the number of usable hosts. For 192.168.1.10/24, the network is 192.168.1.0/24, the mask is 255.255.255.0, the broadcast address is 192.168.1.255, hosts run from 192.168.1.1 to 192.168.1.254, and there are 254 usable addresses.
How IPv4 addresses work
An IPv4 address is 32 bits, written as four numbers from 0 to 255 separated by dots. The prefix length says how many of the leading bits identify the network. The rest identify the host. A /24 uses 24 bits for the network and 8 for hosts.
The subnet mask
The mask is the prefix written as an address: ones for the network bits and zeros for the host bits. A /24 is 255.255.255.0 and a /26 is 255.255.255.192. A bitwise AND of the address with the mask gives the network address.
Usable hosts
A subnet has 2 to the power of (32 − prefix) addresses. The first is the network address and the last is the broadcast, so usable hosts are two fewer. A /24 has 256 addresses and 254 usable. A /26 has 64 and 62 usable. A /30 has 4 and 2 usable, and is common for point-to-point links. The tool lists /31 as 2 hosts and /32 as 1, which follow the rules for links and single hosts.
Choosing a prefix
Count the devices you need, add room for growth, and pick the smallest subnet that fits. 50 devices need a /26, 100 need a /25 and 200 need a /24. Splitting a network into subnets separates traffic and makes security rules simpler.
Private ranges
The private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. These are not routed on the public internet, and home and office networks use them with network address translation.
Limits
The tool is for IPv4. IPv6 uses 128-bit addresses and a different layout. Always confirm settings on your own equipment.
Worked example: Breaking down 192.168.10.140/26 into network, broadcast, and host range
Suppose a network engineer assigns your VLAN the IPv4 address `192.168.10.140/26`:
- Subnet mask from `/26`: 26 leading `1` bits followed by `32 − 26 = 6` host `0` bits gives `11111111.11111111.11111111.11000000` in binary, which is `255.255.255.192` (wildcard mask `0.0.0.63`).
- Block size in the 4th octet: `2^6 = 64` addresses per `/26` subnet (`0–63`, `64–127`, `128–191`, `192–255`). Because `140` falls inside the `128–191` block:
- Network address: `192.168.10.128` (all 6 host bits = `0`).
- Broadcast address: `192.168.10.191` (all 6 host bits = `1`).
- Usable host IP range: `192.168.10.129` to `192.168.10.190` (`64 − 2 =` 62 usable hosts).
Limits and what this tool cannot do
- IPv4 CIDR only (no IPv6 `/64` or `/48` calculation): This calculator operates on 32-bit dotted-quad IPv4 addresses (`0.0.0.0` to `255.255.255.255`); it does not parse 128-bit hexadecimal IPv6 prefixes.
- Cloud provider reserved IPs (AWS, Azure, GCP): While standard RFC 950 Ethernet subnets reserve 2 addresses (network and broadcast, leaving `62` usable IPs in a `/26`), AWS VPCs, Azure VMs, and Google Cloud reserve **5 IPs per subnet** (the first 4 IPs and the last IP), leaving `64 − 5 = 59` usable instances.
- Does not check live network routing or ping reachability: All calculations are pure bitwise IP math inside your browser with zero network packets sent.
Frequently asked questions
What does /24 mean?
The first 24 bits are the network part, which gives the mask 255.255.255.0.
How many hosts are in a /26?
64 addresses, of which 62 are usable.
What is a broadcast address?
The last address of the subnet, used to reach all devices in it.
What is the difference between a subnet mask and a prefix?
They are two ways to write the same thing.
What is a /31 point-to-point subnet (RFC 3021)?
A `/31` prefix (`255.255.255.254`) has only `2^1 = 2` total addresses. Under RFC 3021, router-to-router point-to-point links dispense with network and broadcast addresses so both IPs in a `/31` can be used for the two router interfaces.
What is a /32 prefix used for?
A `/32` mask (`255.255.255.255`) has 0 host bits (`2^0 = 1` single IP address) and is used for router loopback interfaces, host-specific firewall rules, and BGP host routes.
Why do we subtract 2 from 2^(32−prefix) on standard LAN subnets?
On broadcast networks like Ethernet, the very first address in the block (all host bits 0) identifies the subnet itself in routing tables, and the very last address (all host bits 1) is the directed broadcast address sent to all nodes on that subnet.