IP Subnet Calculator
Enter an IPv4 address with a CIDR suffix and get every derived value - network, broadcast, host range, netmask, and more.
Calculate IPv4 subnets from any IP and CIDR. Get the network address, broadcast, host range, netmask, wildcard mask, and usable hosts. Also known as a CIDR calculator, netmask calculator, and IP range calculator. Free, offline, runs in your browser. Read more Show less
What is a subnet calculator?
A subnet calculator takes an IP address with a CIDR suffix - like 192.168.1.42/24 - and works out everything about the network that address belongs to: the network address, the broadcast address, the usable host range, the netmask, and how many hosts fit in the block.
Subnetting matters for network design, firewall rules, VPN configuration, ACLs, routing tables, and cloud VPC setup. Getting it wrong causes outages that are hard to diagnose. This tool makes every value explicit so you can copy the right one into your configuration.
How to use
Type an IP address with a CIDR suffix. The tool updates live and shows all derived values. Tap any result row to copy it to your clipboard.
You can also enter an IP with a dotted-decimal netmask, like 192.168.1.42 255.255.255.0, or a network address by itself. The tool normalizes everything.
Terminology
| Term | What it means |
|---|---|
| Network address | The first address in the block. Identifies the subnet itself and cannot be assigned to a host. |
| Broadcast address | The last address in the block. Sends a packet to every host on the subnet. Cannot be assigned to a host. |
| First host / Last host | The range of addresses that can actually be assigned to devices. One below the broadcast, one above the network. |
| Netmask | A 32-bit mask that separates the network portion of an address from the host portion. /24 equals 255.255.255.0. |
| Wildcard mask | The inverse of the netmask. Used in Cisco ACLs and OSPF statements. /24 gives 0.0.0.255. |
| CIDR | Classless Inter-Domain Routing. The /24 suffix is the count of network bits. |
| Total addresses | 2^(32-CIDR). Includes the network and broadcast addresses. |
| Usable hosts | Total minus 2 (for the network and broadcast addresses). For very small subnets (/31 and /32) the rules differ - see the FAQ. |
CIDR cheat sheet
| CIDR | Netmask | Total | Usable | Typical use |
|---|---|---|---|---|
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point link |
| /29 | 255.255.255.248 | 8 | 6 | Small server group |
| /28 | 255.255.255.240 | 16 | 14 | Small office |
| /27 | 255.255.255.224 | 32 | 30 | Department |
| /26 | 255.255.255.192 | 64 | 62 | Mid-size office |
| /25 | 255.255.255.128 | 128 | 126 | Large department |
| /24 | 255.255.255.0 | 256 | 254 | Standard LAN |
| /23 | 255.255.254.0 | 512 | 510 | Two merged /24s |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Building network |
| /21 | 255.255.248.0 | 2,048 | 2,046 | Campus segment |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Large campus |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Enterprise private range |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Huge private space |
Private IP ranges
RFC 1918 reserves three IPv4 ranges for private networks. They are never routed on the public internet.
| Range | CIDR | Size |
|---|---|---|
| 10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 | 16.7 million |
| 172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 | 1 million |
| 192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 | 65,536 |
Also reserved: 127.0.0.0/8 (loopback), 169.254.0.0/16 (link-local / APIPA), 100.64.0.0/10 (CGNAT), 224.0.0.0/4 (multicast), 240.0.0.0/4 (reserved).
FAQ
Why do I subtract 2 for usable hosts?
The first address in every IPv4 subnet is the network address and the last is the broadcast. Neither can be assigned to a device. That is why a /24 with 256 total addresses has 254 usable hosts.
What about /31 and /32?
RFC 3021 allows /31 for point-to-point links with both addresses usable (no broadcast). A /32 is a single host - usable for loopback or host routes but not a subnet in the traditional sense.
What is my public IP vs my private IP?
Your device usually has a private IP (something like 192.168.1.42) assigned by your router. The router then has a public IP assigned by your ISP. Private IPs are not visible on the internet - that is what network address translation (NAT) does. This tool calculates the subnet for whatever IP you enter; it does not look up your actual IP.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) replaces the older class-based system. Instead of class A/B/C being implicit in the first octet, you write the number of network bits after a slash: /24, /16, /27. This lets networks be any size, not just three fixed sizes.
What is a wildcard mask and where is it used?
It is the bitwise inverse of the netmask. Where the netmask has 1s (network bits), the wildcard has 0s, and vice versa. Cisco ACLs and OSPF network statements use wildcard masks instead of netmasks.
Which IP class is my address?
Classful addressing is obsolete, but the labels are still used informally. Class A starts with 1-126, B with 128-191, C with 192-223, D with 224-239 (multicast), E with 240-255 (reserved). The class is now just a naming convention - the CIDR suffix controls the actual subnet.
Does this tool work with IPv6?
Not in this version. IPv6 addressing is 128 bits and uses different notation and subnetting rules. A dedicated IPv6 tool is planned.
Command line equivalent
# Linux
ipcalc 192.168.1.42/24
sipcalc 192.168.1.42/24
# macOS
ipcalc -n 192.168.1.42 255.255.255.0
# Python (built-in)
python3 -c 'import ipaddress; n = ipaddress.ip_network("192.168.1.42/24", strict=False); print(n.network_address, n.broadcast_address, n.netmask, n.num_addresses)'
# Node
node -e 'const net = require("net"); console.log(net.isIPv4("192.168.1.42"))'
# Online: search "subnet calculator" - but you are already here