IPv4 subnet calculator

Enter an IP with /prefix or a netmask and see the whole subnet at once.

Tier 0 · browser · unlimited
16 characters
Network
192.168.1.128/26
Address192.168.1.130
CIDR192.168.1.128/26
Netmask255.255.255.192
Wildcard mask0.0.0.63
Network address192.168.1.128
Broadcast address192.168.1.191
First host192.168.1.129
Last host192.168.1.190
Usable hosts62
Address in binary11000000.10101000.00000001.10000010
Netmask in binary11111111.11111111.11111111.11000000
Class (historical)C
Scopeprivate

How CIDR subnets work

An IPv4 address is 32 bits, written as four numbers from 0 to 255. A prefix such as /24 says how many leading bits identify the network; the rest identify hosts. A /24 leaves 8 host bits, so 256 addresses: the first is the network address, the last the broadcast address, and the 254 in between are usable hosts. Each extra prefix bit halves the block: /25 has 128 addresses, /26 64, /27 32.

The netmask writes the prefix as an address (/26 = 255.255.255.192), and the wildcard mask is its inverse (0.0.0.63), used by firewall ACLs.

Worked example

192.168.1.130/26: blocks of 64 start at .0, .64, .128 and .192, so .130 is in the block starting at 192.168.1.128. Its broadcast is .191, usable hosts run from .129 to .190, and there are 62 of them. Because 192.168/16 is an RFC 1918 range, the address is private and not routed on the internet.

Special prefixes

/31 networks have no network or broadcast address and give both addresses to hosts (RFC 3021), which routers use on point-to-point links. /32 is a single host.

How this works

The page parses the address into a 32-bit number, takes the prefix from /n or derives it from a dotted mask (which must be contiguous), and computes the block size 2^(32 − prefix). The network address is the address rounded down to a multiple of the block size; the broadcast is the network plus the block size minus one. Usable hosts exclude those two, except in /31 and /32 networks. It also shows the netmask and wildcard, the address and mask in binary, the old class letter and the address scope from the RFC 1918, RFC 6598 and special-use ranges.

Frequently asked

How many hosts are in a /24?

256 addresses, 254 usable hosts. A /25 has 126 usable hosts and a /26 has 62.

What is a wildcard mask?

The inverse of the netmask (255 minus each octet). Cisco ACLs and OSPF use it to match address ranges.

Why does /31 show two usable hosts?

RFC 3021 lets point-to-point links use both addresses of a /31, since no broadcast is needed.

Does it support IPv6?

Not yet; this calculator handles IPv4 only.

Sources

Reviewed Oct 17, 2026 · test vectors fixtures/dev/subnet-calculator/