IPv4 CIDR Subnet Mask & Equal-Size VLAN Planner Calculator

Interactive CIDR Subnet Mask & Equal-Size VLAN Planner (RFC 4632)

RFC 4632 · RFC 1878
SCENARIO PRESETS:
?Parent CIDR block you were assigned: the /24 from your addressing plan, or the mask shown on the router interface. Choose the prefix that contains every VLAN. Range: /8 to /30 (select).
?Number of VLAN subnets to carve from the parent block: one per VLAN in the plan, including management and transit links. Range: 1 to 128 (units).
?Usable hosts needed in the largest VLAN, already including growth; the calculator does not add it. Read it from the device count or the DHCP pool size. Range: 2 to 65,534 (hosts).
?IPv4 address of the parent block, as four decimal numbers separated by dots (192.168.1.0). A host address inside the block also works: the calculator masks it to the prefix and shows the network that contains it. Leading zeros are not accepted. In the child subnet list, host and broadcast addresses show only the octets that differ from the subnet's network address.
?Optional. Host counts of the subnets you need, separated by commas (100, 50, 20, 2), up to 128 sizes of 1 to 65,534 hosts. The calculator allocates them from the largest down inside the parent, at least a /30 each. Leave it empty to use the equal-size plan above.
DOTTED SUBNET & WILDCARD MASK
Mask = 255.255.255.0 · Wildcard = 0.0.0.255
PARENT TOTAL IPs & USABLE HOSTS
/24 = 256 IPs (254 usable hosts)
NETWORK ADDRESS & BROADCAST
192.168.1.0/24 · broadcast 192.168.1.255
FIRST AND LAST USABLE HOST
192.168.1.1 to 192.168.1.254
PRIVATE ADDRESS SPACE (RFC 1918)
Private: inside 192.168.0.0/16 (RFC 1918)
EQUAL-SIZE VLAN PREFIX
/26 per VLAN (62 usable hosts)
SUBNET CAPACITY OF THE PARENT BLOCK
Up to 4 subnets of /26 fit in the /24 parent
VLANS REQUESTED
4 requested · all fit, 0 spare blocks
VLAN ADDRESS SPACE CONSUMED
100% of the /24 parent block used by the planned VLANs
VLSM ALLOCATION, LARGEST FIRST
Equal-size mode: VLSM list empty
CHILD SUBNETS: NETWORK, HOSTS, BROADCAST
192.168.1.0/26: hosts .1 to .62, broadcast .63; 192.168.1.64/26: hosts .65 to .126, broadcast .127; 192.168.1.128/26: hosts .129 to .190, broadcast .191; 192.168.1.192/26: hosts .193 to .254, broadcast .255
CALC16 · CIDR Subnet Mask & Equal-Size…192.168.1.0192.168.1.1255.255.255.0254
Computed in your browser

Use the CIDR Subnet Mask & Equal-Size VLAN Planner (RFC 4632) to evaluate N_hosts = 2^(32 − p) − 2; /31 link = 2 (RFC 3021) | p_vlan = 32 − ⌈log₂(H_max + 2)⌉ for enterprise VLAN segmentation, data center spine-leaf addressing. With the defaults (Parent Network CIDR Prefix = /24, Number of Sub-VLANs Required = 4, Hosts Needed in Largest VLAN = 50) it returns Dotted subnet & wildcard mask: Mask = 255.255.255.0 · Wildcard = 0.0.0.255.

Governing equationN_hosts = 2^(32 − p) − 2; /31 link = 2 (RFC 3021) | p_vlan = 32 − ⌈log₂(H_max + 2)⌉ (IETF RFC 4632 (CIDR) & RFC 1878 (VLSM address tables))

Model assumptions

Default equal-size VLAN plan: every VLAN gets one block sized for the largest VLAN. The host count must already include growth. A plan that uses every block of the parent (100 % used) fits but leaves no room for another VLAN; the status then reads FITS, NO SPARE BLOCK. Parent prefix: /8 to /30. Largest VLAN: 2 to 65,534 hosts. The VLSM list allocates from the largest size down, at least a /30 each. The child list shows at most 32 subnets.

Computed in your browser. The calculator, the tables and the worked examples run the same equations.

Why Flat /24 Subnets Exhaust Enterprise IPv4 Space and Break OSPF Summarization Boundaries

Allocating uniform /24 (255.255.255.0) blocks to every campus VLAN, router uplink and management loopback is the fastest way to fragment an RFC 1918 private block (10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16) and exhaust it early. Under Classless Inter-Domain Routing (RFC 4632), a subnet of prefix length /P reserves 32 - P host bits, giving 2^(32-P) IPv4 addresses and 2^(32-P) - 2 usable hosts once the all-zeros network identifier and the all-ones broadcast address are excluded.

Beyond address conservation, CIDR alignment decides whether an OSPFv2 (RFC 2328) Area Border Router can summarize many VLANs into one prefix. Eight contiguous /24 VLANs aligned on an 8-subnet boundary (10.40.0.0/24 through 10.40.7.0/24) collapse into one 10.40.0.0/21 summary; unaligned or scattered subnets cannot, and every link flap then floods Type-3 Summary LSAs across the backbone.

RFC 4632 IPv4 CIDR Prefix Reference Chart (/16 through /32) — Computed via N_hosts = 2^(32 − p) − 2; /31 link = 2 (RFC 3021) | p_vlan = 32 − ⌈log₂(H_max + 2)⌉ (IETF RFC 4632 (CIDR) & RFC 1878 (VLSM address tables)) · Sources checked November 2026
CIDR PrefixSubnet MaskWildcard MaskTotal IPsUsable Hosts/24 Equivalents
/16255.255.0.00.0.255.25565,53665,534256x /24
/17255.255.128.00.0.127.25532,76832,766128x /24
/18255.255.192.00.0.63.25516,38416,38264x /24
/19255.255.224.00.0.31.2558,1928,19032x /24
/20255.255.240.00.0.15.2554,0964,09416x /24
/21255.255.248.00.0.7.2552,0482,0468x /24
/22255.255.252.00.0.3.2551,0241,0224x /24
/23255.255.254.00.0.1.2555125102x /24
/24255.255.255.00.0.0.2552562541x /24
/25255.255.255.1280.0.0.1271281261/2 of /24
/26255.255.255.1920.0.0.6364621/4 of /24
/27255.255.255.2240.0.0.3132301/8 of /24
/28255.255.255.2400.0.0.1516141/16 of /24
/29255.255.255.2480.0.0.7861/32 of /24
/30255.255.255.2520.0.0.3421/64 of /24
/31255.255.255.2540.0.0.122 (RFC 3021, point-to-point links only)1/128 of /24
/32255.255.255.2550.0.0.011 (single host route)1/256 of /24

How to Evaluate Bitwise Mask Arithmetic, Wildcard Inverse Masks, and Hierarchical Block Packing Rules?

To avoid overlapping partitions, assign subnets from the largest host requirement down to the smallest. Each child prefix /P_child must start on a multiple of its block size 2^(32 - P_child) inside the parent. A prefix /P becomes the mask M = (0xFFFFFFFF << (32 - P)) & 0xFFFFFFFF, and the ACL wildcard mask is its complement, 2^(32-P) - 1.

This calculator adds no growth buffer, so enter a host count that already includes one: P_opt = 32 - ceil(log2(N_hosts_buffered + 2)). The planner above returns both masks, the network, broadcast and host range of the base address you type, its RFC 1918 class and how many child VLANs fit, and lists the child subnets (the first 32 if there are more). By default every child gets the block size of the largest VLAN. Type host counts separated by commas in the VLSM field and it allocates variable-size subnets from the largest down, at least a /30 each, or says that they do not fit.

Equal-Size VLAN Capacity Inside a Parent /24 (256 IP) Block — Computed via N_hosts = 2^(32 − p) − 2; /31 link = 2 (RFC 3021) | p_vlan = 32 − ⌈log₂(H_max + 2)⌉ (IETF RFC 4632 (CIDR) & RFC 1878 (VLSM address tables)) · Sources checked November 2026
Required Hosts / VLANAssigned Sub-PrefixUsable Hosts / BlockMax Subnets in /24Subnet Mask
100 hosts/251262 subnets255.255.255.128
50 hosts/26624 subnets255.255.255.192
25 hosts/27308 subnets255.255.255.224
12 hosts/281416 subnets255.255.255.240
5 hosts/29632 subnets255.255.255.248
2 hosts/30264 subnets255.255.255.252

Worked Examples: Two Presets Calculated with N_hosts = 2^(32 − p) − 2; /31 link = 2 (RFC 3021) | p_vlan = 32 − ⌈log₂(H_max + 2)⌉

Worked Example 1 (Enterprise /16 with 12 VLANs, 2,000-host largest VLAN): This preset sets Parent Network CIDR Prefix = /16, Number of Sub-VLANs Required = 12, Hosts Needed in Largest VLAN = 2000. Evaluating N_hosts = 2^(32 − p) − 2; /31 link = 2 (RFC 3021) | p_vlan = 32 − ⌈log₂(H_max + 2)⌉ gives: VLANs requested = 12, spare blocks = 20, parent prefix = 16 bits, mask = 255.255.0.0, wildcard = 0.0.255.255, parent IPs = 65536, usable hosts = 65534, VLAN prefix = 21 bits, hosts per VLAN = 2046, maximum VLANs = 32, fit status = FITS CLEANLY, VLAN space used = 37.5 %. Related in the Network, Fiber, PoE & Rack Hub: VPN Tunnel MTU & TCP MSS Clamping Calculator and WAN Bandwidth-Delay Product (BDP) & TCP Window Calculator.

Worked Example 2 (Campus /22 at 100 % fill: 8 VLANs of 110 hosts): This preset shifts the operating inputs to Parent Network CIDR Prefix = /22, Number of Sub-VLANs Required = 8, Hosts Needed in Largest VLAN = 110 to show a full parent: the 110-host VLANs need /25 blocks and the /22 holds 8 of them, so 8 VLANs use 100 % and the status reads FITS, NO SPARE BLOCK. The calculator returns: VLANs requested = 8, spare blocks = 0, parent prefix = 22 bits, mask = 255.255.252.0, wildcard = 0.0.3.255, parent IPs = 1024, usable hosts = 1022, VLAN prefix = 25 bits, hosts per VLAN = 126, maximum VLANs = 8, fit status = FITS, NO SPARE BLOCK, VLAN space used = 100.0 %. You can compare these limits with other calculators in the Engineering Studio.

Step-by-Step Campus IPAM Audit and ACL Wildcard Verification Procedure

When auditing a campus IP Address Management (IPAM) plan, enter the base address, the parent prefix (for example, a /20 with 4,096 addresses) and the host count of the largest VLAN, growth included. Check that the child prefix (such as /23 for 510 usable hosts) divides the parent into a power-of-two number of blocks, then copy the wildcard mask into your OSPF network statements and prefix lists.

Sources

  1. IETF RFC 4632 · Classless Inter-domain Routing (CIDR)Prefix notation address/P: P is the number of leading significant bits (0 to 32). Basis of 2^(32-P) addresses per block.
  2. IETF RFC 1878 · Variable Length Subnet Table for IPv4Address counts per prefix: /24 = 256, /27 = 32, /30 = 4. Basis of the parent and VLAN block sizes in the reference tables.
  3. IETF RFC 3021 · Using 31-Bit Prefixes on IPv4 Point-to-Point LinksA 31-bit prefix leaves only two numbering possibilities on a point-to-point link. Basis of the /31 remark in the prose.
  4. IETF RFC 1918 · Address Allocation for Private InternetsPrivate blocks 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (section 3). Basis of the private-space check on the base address.

Method and test suite: Calculation Methodology.

Frequently Asked Questions: CIDR Subnet Mask & Equal-Size VLAN Planner (RFC 4632)

Why does a /23 subnet provide 510 usable hosts instead of 508 when combining two /24 networks?

Two /24 networks lose two network IDs and two broadcast addresses, leaving 508 usable hosts. One /23 is a single block of 2^9 = 512 addresses with one of each, so 510 hosts are usable.

When should I deploy a /31 subnet (RFC 3021) instead of a /30 subnet on point-to-point links?

Use /31 only on point-to-point links. RFC 3021 lets both addresses of the 2-address block act as hosts, with no network or broadcast address, but both ends must support 31-bit prefixes. Otherwise use a /30 (4 addresses, 2 usable hosts); on any multi-access segment use a /30 or larger.

How do I calculate the OSPF wildcard mask from a dotted-decimal subnet mask?

Subtract each octet of the subnet mask from 255. A /22 mask of 255.255.252.0 gives the wildcard 0.0.3.255, which matches any address whose top 22 bits are fixed.

What happens if I assign a /22 block starting at 10.1.2.0 instead of 10.1.0.0 or 10.1.4.0?

A /22 spans 4 contiguous third-octet values, so valid boundaries are multiples of 4. Masked with 255.255.252.0, 10.1.2.0 truncates back to 10.1.0.0/22 (the calculator shows it as the network of the address you typed), so routers reject the entry or it overlaps 10.1.0.0/23.