Subnet Calculator
IPv4 CIDR, netmask, and host ranges.
Prefix length
Examples:
Network
192.168.1.0/24254 usable hostsNetmask
255.255.255.0
Wildcard mask
0.0.0.255
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
Host range
192.168.1.1 – 192.168.1.254
Usable hosts
254
Total addresses
256
Class
C
Scope
Private (RFC 1918)
Reverse DNS
1.168.192.in-addr.arpa
Binary — network bits in colour, host bits in grey
Address11000000.10101000.00000001.00001010
Netmask11111111.11111111.11111111.00000000
Network11000000.10101000.00000001.00000000
4 subnets
| Subnet | Host range | Broadcast | Hosts |
|---|---|---|---|
| 192.168.1.0/26 | 192.168.1.1 – 192.168.1.62 | 192.168.1.63 | 62 |
| 192.168.1.64/26 | 192.168.1.65 – 192.168.1.126 | 192.168.1.127 | 62 |
| 192.168.1.128/26 | 192.168.1.129 – 192.168.1.190 | 192.168.1.191 | 62 |
| 192.168.1.192/26 | 192.168.1.193 – 192.168.1.254 | 192.168.1.255 | 62 |
About the Subnet Calculator
Enter an IPv4 address and a prefix length and get the netmask, wildcard mask, network and broadcast addresses, the first and last usable host, and the exact host count. A binary view shows where the prefix splits network bits from host bits, and the block can be divided into equal subnets. All of it is integer arithmetic in your browser; no address you type is sent anywhere.
How to use the Subnet Calculator
- Type an IPv4 address, or paste full CIDR like 10.0.0.5/22 and the prefix follows automatically.
- Pick the prefix length from the dropdown, which lists the matching dotted-decimal netmask for each one.
- Read the network, broadcast, host range, and usable host count, and copy any field you need.
- Set Divide into to a longer prefix to split the block into equal subnets with their own ranges.
Frequently asked questions
- Why are two addresses subtracted from the host count?
- The first address in a block identifies the network itself and the last is the broadcast address, so neither can be assigned to a host. A /24 has 256 addresses and 254 usable ones.
- What happens with a /31 or a /32?
- They are special-cased. RFC 3021 allows a /31 on a point-to-point link with no network or broadcast address, so both of its addresses are usable. A /32 is a single host route with one usable address. In both cases the broadcast field reports that none exists rather than inventing one.
- What is a wildcard mask for?
- It is the bitwise inverse of the netmask, and it is what Cisco ACLs and OSPF network statements expect instead of a netmask. A /24 netmask of 255.255.255.0 has the wildcard 0.0.0.255.
- Can I enter a netmask instead of a prefix length?
- Yes. Paste something like 10.0.0.1 255.255.240.0 and the mask is converted to /20. Masks whose 1 bits are not contiguous are rejected, because they are not valid.
- Is the address I type sent to a server?
- No. The calculation is 32-bit integer arithmetic running in your browser tab, so internal network layouts stay on your machine. There is no backend to send them to.