Why calculate offline?
Most subnet calculators are server-backed. When you enter an IP address, the calculation happens on a remote server and your input is transmitted over the network. For internal network addresses, private ranges, or addresses containing sensitive topology information, this creates an unnecessary exposure even when the connection is encrypted, because the server still sees the exact address you typed.
CapyToolkit processes all subnet calculations locally in your browser using JavaScript bitwise operations for IPv4 and BigInt arithmetic for IPv6. Nothing leaves your machine, and no server records the network ranges you are working with. You can load the page once, disconnect from the internet, and the tool will keep working because all of the logic is already downloaded into your browser.
Subnet basics
A subnet is a logical subdivision of an IP network, and the rules that govern how traffic moves between subnets are the same whether you are wiring up a home lab or designing a regional cloud footprint. Understanding how the network and host portions of an IP address interact is the foundation for everything else in this article, from reading the calculator results to planning variable-length allocations.
The key insight is that the boundary between network and host bits is not fixed by the IP address itself, it is defined by the subnet mask or CIDR prefix. Move the boundary one bit to the right and you double the number of networks while halving the number of hosts in each. That trade-off is the basic lever every network designer pulls when carving a block into smaller pieces, and the calculator makes the arithmetic explicit so you can verify the result before committing it to a routing table or a cloud configuration.
Network and host portions
CIDR (Classless Inter-Domain Routing) notation splits an IP address into a
network portion and a host portion. The number after the slash tells you
how many bits from the left identify the network. For example, 192.168.1.0/24 means the first 24 bits (255.255.255.0 mask) define the network, leaving 8
bits for host addresses (256 total, 254 usable). Each extra bit you add to
the prefix doubles the number of networks you can create while halving the
number of hosts in each one.1
Subnet masks and broadcast addresses
The subnet mask in binary is a sequence of 1-bits followed by 0-bits. A
/24 mask is
11111111.11111111.11111111.00000000 in dotted binary, or 255.255.255.0 in decimal. The network address is the IP with the host bits set to 0, and
the broadcast address (IPv4) has all host bits set to 1.1 Because the
network and broadcast addresses cannot be assigned to devices, the usable
host count for a /24 is 256 minus 2, or 254.
CIDR Subnet Calculator Guide
CIDR notation is how most networks, firewalls and cloud consoles write a
subnet today: an address, a slash and the number of network bits, so
/24 means 24 network bits and 8 host bits. The guide below lists
every common prefix with its subnet mask, shows where CIDR appears in cloud and
firewall rules, walks through the calculator step by step and covers route
summarization and how the rules change for IPv6.
CIDR notation defines network boundaries with a slash. The number after the slash counts the network bits in the subnet mask, so /24 means 24 network bits (255.255.255.0), leaving 8 host bits for 254 usable addresses.1
Cloud providers, routers, and firewalls all use CIDR notation to define routes, access control rules, and VPC boundaries. AWS requires CIDR blocks for every VPC and subnet. Azure uses CIDR for virtual network address spaces. Kubernetes assigns pod CIDRs to each node. Understanding CIDR arithmetic is fundamental to configuring any of these systems correctly and avoiding address conflicts that break production traffic.
CIDR prefix and subnet mask equivalents
Inside any CIDR block, two addresses are always reserved: the network address (all host bits zero) and the broadcast address (all host bits one). For /24, this leaves 254 usable hosts from 256 total. Understanding which addresses are usable and which are reserved prevents misconfiguration when assigning static IPs to servers or configuring DHCP pools.
Prefix length and address doubling
Each step shorter in prefix length doubles the address space: /23 gives 510 usable, /22 gives 1022, /21 gives 2046. Building on this, each step longer halves it: /25 gives 126, /26 gives 62, /27 gives 30. The formula is always 2^(32 minus n) minus 2 for usable host count, regardless of the starting address you choose.2 Consequently, a quick mental model for common prefixes, /24=254, /25=126, /26=62, /27=30, /28=14, /29=6, /30=2, covers most network planning without a calculator.
Keep this doubling relationship in mind when sizing subnets for growth. A team that expects 120 devices today fits comfortably in a /25, but a /24 buys room for four times the current count without renumbering. CapyToolkit shows the usable host count for any prefix so you can pick the smallest block that still leaves headroom before you commit the address space.
CIDR in cloud and firewall rules
Cloud providers extend the CIDR standard with their own reserved addresses. AWS and Azure each reserve 5 addresses per subnet rather than the standard 2, so a /24 in either cloud provides 251 usable addresses.3 GCP reserves 4 addresses per subnet.4 Building on this, firewall rules in AWS Security Groups and Azure NSGs accept CIDR notation as the source or destination, where 0.0.0.0/0 means all IPv4 addresses and 10.0.0.0/8 means the entire RFC 1918 private range. Furthermore, BGP route advertisements use CIDR prefixes, and a more specific /24 overrides a covering /20 in the routing table, which is how traffic engineering and anycast routing work in the global internet.5
Using the CIDR calculator
Enter any IPv4 address and prefix length, for example 10.0.0.0 with /22, and the calculator instantly shows the network address, broadcast address, usable host range, total address count, and subnet mask in dotted-decimal. Consequently, with the subnet calculator you can count usable hosts in a /24 before entering it into a cloud console, where mistakes require subnet recreation and hours of troubleshooting.
Planning firewall rules with CIDR ranges
For firewall rule work, use the calculator to confirm the exact address range a given CIDR covers before writing a permit or deny rule that affects production traffic. CapyToolkit provides the same calculations in a browser, so you do not need to install anything or send your network data to a third-party service. The prefix spinner lets you step through values to find the smallest prefix whose host count meets your requirement without manual arithmetic each time you plan a new subnet.
CIDR aggregation and route summarization
Route summarization reduces the number of entries in a routing table by advertising one aggregate prefix instead of many specific ones. If a branch office uses 192.168.16.0/24 through 192.168.31.0/24, the headquarters router can summarize all 16 subnets as 192.168.16.0/20. This single /20 route covers the entire 16-subnet range and shrinks the routing table by 15 entries.
Calculating the summary address requires finding the longest common prefix across all constituent subnets. Convert the lowest and highest addresses to binary, then count matching bits from the left. For 192.168.16.0 and 192.168.31.255, the first 20 bits match, giving a /20 summary.6 Building on this, BGP route aggregation at the ISP level works the same way: an ISP holding 203.0.113.0/24 through 203.0.118.0/24 advertises the covering /21 to peers. Consequently, proper summarization at every layer of the network hierarchy keeps global routing tables manageable and reduces convergence time after topology changes.
When summarization hides reachability
A summary route advertises reachability for every address in the aggregate, including subnets that may not actually exist behind the advertising router. If the branch office only uses 192.168.16.0/24 and 192.168.17.0/24 but advertises 192.168.16.0/20, the headquarters router forwards packets for 192.168.18.0/24 to that branch even though no hosts exist there. These packets either time out or generate ICMP unreachable messages, creating a black hole. To prevent this, configure a null route for the summary prefix on the advertising router so unmatched addresses are dropped locally rather than forwarded into a void.
CIDR in IPv6: why the rules change
IPv6 uses CIDR notation identically to IPv4, but the design assumptions differ. The standard IPv6 subnet is always /64, not the variable /24-through-/30 range common in IPv4.7 SLAAC requires 64 host bits to build EUI-64 interface identifiers, and breaking this assumption breaks auto-configuration on most operating systems. Consequently, IPv6 network planning focuses less on host-count arithmetic and more on prefix delegation hierarchy: a /48 site allocation contains 65,536 /64 subnets, one per VLAN or segment.8
Inside an IPv6 deployment, the CIDR calculator still serves a purpose: verifying that delegated prefixes align on correct boundaries. A /48 must start at a multiple of the 48th bit, and a /56 must align on a 56-bit boundary to avoid routing issues at the provider level. Building on this, ISPs delegate prefixes to customers using DHCPv6-PD (Prefix Delegation), which hands out /56 or /48 blocks from the ISP's aggregate. Verifying the delegated prefix with the calculator before configuring your router's LAN interfaces prevents misaligned subnets that cause routing failures in the provider's aggregation layer.
Use this calculator when you need to convert a CIDR block to its subnet mask equivalent, verify address ranges before committing them to a cloud VPC, or plan how many hosts fit in a given prefix.
AWS VPC creation requiring a /16 CIDR block
A /16 (255.255.0.0) provides 65,534 usable host addresses. AWS reserves 5 per subnet, so each /24 subnet within the /16 yields 251 usable addresses for EC2 instances.
Firewall rule allowing a specific /27 network segment
A /27 spans 32 addresses (30 usable). The network address is always divisible by 32. Use the calculator to confirm the correct block boundary before writing the rule.
- 1.
"Subnet," Wikipedia, accessed June 2026. https://en.wikipedia.org/wiki/Subnet
- 2.
V. Fuller, T. Li, J. Yu, K. Varadhan, "Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy," RFC 1519, IETF, September 1993. https://www.rfc-editor.org/rfc/rfc1519.html
- 3.
Amazon Web Services, "Subnet CIDR blocks," docs.aws.amazon.com, accessed June 2026. https://docs.aws.amazon.com/vpc/latest/userguide/subnet-sizing.html
- 4.
Microsoft, "Private IP addresses in Azure," learn.microsoft.com, accessed June 2026. https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/private-ip-addresses
- 5.
Google Cloud, "VPC-native clusters," cloud.google.com, accessed June 2026. https://cloud.google.com/kubernetes-engine/docs/concepts/alias-ips
- 6.
Cisco, "Select BGP Best-path Algorithm," cisco.com, April 2026. https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html
- 7.
"IPv6 address," Wikipedia, accessed June 2026. https://en.wikipedia.org/wiki/IPv6_address
- 8.
S. Thomson, T. Narten, T. Jinmei, "IPv6 Stateless Address Autoconfiguration," RFC 4862, IETF, September 2007. https://www.rfc-editor.org/rfc/rfc4862.html
CIDR (Classless Inter-Domain Routing) notation combines an IP address and a prefix length into one string, like 192.168.0.0/24. The prefix length tells you how many bits define the network portion, and the rest are host bits that you can assign to devices.
Count the consecutive 1-bits in the subnet mask. 255.255.255.0 has 24 consecutive ones, making it /24. CapyToolkit performs this conversion instantly in both directions so you can move between formats without manual arithmetic.
A /25 splits a /24 in half. It has 128 total addresses (126 usable) versus a /24's 254. Use /25 to divide a network into two equal segments for separate access zones without wasting a larger block.
A /16 contains 65,536 total addresses. After reserving the network and broadcast, 65,534 are usable in standard IPv4. AWS and Azure reserve additional addresses per subnet, reducing the count further to 65,531 in cloud environments.
Yes. /32 in IPv4 or /128 in IPv6 identifies exactly one address. This is used in host routes, security group rules for a single IP, and some BGP configurations that target individual servers.
IPv4 vs IPv6
IPv4 and IPv6 are two generations of the Internet Protocol that coexist on most networks today. They share the same fundamental idea, an address identifies a host and a prefix length defines the network boundary, but they differ in address size, notation, and several behaviours that affect subnetting. The calculator handles both, and the results panel adapts to whichever format you enter.
IPv4 addressing and exhaustion
IPv4 addresses are 32 bits, written as four decimal octets (0-255)
separated by dots.2 With roughly 4.3 billion
addresses total, the global IPv4 pool was exhausted in 2011, which is why
private ranges and network address translation are now standard in most
networks.3 Private IPv4 ranges such as
10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are reserved for private
internets rather than public routing, so the same blocks can be reused in
separate organisations without conflict.4 In full,
those blocks run 10.0.0.0 through 10.255.255.255, 172.16.0.0
through 172.31.255.255, and 192.168.0.0 through 192.168.255.255,
with the /12 block the one to watch: its second octet runs 16 through 31
rather than filling a whole octet.4
IPv6 addressing and multicast
IPv6 uses 128-bit addresses written in hexadecimal groups separated by colons, providing 2^128 addresses, enough to assign trillions to every square millimeter of the earth's surface.5 There are no broadcast addresses in IPv6; that role is superseded by multicast, which delivers packets only to the interfaces that joined a particular group. The "Last Address" field replaces "Broadcast Address" for this reason, and every address in an IPv6 subnet is usable, so the usable host count equals the total address count.5
Because IPv6 subnets are normally allocated a /64 for the interface
identifier, even a single link has more addresses than the entire IPv4
internet combined, which is why address exhaustion is effectively a
non-issue for new network deployments that standardise on IPv6 and why
providers can hand out enormous blocks without worrying about conservation.
The calculator answers the IPv6 question the same way it answers IPv4.
Paste an address such as 2001:db8::, set the prefix, and the same
16-field output renders for the 128-bit network, with no mode switch to
find because the address format itself is detected. Sizing works as pure
prefix arithmetic: a /48 splits into 65,536 /64 segments, a /56
into 256 of them, and a /128 names exactly one host. Because the
hierarchy moves in clean powers of two, you can plan a whole site from a
single allocated prefix, checking each level in the fields above as you
carve it.
Reading your results
The results table shows 16 fields grouped around the same subnet you typed in. Start with Network Address and CIDR Notation to confirm the correct subnet, then check Usable Hosts to see how many devices can be assigned within that range. The Binary fields show the exact bit patterns, which helps you understand how the prefix length works at the bit level and why certain host counts jump in powers of two.
Hex Range Start and Hex Range End render the same subnet boundaries in hexadecimal, which is useful when you are working with low-level network tools, debugging routing tables, or comparing ranges against switch configurations. CapyToolkit displays every value so you can copy exactly the field you need without reformatting it yourself.
Variable-length subnetting and address efficiency
In the early internet, network blocks were assigned in fixed classes, and an organisation that needed 300 addresses was handed a /24 with 256 slots or a /23 with 512, whether it wanted the extra addresses or not. Variable-length subnet masking replaced that rigidity with a way to size each subnet to its actual need, so a point-to-point link can take a tiny /31 while a busy floor takes a /25, both drawn from the same parent block.
From classful blocks to variable masks
Classful networking assigned fixed-size blocks: Class A for large
organisations (16 million addresses), Class B for medium ones (65,000
addresses), and Class C for small ones (256 addresses). This wasted
enormous address space because organisations were assigned blocks much
larger than they needed. VLSM (Variable Length Subnet Masking) replaced
classful allocation by letting network designers carve an address block
into subnets of exactly the sizes required, so a point-to-point link can
take a tiny /31 while a busy floor takes a /25, both drawn from the same
parent block.6 RFC 3021 defines a /31 as a point-to-point link where both addresses are usable, since there is no broadcast on a link with only two endpoints.7 A /30 gives four addresses and two usable hosts, while a /25 gives 128 addresses and 126 usable hosts for a floor with many workstations.72
Alignment rules for VLSM subnets
Calculating VLSM allocations manually is error-prone because each subnet's
boundaries must align on power-of-two address boundaries. A /26 subnet (64
addresses) must start at an address divisible by 64: 0, 64, 128, or 192
within any octet. Placing a /26 starting at 32 is invalid. This calculator
shows the exact network address and usable range for any IP and prefix,
making it straightforward to verify alignment and avoid the overlap errors
that misconfigured VLSM networks introduce.
Subnetting in cloud VPC design
Cloud providers require subnets within a Virtual Private Cloud (VPC) to be
non-overlapping and sized to accommodate the services placed in them. AWS
requires a minimum /28 subnet (16 addresses), but reserves five addresses
per subnet for internal use, leaving 11 usable.8 Azure reserves the first four and last address in each subnet, leaving a /29
with only three usable hosts.9 Kubernetes
node pools typically need enough addresses for nodes, pods, and load balancer
IPs; AWS's own networking guide recommends private EKS subnets from /22 up to /20,
and notes that a 20-node cluster in one availability zone can consume 1,160 addresses.10 Calculating
the correct prefix for your expected instance count, scaling headroom, and provider
reservations before you create a VPC saves the significant operational pain of
re-addressing a live, production environment later.
The reserved-address rules above are the generic case, and the specialty
subnets carry their own minimums: a gateway subnet needs /27 or
larger, a firewall subnet /26, and an application gateway v2 a
dedicated /24 so autoscaling has room to grow.11
Because those services cannot shrink into a smaller block, the specialty
blocks get planned first and workload subnets are allocated from the
address space that remains. The calculator shows the total address count
for any prefix you type, so the check is one field: enter the specialty
prefix, confirm the count clears the minimum, and carve the next block
from what is left.
Cloud VPC Subnet Minimums
- AWS VPC minimum /28 (16 addresses, 5 reserved, 11 usable)
- Azure VNet minimum /29 (8 addresses, 5 reserved, 3 usable)
- EKS private subnet sizing /22 to /20 (1,019-4,091 usable)
Calculate your own subnet above and compare it against these common cloud minimums.
- 1.
V. Fuller and T. Li, "Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan," RFC 4632, IETF, August 2006. https://www.rfc-editor.org/rfc/rfc4632
- 2.
Oracle, "Designing an IPv4 Addressing Scheme," docs.oracle.com, 2010. https://docs.oracle.com/cd/E19253-01/816-4554/ipplan-5/index.html
- 3.
"IPv4 address exhaustion," Wikipedia, accessed June 2026. https://en.wikipedia.org/wiki/IPv4_address_exhaustion
- 4.
Y. Rekhter, B. Moskowitz, D. Karrenberg, G. J. de Groot, and E. Lear, "Address Allocation for Private Internets," RFC 1918, IETF, February 1996. https://datatracker.ietf.org/doc/rfc1918/
- 5.
R. Hinden and S. Deering, "IP Version 6 Addressing Architecture," RFC 4291, IETF, February 2006. https://www.rfc-editor.org/rfc/rfc4291
- 6.
V. Fuller, T. Li, J. Yu, and K. Varadhan, "Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy," RFC 1519, IETF, September 1993. https://www.ietf.org/rfc/rfc1519.txt
- 7.
A. Retana, R. White, V. Fuller, and D. McPherson, "Using 31-Bit Prefixes on IPv4 Point-to-Point Links," RFC 3021, IETF, December 2000. https://www.ietf.org/rfc/rfc3021.txt
- 8.
Amazon Web Services, "Subnet CIDR blocks," docs.aws.amazon.com, accessed June 2026. https://docs.aws.amazon.com/vpc/latest/userguide/subnet-sizing.html
- 9.
Microsoft Learn, "Private IP addresses in Azure," learn.microsoft.com, November 2024. https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/private-ip-addresses
- 10.
Amazon Web Services, "Subnets," aws.github.io, accessed September 2026. https://aws.github.io/aws-networking-best-practices/foundation/subnets/
- 11.
Microsoft Learn, "Azure virtual networks and subnets," learn.microsoft.com, accessed September 2026. https://learn.microsoft.com/en-us/azure/networking/design-guide/vnets-subnets