Skip to content
Toolcroft

Developer Tools

IP Subnet Calculator

Calculate IPv4 subnet properties from an IP address and CIDR prefix. Get network address, broadcast, first/last usable host, subnet mask, wildcard mask, and binary breakdown. All in your browser.

Enter IP with CIDR (e.g. 192.168.1.0/24) or just the IP and add the prefix in the address field.

What is subnetting?

Subnetting is the practice of dividing a larger IP network into smaller sub-networks (subnets). This improves routing efficiency, limits broadcast domains, and helps with security segmentation. CIDR (Classless Inter-Domain Routing) notation, like 192.168.1.0/24, replaced the older class-based system and is the universal standard today.

Understanding CIDR prefix lengths

The prefix length (the number after the slash) specifies how many of the 32 bits in an IPv4 address are used to identify the network. The remaining bits identify individual hosts.

  • /8: 16 777 216 addresses (Class A range)
  • /16: 65 536 addresses (Class B range)
  • /24: 256 addresses, 254 usable (Class C range, most common)
  • /28: 16 addresses, 14 usable (small office / lab segment)
  • /30: 4 addresses, 2 usable (common for point-to-point WAN links)
  • /31: 2 addresses, both usable (RFC 3021 point-to-point)
  • /32: 1 address (host route)

Private address ranges (RFC 1918)

  • 10.0.0.0/8: Class A private range (16 million+ addresses)
  • 172.16.0.0/12: Class B private range (1 million+ addresses)
  • 192.168.0.0/16: Class C private range (65 536 addresses)

These ranges are reserved for private networks and are not routable on the public internet. NAT (Network Address Translation) allows devices on private networks to communicate with the public internet through a single public IP address.

CIDR notation reference table

CIDR prefixSubnet maskTotal IPsUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 (RFC 3021)
/32255.255.255.25511 (host route)

IPv6 subnetting

IPv6 uses 128-bit addresses instead of 32-bit, written in hexadecimal groups separated by colons (e.g., 2001:0db8:85a3::1). The subnetting concept is identical to IPv4 CIDR, but the scale is dramatically different:

  • /48: standard allocation for a site or organization. A /48 contains 65,536 possible /64 subnets - enough to give every room in a large building its own subnet.
  • /64: the standard LAN segment size. A /64 has 264 ≈ 18,446,744,073,709,551,616 host addresses. SLAAC (Stateless Address Autoconfiguration) requires exactly a /64 prefix.
  • /128: a single host address (equivalent to IPv4's /32 host route).

With IPv6, address conservation is no longer a concern - the total address space (2128 ≈ 3.4 × 1038) is large enough to assign every atom on Earth its own address. The focus shifts to hierarchical routing and aggregation rather than conservation.

VLSM (Variable Length Subnet Masking)

VLSM allows a network to be divided into subnets of different sizes from the same address block, eliminating wasted addresses that occur with fixed-size subnetting.

Example: You have a 192.168.1.0/24 block and need to create three subnets - one for 60 hosts, one for 25 hosts, and one for a point-to-point WAN link.

  1. Allocate the largest subnet first: 60 hosts needs a /26 (62 usable addresses) -> 192.168.1.0/26 (addresses .0–.63)
  2. Next: 25 hosts needs a /27 (30 usable addresses) -> 192.168.1.64/27 (addresses .64–.95)
  3. Point-to-point link: 2 hosts needs a /30 (2 usable addresses) -> 192.168.1.96/30 (addresses .96–.99)
  4. Remaining space (192.168.1.100/24 through .255) is available for future subnets.

Always allocate larger subnets first to keep address blocks contiguous and maximize the available remaining space.