>_
smartdevbox
Open SmartDevBox — free, no sign-up97+ tools · 100% client-side · no account required

CIDR / Subnet Calculator — Calculate Subnet Details Online

CIDR / Subnet Calculator takes an IPv4 CIDR block (e.g. 192.168.1.0/24) and computes: network address, subnet mask, wildcard mask, broadcast address, first and last usable host, number of usable hosts, IP class, and whether the address is in a private RFC 1918 range. It also displays the subnet mask in binary for visualising the prefix boundary. All calculation runs in the browser with no server communication.

Understanding CIDR and Subnetting

Before CIDR (introduced in 1993), IP addresses were divided into fixed classes: Class A (/8, 16.7M hosts), Class B (/16, 65K hosts), Class C (/24, 254 hosts). This was wasteful — an organisation needing 1000 hosts had to take a Class B (65K addresses) because Class C was too small. CIDR replaced classes with a variable-length prefix that can be any value from /0 to /32, allowing exact-fit allocation.

A subnet is a logical subdivision of a larger network. In a /24 network (256 addresses), you might carve out a /26 (64 addresses) for web servers, a /27 (32 addresses) for database servers, and reserve the rest for future use. Cloud providers use this extensively: AWS VPCs are typically /16 or /24, with individual subnets as /24 or /28 per availability zone.

The subnet mask encodes the prefix in dotted-decimal: a /24 prefix means the first 24 bits are 1s, or 11111111.11111111.11111111.00000000 = 255.255.255.0. A /19 prefix is 11111111.11111111.11100000.00000000 = 255.255.224.0. Routers use the mask to determine whether a destination IP is on the local network (AND with mask = network address) or must be forwarded.

Common Subnet Sizes Reference

/32 — Single host (1 IP). Used in host routes and /32 security group rules. /31 — Point-to-point links (2 IPs, RFC 3021). No broadcast or network address in /31. /30 — 4 IPs, 2 usable. Classic WAN link size. /29 — 8 IPs, 6 usable. Smallest typical customer allocation. /28 — 16 IPs, 14 usable. AWS minimum subnet size. /27 — 32 IPs, 30 usable. /26 — 64 IPs, 62 usable. /25 — 128 IPs, 126 usable. /24 — 256 IPs, 254 usable. The most common subnet in LANs and cloud VPCs.

/23 — 512 IPs, 510 usable. /22 — 1024 IPs, 1022 usable. /21 — 2048 IPs, 2046 usable. /20 — 4096 IPs. /16 — 65536 IPs. Typical VPC size. /10 — 4.2M IPs. /8 — 16.7M IPs. Class A range. Note: /0 covers the entire IPv4 address space (0.0.0.0/0), used in default routes.

Common Use Cases

  • Planning IP address allocation for VPC subnets in AWS, GCP, or Azure
  • Verifying firewall rules and security group CIDR ranges
  • Designing network topologies for on-premises infrastructure
  • Learning subnetting and binary mask calculations
  • Checking whether two IP addresses are in the same subnet

Frequently Asked Questions

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation represents an IP address and a network prefix length as a single string: IP/prefix, e.g. 10.0.0.0/8. The prefix length (0–32) specifies how many leading bits are fixed (the network part); the remaining bits are free (the host part).

How many hosts does a /24 subnet have?

A /24 subnet has 2^(32-24) = 256 total IP addresses. Two are reserved: the network address (e.g. 192.168.1.0) and the broadcast address (192.168.1.255). That leaves 254 usable host addresses.

What is the difference between subnet mask and wildcard mask?

The subnet mask has 1s for the network bits and 0s for the host bits (e.g. 255.255.255.0 for /24). The wildcard mask is the bitwise inverse: 0s for the network bits and 1s for the host bits (e.g. 0.0.0.255 for /24). Wildcard masks are used in Cisco ACLs and OSPF area definitions.

What are the private IP address ranges?

RFC 1918 defines three private ranges: 10.0.0.0/8 (Class A, 16.7M addresses), 172.16.0.0/12 (Class B, 1M addresses), and 192.168.0.0/16 (Class C, 65K addresses). These addresses are not routed on the public internet and are used in private networks and cloud VPCs.

Privacy & Security

This tool runs entirely in your browser using client-side JavaScript. No data is sent to a server — your input never leaves your machine. SmartDevBox has no account system, no usage tracking, and no paid tier. See the Privacy & Security page for full details.

  • IP Address InspectorInspect an IPv4 or IPv6 address: class, type, private/public, loopback, multicast, binary representation. Free, no sign-up, 100% client-side.
  • Random IP GeneratorGenerate random IPv4 addresses for testing and development. Free, no sign-up, 100% client-side.
  • String InspectorView character, word, line, sentence, byte, and Unicode statistics for any text. Free, no sign-up, 100% client-side.