Binarios.org About Us
Networking and IP address tools

IPv4 Subnet Calculator

Calculate an IPv4 network from an IP address and a CIDR prefix or subnet mask. Find the network address, broadcast address, usable host range, wildcard mask, total addresses, and usable hosts in seconds.

Calculate an IPv4 subnet

IPv4 CIDR prefix reference

The table shows address counts and conventional usable host counts. A /31 is treated as a two-address point-to-point subnet, and a /32 represents one address.

Prefix Subnet mask Wildcard mask Total addresses Usable hosts
/8 255.0.0.0 0.255.255.255 16,777,216 16,777,214
/9 255.128.0.0 0.127.255.255 8,388,608 8,388,606
/10 255.192.0.0 0.63.255.255 4,194,304 4,194,302
/11 255.224.0.0 0.31.255.255 2,097,152 2,097,150
/12 255.240.0.0 0.15.255.255 1,048,576 1,048,574
/13 255.248.0.0 0.7.255.255 524,288 524,286
/14 255.252.0.0 0.3.255.255 262,144 262,142
/15 255.254.0.0 0.1.255.255 131,072 131,070
/16 255.255.0.0 0.0.255.255 65,536 65,534
/17 255.255.128.0 0.0.127.255 32,768 32,766
/18 255.255.192.0 0.0.63.255 16,384 16,382
/19 255.255.224.0 0.0.31.255 8,192 8,190
/20 255.255.240.0 0.0.15.255 4,096 4,094
/21 255.255.248.0 0.0.7.255 2,048 2,046
/22 255.255.252.0 0.0.3.255 1,024 1,022
/23 255.255.254.0 0.0.1.255 512 510
/24 255.255.255.0 0.0.0.255 256 254
/25 255.255.255.128 0.0.0.127 128 126
/26 255.255.255.192 0.0.0.63 64 62
/27 255.255.255.224 0.0.0.31 32 30
/28 255.255.255.240 0.0.0.15 16 14
/29 255.255.255.248 0.0.0.7 8 6
/30 255.255.255.252 0.0.0.3 4 2
/31 255.255.255.254 0.0.0.1 2 2
/32 255.255.255.255 0.0.0.0 1 1

What is IPv4 subnetting?

IPv4 addresses contain 32 bits, usually displayed as four decimal octets. A subnet mask identifies the network portion of an address, while the remaining bits identify addresses within that network. CIDR notation expresses the network prefix as a number from /0 through /32.

How the subnet calculator works

Example: 192.168.1.130/26

A /26 prefix leaves six host bits, so the subnet contains 64 addresses. Its subnet mask is 255.255.255.192. The address 192.168.1.130 belongs to network 192.168.1.128, with broadcast address 192.168.1.191. The conventional usable host range is 192.168.1.129 through 192.168.1.190, giving 62 usable hosts.

Special cases: /31 and /32

A /31 has two addresses. Under the point-to-point convention described in RFC 3021, both can be used on a point-to-point link. A /32 contains exactly one address and is often used to identify a single host or route. These cases do not follow the ordinary “total minus two” host-count rule.

Private IPv4 address ranges

These ranges are reserved for private networks. A private address is not directly globally routable, although devices commonly access the internet through network address translation (NAT).

Frequently asked questions

What is a CIDR prefix?

A CIDR prefix specifies how many leading bits of an IPv4 address belong to the network. For example, /24 means 24 network bits and eight host bits.

How many usable hosts are in a /24 subnet?

A /24 contains 256 total addresses and conventionally provides 254 usable host addresses after reserving the network and broadcast addresses.

What is the difference between a subnet mask and a wildcard mask?

The subnet mask marks network bits with ones and host bits with zeros. The wildcard mask is its inverse and is used in some router access lists and routing configurations.

Can I enter a host address instead of the network address?

Yes. Enter any valid IPv4 address and a prefix. The calculator determines the network block containing that address.

Does this calculator send my IP address to a server?

No. The calculation runs in your browser. The IP address entered into the calculator is not submitted to this page's PHP script.

Related tools

Confirm the related-tool filenames against your actual site before publishing.