IP Subnet Calculator — Free Online IPv4 Subnet Tool
Calculate subnet details for any IPv4 address and CIDR prefix length.
Tip: Common CIDR values: /8 (Class A), /16 (Class B), /24 (Class C), /32 (single host).
Subnet Details
CIDR Subnet Reference Table
| CIDR | Subnet Mask | Total Hosts | Usable Hosts |
|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 1 |
| /30 | 255.255.255.252 | 4 | 2 |
| /28 | 255.255.255.240 | 16 | 14 |
| /24 | 255.255.255.0 | 256 | 254 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
Related Calculators
Bandwidth Calculator
Convert between bandwidth units and estimate download times.
Tech Calculators
Browse all technology and networking calculators.
IP Subnet Reference
Use the calculator above for instant subnet calculations.
Bandwidth Speed Tool
Calculate data transfer rates in bits, bytes, and time.
Binary Calculator
Convert between binary, decimal, hexadecimal, and octal number systems.
Hex Calculator
Perform hexadecimal arithmetic and conversions for networking.
About this calculator
Subnet Calculation Formula
Subnet Mask = (2^32 - 1) shifted left by (32 - CIDR) bits Network Address = IP Address AND Subnet Mask Broadcast Address = Network Address OR (NOT Subnet Mask) Usable Hosts = 2^(32 - CIDR) - 2 Variables Explained
- IP Address: A 32-bit number uniquely identifying a device on a network, written as four octets in dotted decimal notation (e.g., 192.168.1.100). Each octet represents 8 bits and ranges from 0 to 255. The IP address contains both the network identifier and the host identifier.
- CIDR Prefix: A number from 0 to 32 indicating how many of the 32 bits are used for the network portion. A /24 means the first 24 bits are the network and the last 8 bits are for hosts. This replaced the older classful system where only /8, /16, and /24 were standard network boundaries.
- Subnet Mask: A 32-bit value where the network bits are all 1s and the host bits are all 0s. For /24, the mask is 11111111.11111111.11111111.00000000 or 255.255.255.0 in decimal. The AND operation between the IP and mask isolates the network portion.
- Wildcard Mask: The bitwise complement of the subnet mask. For a /24 subnet with mask 255.255.255.0, the wildcard mask is 0.0.0.255. Used in Cisco IOS configurations for ACLs and routing protocols where a 0 bit means "must match" and a 1 bit means "don't care."
Step-by-Step Example
Calculate the subnet details for the IP address 10.50.100.200 with a /20 prefix:
- Convert the /20 prefix to a subnet mask: first 20 bits are 1s = 255.255.240.0
- AND the IP with the mask: 10.50.100.200 AND 255.255.240.0 = 10.50.96.0 (network address)
- Calculate wildcard mask: 255 - 255 = 0, 255 - 255 = 0, 255 - 240 = 15, 255 - 0 = 255 = 0.0.15.255
- OR the network with the wildcard: 10.50.96.0 OR 0.0.15.255 = 10.50.111.255 (broadcast address)
- First host: network + 1 = 10.50.96.1
- Last host: broadcast - 1 = 10.50.111.254
- Total hosts: 2^(32-20) = 2^12 = 4,096
- Usable hosts: 4,096 - 2 = 4,094
This /20 subnet provides 4,094 usable host addresses ranging from 10.50.96.1 to 10.50.111.254. It covers 16 Class C equivalent blocks, making it suitable for a medium-sized campus or data center segment. The address 10.x.x.x falls in the Class A private range, confirming it is a non-routable internal address.
Sources
- IANA — IPv4 Address Space Registry: iana.org/assignments/ipv4-address-space
- RFC 1918 — Address Allocation for Private Internets: rfc-editor.org/rfc/rfc1918
- RFC 950 — Internet Standard Subnetting Procedure: rfc-editor.org/rfc/rfc950
Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.
Last updated: November 3, 2026