IPv4 Subnet Calculator
Find the network address, broadcast address, host range, subnet mask, and wildcard mask of any IPv4 address from its CIDR prefix or mask.
How to use it
- 01
Enter an IPv4 address. You can include the prefix (192.168.1.10/24) or the mask (192.168.1.10 255.255.255.0).
- 02
If you leave them out, pick a prefix from the drop-down list.
- 03
You’ll see the network and broadcast addresses, the host range, the number of hosts, and the mask in both decimal and binary.
How it works
An IPv4 address has 32 bits, and the prefix tells you how many of them belong to the network: the first 24 in a /24. The network address is the IP ANDed with the mask, and the broadcast address sets every host bit to 1.
A subnet has 2^(32 − prefix) addresses. All of them except the network and broadcast addresses can be assigned, so a /24 has 254 usable hosts. The exceptions are /31 point-to-point links (RFC 3021), where both addresses are usable, and /32, which is a single host.
The wildcard mask is the inverse of the subnet mask and is used in router access control lists (ACLs). The class (A, B, C) predates CIDR and is shown for reference only.
Examples
- Home network
192.168.1.10/24 is on the 192.168.1.0 network, with hosts .1 through .254 and a broadcast address of 192.168.1.255.
- A /26 subnet
10.0.5.200 with mask 255.255.255.192 is in 10.0.5.192/26: 62 hosts, from .193 through .254.
- Point-to-point link
A /31 such as 203.0.113.6/31 has exactly two usable addresses.
Frequently asked questions
How many hosts does each prefix have?
/30: 2 · /29: 6 · /28: 14 · /27: 30 · /26: 62 · /25: 126 · /24: 254 · /23: 510 · /22: 1,022 · /16: 65,534.
Does it work with IPv6?
No, this calculator supports IPv4 only.
Related tools
- 03.09
Binary, Decimal and Hex Converter
Converters - 03.07
Data Storage Converter: KB, MB, GB, TB
Converters - 10.06
MD5, SHA-1 and SHA-256 Hash Generator
Developer tools - 10.01
UUID Generator
Developer tools - 10.02
QR Code Generator
Developer tools - 10.03
JSON Formatter and Validator
Developer tools - 10.04
Base64 Encoder and Decoder
Developer tools - 10.05
URL Encode and Decode
Developer tools