Subnet Calculator
This subnet calculator turns an IPv4 address plus a CIDR prefix or dotted netmask into the network, broadcast, usable host range, host count, and wildcard mask.
How to use
- Enter an IPv4 address, such as 192.168.1.10. You can paste CIDR notation such as 192.168.1.10/24.
- Choose a prefix from /0 to /32, or switch to a dotted subnet mask such as 255.255.255.0.
- Read the network, broadcast, usable host range, host counts, subnet mask, and wildcard mask. The math stays in your browser.
Formula
A prefix of n bits sets the first n bits of the mask to 1. Network = IP AND mask. Wildcard = the inverse of the mask. Broadcast = network OR wildcard. For /0 through /30, usable hosts are the addresses between network and broadcast. A /31 has two usable addresses. A /32 is a single host.
Example. 192.168.1.10/24 has mask 255.255.255.0, network 192.168.1.0, broadcast 192.168.1.255, usable hosts 192.168.1.1 to 192.168.1.254 (254 hosts), and wildcard mask 0.0.0.255.
Frequently asked questions
What is CIDR notation?
An IP plus a prefix length, such as 192.168.1.0/24, which means a 24-bit network mask (255.255.255.0).
How many hosts are in a /24?
256 addresses total. After reserving the network and broadcast addresses, 254 are usable hosts.
What is a wildcard mask?
The inverse of the subnet mask, often used in access control lists. For /24 it is 0.0.0.255.
Can I enter a dotted subnet mask instead of CIDR?
Yes. Switch to netmask and enter a contiguous mask such as 255.255.255.0. That is the same as /24. A mask with holes, such as 255.0.255.0, is rejected.
Does this support IPv6?
This version calculates IPv4 only.
Is my IP sent to a server?
No. Calculations run in your browser.
Related tools
- DevRegex TesterTest JavaScript regular expressions with live match highlighting.
- DevJSON Formatterin-browser JSON pretty-printer, minifier, and syntax validator.
- DevBarcode GeneratorEncode a SKU or number as Code 128, Code 39, EAN-13, or UPC-A and download PNG or SVG.
- DevUPC GeneratorBuild a valid UPC-A barcode digit string with check digit.