Look Up Your Subnet Mask and CIDR Prefix

Skip the binary math: look up any prefix from /8 through /32 for host counts, usable addresses, wildcard masks, and block sizes, then confirm the exact value with the calculator above.

ZERO UPLOAD · ALL LOCAL
  1. Enter an IP address (IPv4 like 192.168.1.0 or IPv6 like 2001:db8::) into the input box.
  2. Set the CIDR prefix using the number input. The tool auto-detects IPv4 or IPv6.
  3. Results appear instantly: network address, usable IP range, host count, and more.
  4. Use the Copy buttons next to each field to grab individual values.
  5. Toggle between IPv4 and IPv6 by simply changing the IP address format.

What to look for

  • 254 usable hosts
  • 62 usable hosts
  • 14 usable hosts
  • 2 usable hosts
/

SUBNET CALCULATION RESULTS

IP Version
Network Address
Broadcast Address
First Usable IP
Last Usable IP
Total Addresses
Usable Hosts
Wildcard Mask
CIDR Notation
IP Class
IP Type
Binary (IP)
Binary (Mask)
Hex Range Start
Hex Range End
Usable Host Count

Look Up Your Subnet Mask and CIDR Prefix Fast

Scan the table below instead of running the subnet math yourself: prefix lengths map directly to host counts and block sizes, from /8 through /32, with every subnet mask equivalent listed alongside each one.

Network engineers, system administrators, and cloud architects check these values dozens of times a week. Memorizing /24 = 254 hosts and /30 = 2 hosts covers most cases, but less common prefixes like /22 (1022 hosts) or /19 (8190 hosts) need a lookup. This page gives you the complete IPv4 prefix-to-host-count table with block sizes, subnet masks, wildcard masks, and common use cases for each prefix, and the calculator above confirms any value you are unsure about.

IPv4 CIDR reference table

From /8 to /30, the key values are: /8 = mask 255.0.0.0, block 16M, usable 16,777,214; /16 = 255.255.0.0, block 65,536, usable 65,534; /20 = 255.255.240.0, block 4,096, usable 4,094; /21 = 255.255.248.0, block 2,048, usable 2,046; /22 = 255.255.252.0, block 1,024, usable 1,022; /23 = 255.255.254.0, block 512, usable 510; /24 = 255.255.255.0, block 256, usable 254; /25 = 255.255.255.128, block 128, usable 126; /26 = 255.255.255.192, block 64, usable 62; /27 = 255.255.255.224, block 32, usable 30; /28 = 255.255.255.240, block 16, usable 14; /29 = 255.255.255.248, block 8, usable 6; /30 = 255.255.255.252, block 4, usable 2.1 This table covers every prefix used in typical LAN, cloud VPC, and WAN link design, so you can scan a single column to find the right prefix for any target host count without performing binary arithmetic each time.

Memorization patterns

The binary doubling rule makes subnet memorization mechanical. Each bit added to the prefix halves the host count. Starting from /24 (254 hosts): /25 is 126, /26 is 62, /27 is 30, /28 is 14, /29 is 6, /30 is 2. Going the other direction: /23 is 510, /22 is 1022, /21 is 2046, /20 is 4094. Building on this, each value is 2^n − 2 where n = 32 − prefix.1 For block sizes (total addresses, no subtraction): /24 = 256, /25 = 128, /26 = 64, /27 = 32, /28 = 16, /29 = 8, /30 = 4. Furthermore, subnet boundaries always fall on multiples of the block size, so a /26 (block 64) starts at 0, 64, 128, or 192 in the last octet.

Wildcard masks and ACL use

Wildcard masks are the bitwise inverse of subnet masks. Where a subnet mask has 1s in the network bits, a wildcard mask has 0s, and vice versa.2 255.255.255.0 (/24) inverts to 0.0.0.255. Cisco IOS uses wildcard masks in access control lists (ACLs) and OSPF area definitions: access-list 10 permit 192.168.1.0 0.0.0.255 permits the entire /24. Building on this, wildcard masks allow non-contiguous bit matching. For example, 0.0.0.254 matches every even address, though this technique is rarely used outside of route summarization. When writing Cisco ACL entries, always invert the subnet mask to get the wildcard: /26 mask 255.255.255.192 inverts to wildcard 0.0.0.63. With the subnet calculator you can invert a subnet mask for a Cisco ACL, which prevents the common mistake of copying a mask directly into an ACL and wondering why the rule matches the wrong traffic.

Subnetting in classful vs classless routing protocols

Classful routing protocols (RIPv1, IGRP) do not include subnet masks in their route advertisements.3 When a router running RIPv1 advertises 10.0.0.0, receiving routers assume the default classful mask (/8 for Class A, /16 for Class B, /24 for Class C). This means RIPv1 cannot support VLSM or discontiguous networks: every subnet of 10.0.0.0 must use the same mask, and subnets of different major networks cannot share a common supernet. The shift from classful to classless routing in the late 1990s was driven by the need to conserve IPv4 address space, and understanding why classful protocols fail at VLSM helps network engineers evaluate whether legacy equipment still has a place in modern networks.

Why classful protocols break VLSM

Because the mask is not advertised, every router along the path must infer it from the address class. A 10.x.x.x address is always Class A, so RIPv1 assumes /8 even if the network was subnetted to /26. This assumption makes discontiguous subnets (where two subnets of the same classful network are separated by a different classful network) unreachable, because the receiving router applies the wrong mask and drops the route into the wrong aggregate. The result is that every subnet under a classful protocol must use the same mask, eliminating the address conservation that VLSM provides.

How classless protocols solve the problem

Classless routing protocols (RIPv2, OSPF, EIGRP, BGP) include the prefix length in every route update, enabling VLSM and CIDR. Building on this, modern networks exclusively use classless protocols. If you encounter RIPv1 in a legacy environment, the subnet mask must be identical across all subnets of the same major network, which eliminates the address conservation benefits of VLSM.

The subnet calculator helps you identify which prefix lengths are valid under classful constraints: for a Class B address like 172.16.0.0, all subnets must use the same mask, and that mask must be /16 or longer. Migrating to OSPF or EIGRP removes this constraint and allows the variable-length allocations that efficient address planning requires.

Quick-reference subnet planning for common scenarios

Three recurring subnetting scenarios cover most real-world needs, and keeping them in mind lets you skip the calculator during whiteboard sessions and early design conversations. First, point-to-point WAN links use /30 (2 usable addresses) in IPv4 or /127 (RFC 6164) in IPv6.4 Second, server segments use /28 (14 usable) for small clusters and /24 (254 usable) for large ones. Third, user access subnets use /22 (1022 usable) for large offices and /24 (254 usable) for smaller floors. Memorizing these three patterns plus the doubling rule handles 90% of planning tasks.

Cloud provider reservation differences

For cloud environments, subtract the provider's reservation count from each prefix: AWS and Azure reserve 5,5 GCP reserves 4.6 Building on this, a /27 in AWS provides 27 usable addresses (32 minus 5), not the standard 30. The subnet calculator accounts for cloud reservations when you select the cloud mode, giving you the correct usable count for your target provider.

When to use the cheat sheet versus the calculator

Keeping a printed or bookmarked copy of the cheat sheet alongside the calculator covers both quick lookups and precise planning without switching between tools. Use the cheat sheet during whiteboard design sessions or phone conversations where you need a quick reference. Switch to the calculator when you need exact values for a non-standard prefix, cloud reservation math, or binary breakdowns of an arbitrary mask.

When to use this

Check this table when writing firewall rules, configuring router ACLs, or planning subnets away from a keyboard. When you need to verify an exact value instead of trusting memory, run the same prefix through the calculator above.

Examples

Configuring a Cisco ACL to permit a /26 network

Before
ip access-list extended PERMIT-WEB
 permit ip 192.168.1.64 255.255.255.192 any
After
ip access-list extended PERMIT-WEB
 permit ip 192.168.1.64 0.0.0.63 any

Cisco ACLs use wildcard masks (inverse of the subnet mask). /26 subnet mask 255.255.255.192 inverts to wildcard 0.0.0.63.

Determining the correct prefix for 200 hosts

/24 (254 usable) is the smallest prefix covering 200 hosts. /25 (126 usable) is too small. The block size for /24 is 256 — always a power of 2.

Sources
  1. 1.

    T. Pummill and B. Manning, "Variable Length Subnet Table For IPv4," RFC 1878, IETF, December 1995. https://datatracker.ietf.org/doc/html/rfc1878.html

  2. 2.

    Cisco, "Configure IP Access Lists," cisco.com, October 2025. https://www.cisco.com/c/en/us/support/docs/security/ios-firewall/23602-confaccesslists.html

  3. 3.

    J. Halpern and S. Bradner, "RIPv1 Applicability Statement for Historic Status," RFC 1923, IETF, March 1996. https://www.rfc-editor.org/rfc/rfc1923.txt

  4. 4.

    M. Kohno, et al., "Using 127-Bit IPv6 Prefixes on Inter-Router Links," RFC 6164, IETF, April 2011. https://www.rfc-editor.org/rfc/rfc6164.html

  5. 5.

    Amazon Web Services, "Subnet CIDR blocks," docs.aws.amazon.com, accessed June 2026. https://docs.aws.amazon.com/vpc/latest/userguide/subnet-sizing.html

  6. 6.

    Google Cloud, "Subnets," cloud.google.com, accessed June 2026. https://cloud.google.com/vpc/docs/subnets#ip_ranges

FAQ