- Home
- Tools
- Network Tools
- Subnet Calculator
Subnet Calculator
Network address, broadcast, host range and mask for an IPv4 address in CIDR notation.
With or without a prefix: 192.168.1.10/24
Network in CIDR notation
192.168.1.0/24
254 usable hosts, from 192.168.1.1 to 192.168.1.254.
- 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
- Usable hosts
- 254
- Total addresses
- 256
- Subnet mask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- IP class
- C, default mask /24
- Address type
- Private (RFC 1918), in 192.168.0.0/16
In binary
- Address
- 11000000.10101000.00000001.00001010
- Mask
- 11111111.11111111.11111111.00000000
- Network
- 11000000.10101000.00000001.00000000
- Broadcast
- 11000000.10101000.00000001.11111111
The line marks where the network part ends: 24 network bits to its left, 8 host bits to its right.
Split into smaller subnets
4 subnets of /26, 62 usable hosts each.
- 192.168.1.0/26Hosts 192.168.1.1 – 192.168.1.62Broadcast 192.168.1.63
- 192.168.1.64/26Hosts 192.168.1.65 – 192.168.1.126Broadcast 192.168.1.127
- 192.168.1.128/26Hosts 192.168.1.129 – 192.168.1.190Broadcast 192.168.1.191
- 192.168.1.192/26Hosts 192.168.1.193 – 192.168.1.254Broadcast 192.168.1.255
What the number after the slash means
An IPv4 address is 32 bits. The prefix length says how many of them, counted from the left, name the network. The rest name a host inside it. In 192.168.1.10/24 the first 24 bits (192.168.1) are the network and the last 8 (the 10) are the host.
Each bit that moves from the host part to the network part halves the network: a /24 holds 256 addresses, a /25 holds 128, a /26 holds 64. The size is always 2 to the power of (32 − prefix).
Reading a subnet mask
The mask is the prefix written another way: a 1 for every network bit and a 0 for every host bit, shown as four decimal numbers. /24 is 24 ones and 8 zeros, or 255.255.255.0.
Because the ones always come first, a mask can only contain the numbers 0, 128, 192, 224, 240, 248, 252, 254 and 255. Something like 255.0.255.0 is not a mask. The wildcard mask is the same thing with every bit flipped (0.0.0.255 for a /24), which is the form Cisco access lists use.
A worked example: 192.168.1.130/26
A /26 leaves 6 host bits, so every network holds 2⁶ = 64 addresses and the networks start at multiples of 64: .0, .64, .128 and .192. The address 130 falls in the block that starts at 128.
| Last number in binary | Address | |
|---|---|---|
| The address | 10 000010 | 192.168.1.130 |
| Network: host bits all 0 | 10 000000 | 192.168.1.128 |
| Broadcast: host bits all 1 | 10 111111 | 192.168.1.191 |
That leaves 192.168.1.129 to 192.168.1.190 for devices: 62 addresses.
Why two addresses go missing
The address with all host bits 0 names the network itself. The one with all host bits 1 is the broadcast address, which reaches every host in the subnet at once. Neither can be given to a device, so a subnet has two usable addresses fewer than its size.
Two sizes are exceptions:
- A /31 has only two addresses. On a link between two routers a network and a broadcast address are of no use, so RFC 3021 allows both to be used as hosts.
- A /32 is one address: a single host in a firewall rule or a route.
Private ranges
RFC 1918 sets three ranges aside for private networks. Anyone may use them, and they are not routed on the internet.
| Range | First address | Last address |
|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 | 10.255.255.255 |
| 172.16.0.0/12 | 172.16.0.0 | 172.31.255.255 |
| 192.168.0.0/16 | 192.168.0.0 | 192.168.255.255 |
The middle one is the one people get wrong. It ends at 172.31, so 172.32.0.1 is a public address.
The calculator also names loopback (127.0.0.0/8), link-local (169.254.0.0/16, what a computer assigns itself when no DHCP server answers), the range providers use for carrier-grade NAT (100.64.0.0/10), multicast and the reserved blocks.
The class
Until 1993 the first bits of an address fixed the size of its network: class A was /8, class B /16 and class C /24. Classless routing (CIDR) replaced that with the prefix length. The class is shown because courses and exams still ask for it. It no longer decides anything.
A page for each prefix length
- /8 (255.0.0.0)
- /12 (255.240.0.0)
- /16 (255.255.0.0)
- /20 (255.255.240.0)
- /21 (255.255.248.0)
- /22 (255.255.252.0)
- /23 (255.255.254.0)
- /24 (255.255.255.0)
- /25 (255.255.255.128)
- /26 (255.255.255.192)
- /27 (255.255.255.224)
- /28 (255.255.255.240)
- /29 (255.255.255.248)
- /30 (255.255.255.252)
- /31 (255.255.255.254)
- /32 (255.255.255.255)
- Subnet mask cheat sheet
More network tools
All tools