CIDR / subnet calculator

Enter an IPv4 block and get the full breakdown — network and broadcast addresses, subnet and wildcard masks, the usable host range, and the host count — with the /31 and /32 edge cases handled correctly. Everything is calculated in your browser.

Try:
Network address192.168.1.0
Broadcast address192.168.1.255
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
First usable host192.168.1.1
Last usable host192.168.1.254
Total addresses256
Usable hosts254
Prefix/24
ClassC

IPv4 only. Everything is calculated in your browser — nothing you enter is sent anywhere.

Common prefix lengths

PrefixSubnet maskUsable hosts
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522
/31255.255.255.2542 (point-to-point)
/32255.255.255.2551 (single host)

CIDR & subnetting, explained

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) writes a network as an address followed by a slash and a prefix length, such as 192.168.1.0/24. The prefix says how many leading bits are the network portion; the rest identify hosts. /24 means the first 24 bits are the network, leaving 8 bits — 256 addresses — for hosts.

Why are there two fewer usable hosts than total addresses?

In most subnets the first address is the network identifier and the last is the broadcast address, and neither can be assigned to a host. So a /24 has 256 total addresses but 254 usable. The exceptions are /31 and /32.

What is special about a /31 and a /32?

A /31 has only two addresses and, under RFC 3021, both are usable — it is designed for point-to-point links where a network and broadcast address would be wasteful. A /32 is a single address, used to refer to one specific host, for example in a routing table or firewall rule.

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

The subnet mask marks the network bits with ones (255.255.255.0 for a /24). The wildcard mask is its inverse, marking the host bits with ones (0.0.0.255). Wildcard masks are used in some access control lists and routing configurations, notably on Cisco devices.

Does this handle IPv6?

Not yet — this calculator is IPv4 only. IPv6 uses the same CIDR idea with 128-bit addresses and much larger prefixes.

Mapping your network's attack surface?

Knowing your ranges is the start; a penetration test tells you what is exposed within them. Compare independent, accreditation-verified UK penetration testing companies in our directory.

Browse the directory