Home/Tools/Subnet Calculator

Subnet Calculator

Enter an IPv4 address and CIDR prefix to calculate all subnet details instantly โ€” no server required.

/
32-Bit Allocation
Network bits (blue)Host bits (gray)
๐ŸŒNetwork Address
โ€”
๐Ÿ“กBroadcast Address
โ€”
๐ŸŽญSubnet Mask
โ€”
๐ŸƒWildcard Mask
โ€”
โ–ถFirst Usable Host
โ€”
โนLast Usable Host
โ€”
๐Ÿ’ปUsable Hosts
โ€”
๐ŸทIP Class / Type
โ€”

Binary Representation

Address:
Netmask:
Network:
Advertisement

Understanding IPv4 Subnetting

IPv4 Address Structure (32 bits)

Octet 1Octet 2Octet 3Octet 419216810bits 31โ€“24bits 23โ€“16bits 15โ€“8bits 7โ€“0/16 Network PortionHost Portion

IPv4 subnetting is the process of dividing a network into smaller subnetworks (subnets). It uses Classless Inter-Domain Routing (CIDR) notation, defined in RFC 4632, which appends a prefix length to the IP address (e.g., 192.168.1.0/24). The prefix length indicates how many bits are reserved for the network portion.

CIDR Prefix Length Cheatsheet

CIDRSubnet MaskHostsUse Case
/8255.0.0.016,777,214Class A (large ISP)
/16255.255.0.065,534Class B (campus)
/24255.255.255.0254Class C (small office)
/25255.255.255.128126Half /24
/26255.255.255.19262Quarter /24
/28255.255.255.24014Small VLAN
/30255.255.255.2522Point-to-point link
/32255.255.255.2551 (host)Single host route

RFC 1918 Private Address Ranges

RFC 1918 defines three blocks of private IPv4 address space that are not routed on the public internet:

  • 10.0.0.0/8 โ€” 16.7 million addresses (large enterprises)
  • 172.16.0.0/12 โ€” 1 million addresses (medium networks)
  • 192.168.0.0/16 โ€” 65,536 addresses (home/small office)

How Subnet Calculation Works

Given an IP address and prefix length, the subnet calculator performs bitwise AND operations to derive the network address. The broadcast address is computed by ORing the network address with the inverted netmask (wildcard mask). The number of usable hosts is 2^(32-prefix) - 2, subtracting the network and broadcast addresses.