IP subnet calculator
This IP subnet calculator takes an IPv4 address with a CIDR prefix or a subnet mask and works out the network it belongs to. Network admins, students preparing for networking exams and developers writing firewall rules use it to check address ranges quickly.
- Runs in your browser
- Free, no account needed
- Copy or download the result
Result
The short answer
To find a subnet, keep the network bits given by the prefix and set the remaining host bits to zero for the network address, or to one for the broadcast address. The usable host count is 2 to the power of (32 minus the prefix) minus 2, so a /26 has 62 usable hosts.
FormulaNetwork = address AND netmask; broadcast = network OR wildcard mask; usable hosts = 2^(32 - prefix length) - 2 (except /31 and /32)
Worked exampleFor 192.168.1.130/26 the network is 192.168.1.128/26, the broadcast address is 192.168.1.191, the usable hosts run from 192.168.1.129 to 192.168.1.190 (62 of 64 addresses) and the netmask is 255.255.255.192.
Example
192.168.1.130/26
- Broadcast
- 192.168.1.191
- First usable host
- 192.168.1.129
- Last usable host
- 192.168.1.190
- Usable hosts
- 62
- Total addresses
- 64
- Netmask
- 255.255.255.192
- Wildcard mask
- 0.0.0.63
- Binary mask
- 11111111.11111111.11111111.11000000
- Binary address
- 11000000.10101000.00000001.10000010
- Note
- 192.168.1.130 is a host inside this network, not the network address.
- Historical class
- C. Classes are no longer used for routing; CIDR prefixes replaced them.
- Range
- 192.168.0.0/16. Private network (RFC 1918). Not routed on the public internet.
How to use the ip subnet calculator
- Type a block such as 192.168.1.130/26, or an address, a space and a mask such as 10.0.0.1 255.255.255.0, into the IPv4 block box.
- The result updates as you type; Run also works.
- Read the network, broadcast, first and last usable host, host count and masks.
- Use Copy result or Download to save the details.
How it works
The network address is the input address with every host bit set to zero, and the broadcast address has every host bit set to one.
Usable hosts are the total addresses minus two, except /31, which gives two usable addresses for point-to-point links under RFC 3021, and /32, which is a single host.
A dotted mask must be ones followed by zeros, such as 255.255.240.0, or it is rejected.
Octets with leading zeros, such as 010, are rejected because some systems read them as octal.
The output also shows the historical address class and whether the address is in a special range such as private RFC 1918 space, loopback or a documentation range.
Everything runs in your browser. Your input is not uploaded or stored.
Questions and answers
How many usable hosts are in a /24?
A /24 has 256 addresses. Two are reserved for the network and broadcast addresses, so 254 can be given to hosts.
Why does a /31 show 2 usable hosts?
RFC 3021 allows /31 networks on point-to-point links, where no broadcast address is needed. Both addresses can be assigned, one to each end of the link.
What is a wildcard mask?
A wildcard mask is the netmask with every bit flipped, such as 0.0.0.255 for 255.255.255.0. Cisco access lists and OSPF settings use it.
Does this work for IPv6?
No. This calculator handles IPv4 only. The IPv6 address expander can expand, compress and show the prefix of IPv6 addresses.
Last updated November 1, 2026. Maintained by SnowRock. How our tools work
All 220 SnowRock tools