IPv4 Subnet Calculator

Calculate IPv4 CIDR network boundaries, masks and conventional host ranges, including /31 point-to-point and /32 cases.

Enter dotted decimal and /0–/32, without leading zeros. /31 uses point-to-point semantics; /32 is a single address. All calculations stay in this browser; no host is contacted.

Calculate an IPv4 block from CIDR

Enter an IPv4 address followed by a slash and prefix length, then choose Calculate subnet. The result shows the containing network, subnet mask, wildcard mask, first and last block addresses, and a host range under the stated convention. The original address may be inside the block; it does not have to be its first address.

The input uses four decimal octets from 0 to 255 and a prefix from 0 to 32. Leading zeros are rejected rather than interpreted as another number base. IPv6, dotted masks in place of a prefix, signed numbers and internal spaces are outside this tool's scope.

Follow the example

Load example replaces the input with 192.168.1.130/26. Calculate subnet returns network 192.168.1.128/26, mask 255.255.255.192 and wildcard 0.0.0.63. The block contains 64 addresses, ending at 192.168.1.191. Under conventional network and broadcast exclusion, the host range is 192.168.1.129 through 192.168.1.190, with 62 hosts. Download JSON preserves these fields without enumerating every address.

Understand /31 and /32

For prefixes through /30, the host count subtracts the first and last address of the block. A /31 is treated as a point-to-point link with two endpoint addresses, following RFC 3021. No subnet-directed broadcast is reported for that case. A /32 represents one address; its first and last address are identical and the broadcast field is not applicable.

For example, 192.0.2.10/31 spans 192.0.2.10 and 192.0.2.11. A /0 contains the full 4,294,967,296-address IPv4 space. The conventional host-count formula for /0 is arithmetic only and does not imply that nearly every IPv4 address is usable on one real network.

What the count leaves out

This calculator does not subtract special-purpose ranges, router reservations, DHCP exclusions or addresses already in use. It does not determine routing policy, inspect your connection or test whether any host responds. Even a conventional network boundary is not a deployment recommendation. Consult the addressing rules of the actual network before assigning endpoints.

For a device's link-layer address format rather than its IP subnet, use the MAC Address Format Converter. The two address types serve different layers and cannot be converted into one another by changing punctuation.