Calculate subnet masks, network ranges, and usable hosts from IP addresses and CIDR notation.
A subnet (subnetwork) is a logical division of an IP network that groups devices together, defined by a subnet mask that determines which portion of an IP address identifies the network vs. individual hosts.
| CIDR | Mask | Hosts |
|---|---|---|
| /30 | 255.255.255.252 | 2 |
| /28 | 255.255.255.240 | 14 |
| /24 | 255.255.255.0 | 254 |
| /16 | 255.255.0.0 | 65,534 |
| /8 | 255.0.0.0 | 16,777,214 |
Network Address: Bitwise AND of IP address and subnet mask.
Host Range: First host = network + 1, last host = broadcast - 1 (except /31 and /32).
Usable Hosts: 2^(32 - CIDR) - 2
Formula
Network Address = IP AND Subnet Mask | Usable Hosts = 2^(32 − CIDR) − 2 | Broadcast = Network OR Wildcard MaskCIDR = number of bits used for the network portion (e.g., /24 = 24 network bits)
Subnet Mask = binary mask where network bits are 1 and host bits are 0
Wildcard Mask = inverse of the subnet mask — used for broadcast and ACL rules
− 2 = subtracts the network address and broadcast address, which cannot be assigned to hosts
Worked Example
IP: 192.168.1.100, CIDR: /24
Did you know? The /24 subnet (255.255.255.0) is the most common in home and small office networks — it provides 254 usable addresses and maps neatly to one octet. RFC 1918 reserves three private ranges so internal networks never conflict with public internet addresses.
Sources
Convert text to ASCII codes and back. Supports decimal, hex, binary, and octal formats.
Convert width/height to aspect ratios, scale dimensions, and generate responsive embed CSS for any layout.
Calculate required internet bandwidth based on devices and activities in your household.
Encode and decode Base64 strings. Convert text for data URIs, APIs, and safe data transmission.
Create CSS border-radius with visual controls for each corner. Generate circles, pills, and custom shapes.
Create CSS box shadows with multiple layers, live preview, and copy-ready code.