raatools/

Subnet / CIDR Calculator

Enter an IP address and CIDR prefix to calculate subnet details.

/24
Network address 192.168.1.0/24
Subnet mask 255.255.255.0
Wildcard mask 0.0.0.255
Broadcast address 192.168.1.255
First usable host 192.168.1.1
Last usable host 192.168.1.254
Usable hosts 254
Total addresses 256

Common Subnets

CIDRMaskHosts
/8255.0.0.016,777,214
/16255.255.0.065,534
/20255.255.240.04,094
/24255.255.255.0254
/28255.255.255.24014
/30255.255.255.2522
/32255.255.255.2551

What is subnetting?

Subnetting is the process of dividing a larger IP network into smaller, more manageable segments called subnets. Each subnet operates as an independent network with its own range of IP addresses, network address, and broadcast address. Subnetting is fundamental to network design, security, and efficient IP address allocation.

Without subnetting, organizations would need a separate IP network allocation for every group of connected devices. Subnetting allows a single network allocation (like a /16 block with 65,534 addresses) to be split into many smaller subnets (/24 blocks with 254 addresses each), reducing waste and improving traffic management.

CIDR notation explained

CIDR (Classless Inter-Domain Routing) notation combines an IP address with a prefix length, written as 192.168.1.0/24. The prefix length indicates how many bits of the address identify the network. The remaining bits identify individual hosts within that network. A /24 prefix means the first 24 bits are the network part, leaving 8 bits (256 addresses, 254 usable) for hosts.

CIDR replaced the older classful addressing system (Class A, B, C) in 1993. The classful system was rigid โ€” networks could only be /8 (16 million addresses), /16 (65,534 addresses), or /24 (254 addresses). CIDR allows any prefix length from /0 to /32, enabling precise allocation that dramatically reduced IP address waste.

How to calculate a subnet

The subnet mask determines which portion of an IP address is the network and which is the host. A /24 prefix corresponds to the subnet mask 255.255.255.0, meaning the first three octets are the network and the last octet is for hosts. The number of usable host addresses is 2^(32โˆ’prefix) โˆ’ 2, subtracting the network address (all-zeros host) and broadcast address (all-ones host).

How to use this tool

Enter an IP address and select a prefix length (CIDR notation) or subnet mask. The calculator instantly shows the network address, broadcast address, usable host range, number of usable hosts, wildcard mask, and the binary representation of the subnet mask. This information is essential for configuring routers, firewalls, and DHCP servers.

Common subnetting mistakes

Forgetting that the network address and broadcast address are not assignable to hosts is the most common error. A /24 network has 256 addresses but only 254 usable host addresses. For very small subnets like /30 (used for point-to-point links), this means only 2 usable addresses out of 4.

Another frequent mistake is overlapping subnets. When dividing a network, each subnet must cover a non-overlapping range. For example, 10.0.0.0/24 and 10.0.0.0/25 overlap because the /25 is entirely contained within the /24. Use a subnet calculator to verify your allocations before configuring equipment.

Network design tips

Allocate subnets in powers of two and leave room for growth. If a department has 50 devices today, a /26 (62 usable hosts) may seem sufficient, but a /25 (126 hosts) costs nothing extra and accommodates future expansion. For point-to-point router links, a /30 (2 hosts) or /31 (2 hosts, no broadcast) is the standard choice.

Use private address ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) for internal networks. Document your subnet allocation plan and keep it updated. Consistent subnetting โ€” for example, always using /24 for user VLANs and /28 for management networks โ€” makes troubleshooting much faster.

Frequently asked questions

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

A subnet mask marks the network bits with 1s and host bits with 0s (e.g., 255.255.255.0). A wildcard mask is the inverse โ€” host bits are 1s and network bits are 0s (e.g., 0.0.0.255). Wildcard masks are used in access control lists (ACLs) on Cisco routers and OSPF configurations.

Can I subnet IPv6?

Yes, IPv6 uses the same CIDR prefix notation. The standard allocation for a single LAN is /64, which provides 2โถโด (about 18 quintillion) host addresses. Organizations typically receive a /48 prefix, giving them 65,536 /64 subnets. IPv6 subnetting is simpler because addresses are so abundant that efficiency is less of a concern.