Skip to main content

IPv4 Subnet Calculator

Calculate network address, broadcast, host range, and wildcard mask from any CIDR notation or subnet mask.

Network Address192.168.1.0
Broadcast Address192.168.1.255
First Host192.168.1.1
Last Host192.168.1.254
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
CIDR Notation/24
Total Hosts256
Usable Hosts254
IP ClassClass C
Private AddressYes

Binary Subnet Mask

11111111.11111111.11111111.00000000
/24 network bits8 host bits
Your data never leaves your browser

Understanding IPv4 Subnetting and CIDR

IPv4 subnetting divides a larger network into smaller, more manageable segments. Each subnet is defined by a network address and a prefix length (CIDR notation). The prefix length determines how many of the 32 bits in an IPv4 address are reserved for the network portion, with the remaining bits available for host addresses. This partitioning is fundamental to IP routing, access control, and efficient address allocation.

CIDR replaced the original classful addressing system (Class A/B/C) in 1993 to combat address exhaustion. Instead of fixed 8-bit, 16-bit, or 24-bit boundaries, CIDR allows any prefix length from /0 to /32. A /24 block gives you 256 addresses (254 usable hosts), while a /30 gives 4 addresses (2 usable hosts), commonly used for point-to-point router links. Understanding the wildcard mask, the bitwise complement of the subnet mask, is essential for configuring ACLs and routing protocols like OSPF.

Private address ranges defined in RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are used within internal networks and are not routable on the public internet. This calculator identifies whether a given address falls within these private ranges and displays the IP class, though classful distinctions are largely historical since the adoption of CIDR.

Frequently Asked Questions

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation combines an IP address with a prefix length, like 192.168.1.0/24. The number after the slash indicates how many bits of the address identify the network. A /24 block contains 256 total IP addresses (2^8), while a /32 represents a single host.

What is the difference between a network address and a broadcast address?

The network address is the first address in a subnet and identifies the network itself — it cannot be assigned to a host. The broadcast address is the last address in the subnet and is used to send packets to all hosts in that network. All usable host addresses fall between these two.

What is a wildcard mask?

A wildcard mask is the bitwise inverse of a subnet mask. Where a subnet mask uses 1 bits to mark the network portion, a wildcard mask uses 0 bits. For example, a /24 subnet mask of 255.255.255.0 has a wildcard mask of 0.0.0.255. Wildcard masks are commonly used in Cisco ACLs and OSPF area configurations.

What does a /31 subnet mean?

A /31 subnet contains exactly two IP addresses with no network or broadcast address, as defined in RFC 3021. Both addresses are usable, making /31 subnets ideal for point-to-point links between two routers where dedicating addresses for network and broadcast would be wasteful.

How do I calculate the number of usable hosts in a subnet?

For most subnets (/0 through /30), the formula is 2^(32 - prefix) - 2. You subtract 2 because the network address and broadcast address cannot be assigned to hosts. The exceptions are /31 (2 usable hosts per RFC 3021) and /32 (a single host address with 0 usable hosts).