IP Subnet / CIDR Calculator

Calculate subnet mask, network, broadcast, and host range for IPv4.

Input data

You can enter any host IP inside the subnet, not only the network address. CIDR prefix: 0–32.

Results

Enter an IPv4 address and CIDR prefix, then click Calculate.

What this calculator does

From an IPv4 address and CIDR prefix, the tool derives the canonical network block, subnet mask, wildcard, broadcast, host range, and address counts. Enter any host inside the subnet, or paste IP/prefix — you do not need the network address up front.

What CIDR means

CIDR notation (for example /24) states how many bits belong to the network portion. The rest are host bits. A /24 prefix → mask 255.255.255.0 and 256 addresses in the block. Larger prefix numbers mean smaller subnets.

How to read the results

  • Network address — identifies the whole block (first address).
  • Broadcast — last address of the block; used for broadcast traffic on a classic LAN.
  • Subnet mask — dotted form of the prefix; wildcard is its bitwise inverse (ACLs).
  • Host range — addresses typically assigned to devices (except /31 and /32 special cases).
  • Total vs usable — on a classic LAN, usable = total − 2 (network and broadcast).

CIDR quick reference table

A fast lookup of common subnet sizes — without recalculating from scratch.

PrefixMaskTotalUsableTypical use
/8255.0.0.016,777,21616,777,214very large nets / private 10/8
/12255.240.0.01,048,5761,048,574private 172.16/12
/16255.255.0.065,53665,534large VPC / campus
/20255.255.240.04,0964,094medium VPC / VLAN
/24255.255.255.0256254typical LAN / VLAN
/26255.255.255.1926462small VLAN / segments
/27255.255.255.2243230small host groups
/28255.255.255.2401614small pools / lab
/29255.255.255.24886small links / DMZ
/30255.255.255.25242point-to-point links
/31255.255.255.25422*P2P (RFC 3021)
/32255.255.255.25511*single host / route

* /31 and /32 use different semantics than a classic LAN — see calculator results and FAQ.

Private IPv4 ranges (RFC 1918)

  • 10.0.0.0/8 — 10.0.0.0 – 10.255.255.255
  • 172.16.0.0/12 — 172.16.0.0 – 172.31.255.255
  • 192.168.0.0/16 — 192.168.0.0 – 192.168.255.255

These ranges are for LANs, offices, and internal cloud networks. They are not routed on the public Internet. The calculator marks a result as private when the network falls in RFC 1918.

Use cases

  • LAN / VLAN planning
  • VPC subnet sizing
  • firewall rules and CIDR allowlists
  • ACL planning with wildcard masks
  • Kubernetes / cluster networking basics
  • documentation and range troubleshooting

FAQ — practical examples

What does /24, /27, or /30 mean?
/24 → mask 255.255.255.0, 256 addresses (254 usable on a LAN). /27 → 32 addresses (30 usable). /30 → 4 addresses (2 usable) — often a short point-to-point link. Larger prefixes mean smaller blocks.
What is the difference between a network address and a broadcast address?
The network address identifies the whole block. Broadcast is the last address and is used for broadcast traffic on a classic LAN. Hosts usually sit between them (except /31 and /32).
How many hosts fit in /24, /27, and /30?
On a classic LAN: /24 = 254 usable, /27 = 30, /30 = 2. The calculator shows both total addresses and usable hosts.
Can I enter a normal host IP instead of the network address?
Yes. Enter e.g. 192.168.1.42 and /24 (or paste 192.168.1.42/24) — results show the canonical block 192.168.1.0/24 and full details.
Why are /31 and /32 different from normal subnets?
/32 is a single-host route (network = broadcast = same IP). /31 (RFC 3021) typically treats both addresses as usable on a P2P link — no classic unused network/broadcast pair. The result view shows an explicit special-case note.
What is the difference between a subnet mask and a wildcard mask?
A subnet mask has network bits set to 1 (e.g. 255.255.255.0). A wildcard is its inverse (0.0.0.255), often used in ACLs. Both describe the same network/host split; the calculator outputs both ready to copy.
How would I use this result in a firewall rule or ACL?
Copy the canonical CIDR into an allow/deny rule, or use the mask and wildcard in an ACL. For a single host, use /32. The host range helps verify that a DHCP pool fits inside the subnet.
How do I choose the right subnet size for a VPC or VLAN?
Count the hosts you need (plus headroom), pick the smallest prefix from the table that fits (e.g. 40 hosts → /26), then verify with the calculator before pasting the CIDR into a cloud console or VLAN docs.