Subnet Calculator

Calculate network address, broadcast address, subnet mask, and usable host range instantly from any IP address and CIDR prefix.

All calculations run locally in your browser — nothing is sent to my server.

Enter an IPv4 address with a CIDR prefix above (e.g. 10.0.0.0/16) to calculate its subnet details.

What Is CIDR Notation?

CIDR (Classless Inter-Domain Routing) notation is a method of representing an IP address and its routing prefix length by appending a slash and a number to the address, such as 192.168.1.0/24. That number — the prefix length — is how many leading bits of the 32-bit IP address are fixed as the "network" portion; the remaining bits identify individual hosts within that network.

CIDR replaced the older "classful" system (Class A/B/C), which wasted huge blocks of address space by only allowing fixed-size networks. CIDR lets a network be sized to fit exactly what's needed, from a single host (/32) up to millions of addresses (/8).

Why Subnetting Matters

  • Network segmentation: Splitting a network into subnets isolates traffic between departments, VLANs, or environments (production vs. staging), limiting how far a security incident can spread.
  • Cloud infrastructure & certification: AWS VPCs, Azure Virtual Networks, and Google Cloud VPCs are all defined by a CIDR block, and every subnet within them needs its range planned to avoid overlap. Subnetting is also a foundational topic on industry exams like Cisco CCNA, AWS Certified Solutions Architect, and CompTIA Network+.
  • Firewall rules: Precise CIDR ranges let you scope a firewall or security group rule to exactly the hosts that need access, instead of opening it to a whole network.
  • Efficient address use: Sizing a subnet to the number of hosts it actually needs — instead of defaulting to /24 everywhere — avoids wasting IP address space, which matters most with limited private ranges or public IPv4 blocks.

Understanding Your Results

FieldWhat It Means
Network AddressThe first address in the subnet (all host bits set to 0). Identifies the subnet itself — not assignable to a device.
Broadcast AddressThe last address in the subnet (all host bits set to 1). Used to reach every device on the subnet at once — not assignable to a device.
Usable Host RangeThe addresses between the network and broadcast address — these are the ones you can actually assign to devices.
Subnet MaskThe dotted-decimal form of the CIDR prefix (e.g. /24 = 255.255.255.0), used to configure network interfaces.
Wildcard MaskThe inverse of the subnet mask, used in Cisco access control lists (ACLs) and some routing configurations.
IP ClassThe legacy Class A/B/C/D/E designation based on the first octet. Informational only — CIDR ignores class boundaries.
Address TypeWhether the address falls in a private (RFC 1918), loopback, link-local, or public range.

Common CIDR Prefixes Reference

Quick reference for the most commonly used subnet sizes:

CIDR PrefixSubnet MaskTotal IP AddressesUsable Hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 (point-to-point, RFC 3021)
/32255.255.255.25511 (single host)

All calculations on this page run entirely in your browser. Need to find the owner of a specific IP address instead? Try the free WHOIS Lookup tool to identify domain ownership and network providers.

Frequently Asked Questions

What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation writes a subnet as an IP address followed by a slash and a prefix length, e.g. 192.168.1.0/24. The prefix length is the number of leading bits in the subnet mask that are fixed as the network portion — the remaining bits identify individual hosts within that network.
How do I calculate the number of usable hosts in a subnet?
Take 2 raised to the power of the number of host bits (32 minus the CIDR prefix), then subtract 2 — one address is reserved for the network address and one for the broadcast address. For example, a /24 has 8 host bits, so 2^8 = 256 total addresses, minus 2 reserved = 254 usable hosts. The two smallest subnets, /31 and /32, are special cases (see below).
What's the difference between the network address and the broadcast address?
The network address is the first address in a subnet (all host bits set to 0) and identifies the subnet itself — it cannot be assigned to a device. The broadcast address is the last address in a subnet (all host bits set to 1) and is used to send a message to every device on that subnet at once. Neither is usable as a regular host address.
What is a /31 or /32 subnet used for?
A /32 identifies a single host with no network or broadcast address — commonly used for loopback addresses or firewall rules targeting one exact IP. A /31, per RFC 3021, has no usable network or broadcast address either; both of its two addresses are usable, making it a common choice for point-to-point router links where every address should count.
Does this tool support IPv6?
Not currently — this calculator supports IPv4 addresses and CIDR prefixes only (0-32). IPv6 uses a different, 128-bit addressing scheme with its own subnetting conventions.
Is my IP address stored when I use this calculator?
No. All calculations run entirely in your browser using JavaScript — nothing is sent to my server or anywhere else. You can even use this tool offline once the page has loaded.
On This Page