Skip to content
SIEMBench
100% Client-Side Tool • Inputs Never Sent to Our Servers

Visual CIDR / VLSM Subnet Calculator

Enter an address to see its network, range, masks and bits, split it into smaller subnets, or plan variable-length subnets for a whole site.

Binary bit map

Address10.20.30.45, 00001010000101000001111000101101
Mask255.255.252.0, 11111111111111111111110000000000
Network10.20.28.0, 00001010000101000001110000000000

1 Network bits: 220 Host bits: 10

CIDR10.20.28.0/22
Network address10.20.28.0
Broadcast address10.20.31.255
First usable host10.20.28.1
Last usable host10.20.31.254
Total addresses1,024
Usable hosts1,022
Subnet mask255.255.252.0
Wildcard mask0.0.3.255
ScopePrivate (RFC 1918)

Subnet splitter

4 subnets.

SubnetUsable rangeBroadcastUsableWildcard
10.20.28.0/2410.20.28.1 - 10.20.28.25410.20.28.2552540.0.0.255
10.20.29.0/2410.20.29.1 - 10.20.29.25410.20.29.2552540.0.0.255
10.20.30.0/2410.20.30.1 - 10.20.30.25410.20.30.2552540.0.0.255
10.20.31.0/2410.20.31.1 - 10.20.31.25410.20.31.2552540.0.0.255

How to use this tool in a SOC investigation

  1. Enter an IP address from an alert with its prefix, and read the network, range and scope.
  2. Check whether other addresses in the alert fall inside the same range.
  3. Use the CIDR or wildcard mask to scope a SIEM search or a firewall block.

Example: A firewall alert names 203.0.113.77 and your records list that network as a /26. Entering 203.0.113.77/26 gives 203.0.113.64/26, with usable addresses .65 to .126, so failed logons from .90 belong to the same network.

Frequently asked questions

How many usable hosts are in a subnet?

For prefixes from /0 to /30, subtract 2 from the block size of 2 to the power of (32 minus the prefix), because the first address names the network and the last is the broadcast address. A /24 has 254 and a /30 has 2. A /31 has 2 usable addresses under RFC 3021, and a /32 has 1.

What is the difference between a subnet mask and a wildcard mask?

A wildcard mask is the inverse of the subnet mask. In a subnet mask, 1 bits mark the network. In a wildcard mask, 0 bits must match and 1 bits are ignored. The wildcard for 255.255.255.0 is 0.0.0.255. Cisco IOS access lists and OSPF network statements use wildcard masks, while interface addresses use subnet masks.

Why do my hosts not fit when the total is smaller than the block?

Each subnet is rounded up to a power of two and normally loses two addresses to the network and broadcast. 127 hosts need a /24, because a /25 has only 126 usable addresses. Add up the block sizes and not the host counts. The allocator reports both the space needed and the parent size that would fit.

Are the addresses I enter sent anywhere?

No. Every calculation and export runs 100% client-side in your browser, with no network requests. Internal address plans and customer ranges are not sent to our servers, and the calculator keeps working if you disconnect after the page has loaded.

CIDR notation explained

An IPv4 address is a 32-bit number, written as four decimal octets for people to read. Classless Inter-Domain Routing (CIDR) adds a prefix length after a slash. In 10.20.30.45/22 the first 22 bits identify the network and the remaining 10 identify a host inside it.

Each extra prefix bit halves the block. Each bit removed doubles it. That single rule generates the whole table, and knowing a few entries by heart makes log review and firewall work much faster.

PrefixSubnet maskWildcardAddressesUsable
/8255.0.0.00.255.255.25516,777,21616,777,214
/16255.255.0.00.0.255.25565,53665,534
/22255.255.252.00.0.3.2551,0241,022
/24255.255.255.00.0.0.255256254
/26255.255.255.1920.0.0.636462
/28255.255.255.2400.0.0.151614
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122 (RFC 3021)
/32255.255.255.2550.0.0.011 (host route)

Binary subnetting made visual

The bit map above shows why a prefix that does not end on an octet boundary is hard to read in decimal. For 10.20.30.45/22 the boundary falls inside the third octet:

Address  00001010.00010100.000111|10.00101101   10.20.30.45
Mask     11111111.11111111.111111|00.00000000   255.255.252.0
Network  00001010.00010100.000111|00.00000000   10.20.28.0
Last     00001010.00010100.000111|11.11111111   10.20.31.255
  1. Write the address and the mask in binary.
  2. Keep every bit under a 1 in the mask and clear the rest. The result is the network address.
  3. Set all of the host bits to 1 instead. The result is the last address, which is the broadcast address.
  4. The addresses between them are usable by hosts.

A shortcut works in decimal. Subtract the interesting mask octet from 256 to get the block size: 256 − 252 = 4. Networks start at multiples of 4 in that octet (0, 4, 8, and so on). The largest multiple that does not exceed 30 is 28, so the network is 10.20.28.0 and the next one is 10.20.32.0.

A note for people who script this

JavaScript's bitwise operators return signed 32-bit integers, so masking an address of 128.0.0.0 or above can produce a negative number, and shifting by 32 does nothing at all. This calculator converts each result back to unsigned and is tested against arbitrary-precision arithmetic at every prefix from /0 to /32.

Cisco wildcard masks and subnet masks

A wildcard mask is what remains when each octet of the subnet mask is subtracted from 255. Cisco IOS uses it to say which bits of an address to ignore.

access-list 10 permit 10.20.28.0 0.0.3.255
router ospf 1
 network 10.20.28.0 0.0.3.255 area 0

Mixing the two up is a security problem and not only a syntax error. If a subnet mask is typed where a wildcard is expected, the router accepts it and matches a completely different set of addresses. A rule meant for one network may permit addresses all over the internet. Platforms also differ: Cisco ASA access lists take subnet masks, and NX-OS accepts prefix notation.

Why /31 works on point-to-point links

A traditional /30 spends four addresses to connect two routers. One names the network and one is the broadcast address, so half of the block is overhead. A link with only two ends has no need for a broadcast address, because anything sent is for the other end.

RFC 3021 therefore states that on a point-to-point link with a 31-bit mask, the two addresses must be interpreted as host addresses. A network with 500 router links saves 1,000 addresses. It also removes the directed broadcast address, which has been abused to amplify denial-of-service traffic. Check that both devices and your monitoring tools support it.

The allocator uses a /30 for two hosts by default, which is safe on any kind of segment. Turn on the /31 option when your two-host entries really are point-to-point links.

A VLSM design, step by step

Variable Length Subnet Masking (VLSM) gives each subnet its own prefix, so a two-address link does not consume the same space as an office floor. Suppose that a branch has 192.168.10.0/24 and needs these networks:

  1. List the needs. Servers 50, Staff 100, Management 10, WAN link 2. Count the gateway address as a host, and leave room for growth.
  2. Sort from the largest. Staff, Servers, Management, WAN.
  3. Choose the smallest block that fits each. 100 needs a /25, 50 needs a /26, 10 needs a /28 and 2 needs a /30.
  4. Place them one after another from the start of the parent block.
NetworkSubnetUsable rangeUtilization
Staff (100)192.168.10.0/25.1 to .12679.4%
Servers (50)192.168.10.128/26.129 to .19080.6%
Management (10)192.168.10.192/28.193 to .20671.4%
WAN link (2)192.168.10.208/30.209 to .210100.0%

The plan uses 212 of 256 addresses. The 44 that remain are 192.168.10.212/30, 192.168.10.216/29 and 192.168.10.224/27. Adding a 60-host lab would need another 64, which the allocator reports as an overflow along with the parent size that would fit. High utilization is efficient today but leaves little room to grow, so treat anything above about 80% as a prompt to consider the next size up.

Scopes that matter in security work

The scope field names the special-purpose range that contains the address. RFC 1918 private ranges should never appear as a source on the internet. 100.64.0.0/10 is carrier-grade NAT space, which is shared by many subscribers and is a poor choice for a block rule. Link-local 169.254.0.0/16 often means that DHCP failed, and it also contains 169.254.169.254, the cloud metadata address that server-side request forgery attacks target. A large block can cover several scopes. 172.0.0.0/8 is mostly public even though part of it is private, and the calculator warns you when that happens.

Can I use a /31 on an ordinary LAN?

No. RFC 3021 is for point-to-point links that connect exactly two devices. A /31 has no broadcast address and no room for a third device, so use a /30 or larger on a shared segment. Both ends of the link must also support /31, which most current routers and firewalls do.

Why does VLSM allocate the largest subnet first?

Every block must start at a multiple of its own size. Placing large blocks first keeps the next free address aligned for every smaller block that follows, so no gaps appear. Allocating small blocks first can leave fragments that are too small or misaligned for a large subnet, even when enough total addresses remain.