IPv4 CIDR • VLSM Split • IPv6 • Binary

Subnet Calculator

CIDR & Subnet Analysis

Takes CIDR notation, an address with a dotted mask, or a bare address. Whatever you enter is normalised to its network address, and the /31 and /32 host counts follow RFC 3021 rather than a blanket minus two.

10.0.0.5/22, 10.0.0.5 255.255.252.0 and 2001:db8::/48 all parse.
Optional — lists the equal subnets inside the block.

No address you type is resolved, logged or sent anywhere.
Quick Answer • How do I calculate a subnet?

The prefix length says how many of the 32 bits are network bits; the rest are host bits. A /26 leaves 6 host bits, so 26 = 64 addresses and, after the network and broadcast addresses, 62 usable hosts under a mask of 255.255.255.192. Enter a host address like 10.10.1.5/26 and the mask is applied for you: the block is 10.10.1.0/26, usable .1 to .62.

Everything a CIDR block implies, from one field. Network and broadcast addresses, subnet and wildcard masks, the usable host range, total and usable counts, the binary breakdown, special-use scope — plus splitting a block into equal subnets and IPv6 prefix arithmetic in exact integers.

1. What the prefix length actually says

An IPv4 address is 32 bits. The number after the slash says how many of those bits identify the network; the rest identify the host. That single number fixes everything else about the block, which is why /24 tells a network engineer more than 255.255.255.0 does.

A /26 keeps 26 network bits and leaves 6 host bits, so the block holds 26 = 64 addresses. Of those, the first is the network address and the last is the broadcast address, leaving 62 usable hosts. Every row below is that same arithmetic:

PrefixMaskAddressesUsable hosts
/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
/22255.255.252.01,0241,022
/16255.255.0.065,53665,534
/8255.0.0.016,777,21616,777,214

The Network in binary and Mask in binary tiles show the same thing bit by bit, which is the fastest way to see why the boundaries land where they do: 192.168.1.0/26 is 11000000.10101000.00000001.00000000 under a mask of 11111111.11111111.11111111.11000000. Everything to the right of the last mask bit is host space.

2. A host address is not a network address

Enter 10.10.1.5/26 and the answer is about 10.10.1.0/26. The mask is applied to whatever you typed, so a host address inside a block resolves to the block itself — and the console says which happened, either “the address given is the network address” or “10.10.1.5 is a host inside this block”.

That is the single most useful thing a subnet calculator does. Given an address off a running interface, it tells you the network it belongs to, the range of addresses that share its broadcast domain, and therefore whether two machines can talk without a router. 10.10.1.5 and 10.10.1.70 are both in 10.10.1.0/24 but in different /26s, and on a /26 they need a gateway to reach each other.

The input takes three forms. CIDR notation (10.0.0.5/22), an address with a dotted mask (10.0.0.5 255.255.252.0) as interface output and older documentation write it, or a bare address, which is read as a /32. The Wildcard mask tile is the mask inverted — 0.0.3.255 for a /22 — which is the form Cisco access lists and OSPF network statements want.

3. The /31 and /32 edge cases

“Total addresses minus two” breaks at the bottom of the range, and a calculator that reports “0 usable hosts” for a /31 is following the formula instead of the standards.

  • /31 — two usable addresses. RFC 3021 allows a two-address prefix on a point-to-point link, where there is no broadcast domain to reserve an address for. Both addresses are usable and there is no broadcast address at all.
  • /32 — one usable address. A single host. Loopback interfaces, host routes and BGP neighbours all use it, and again there is no broadcast address.
  • /30 — two usable addresses. The traditional point-to-point size, which spends four addresses to deliver two. It is still the safe choice on kit that does not implement RFC 3021.

Both special cases are handled here, and the broadcast tile reads “None at /31” rather than inventing one.

4. Splitting a block, and sizing one to fit

Put a longer prefix in Split into / and the block is divided into equal subnets, listed with each one's network, usable range, broadcast address and host count. A 192.168.1.0/24 split into /26s gives four:

#SubnetUsable rangeBroadcast
1192.168.1.0/26192.168.1.1 – 192.168.1.62192.168.1.63
2192.168.1.64/26192.168.1.65 – 192.168.1.126192.168.1.127
3192.168.1.128/26192.168.1.129 – 192.168.1.190192.168.1.191
4192.168.1.192/26192.168.1.193 – 192.168.1.254192.168.1.255

Each step of one bit doubles the number of subnets and halves the size of each: 2(new − old) subnets. A /24 into /28s is 16 subnets of 14 hosts; a /8 into /24s is 65,536 subnets, so the table shows the first 64 and states the true total rather than trying to render them all.

Going the other way — sizing a subnet to a host count — round up to the next power of two and add the two reserved addresses. 60 hosts need a /26 (62 usable), not a /27; 500 hosts need a /23 (510 usable). Under VLSM the subnets in a network do not all have to be the same size, which is the whole point of dropping fixed classes: give the 500-host site a /23 and the point-to-point links /30s out of the same parent block, rather than wasting a /23 on each.

Subnets have to start on their own boundary A /26 can begin at .0, .64, .128 or .192 and nowhere else. This is why the calculator normalises whatever you type to its network address first — 192.168.1.100/26 is not a subnet, it is a host in 192.168.1.64/26.

5. Private, reserved and special-use ranges

The Scope tile checks the network against the IANA special-purpose registry, so you can tell at a glance whether a block is routable on the internet:

RangeWhat it is
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16Private, RFC 1918
127.0.0.0/8Loopback, RFC 1122
169.254.0.0/16Link-local / APIPA, RFC 3927
100.64.0.0/10Carrier-grade NAT, RFC 6598
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24Documentation, RFC 5737
198.18.0.0/15Benchmarking, RFC 2544
224.0.0.0/4Multicast, RFC 5771
240.0.0.0/4Reserved for future use, RFC 1112

The Legacy class tile is there because certifications still ask. Classes A, B and C were replaced by CIDR in 1993 — a class-C address behind a /22 mask is perfectly ordinary and the letter tells you nothing about how the block is actually routed. Treat it as vocabulary, not as an input to a design.

6. IPv6 prefixes

Switch the family to IPv6 and the same questions get much larger answers. A 128-bit address will not fit in a JavaScript number, so the arithmetic uses BigInt and address counts are reported as exact integers rather than rounded floats.

2001:db8::/48 expands to 2001:0db8:0000:0000:0000:0000:0000:0000, ends at 2001:db8:0:ffff:ffff:ffff:ffff:ffff, and contains 1,208,925,819,614,629,174,706,176 addresses — which is 280, and a number nobody plans around. What matters in practice is the line below it: 65,536 × /64.

IPv6 subnetting is counted in /64s, not in hosts. A /64 is the standard LAN prefix — it is what SLAAC requires to autoconfigure addresses — so a /48 gives you 65,536 LANs and a /56 gives 256. Host counting is beside the point: every /64 holds 264 addresses, or 18,446,744,073,709,551,616, and there is no broadcast address to reserve because IPv6 uses multicast instead. Ask for a prefix longer than /64 and the calculator says so rather than pretending it is a subnettable LAN.

Nothing you enter is resolved, looked up or transmitted. No DNS query is made, no address is logged, and the arithmetic runs entirely in your browser — which matters when the block you are checking is internal addressing you would rather not type into a hosted tool.

7. Every CIDR prefix from /8 to /32

The complete CIDR-to-subnet-mask chart. Each prefix links to a page of its own with the mask in binary, a worked block address by address, how many of that size fit inside a larger prefix, and what happens when you split it:

PrefixSubnet maskWildcardHost bitsAddressesUsable hosts
/8255.0.0.00.255.255.2552416,777,21616,777,214
/9255.128.0.00.127.255.255238,388,6088,388,606
/10255.192.0.00.63.255.255224,194,3044,194,302
/11255.224.0.00.31.255.255212,097,1522,097,150
/12255.240.0.00.15.255.255201,048,5761,048,574
/13255.248.0.00.7.255.25519524,288524,286
/14255.252.0.00.3.255.25518262,144262,142
/15255.254.0.00.1.255.25517131,072131,070
/16255.255.0.00.0.255.2551665,53665,534
/17255.255.128.00.0.127.2551532,76832,766
/18255.255.192.00.0.63.2551416,38416,382
/19255.255.224.00.0.31.255138,1928,190
/20255.255.240.00.0.15.255124,0964,094
/21255.255.248.00.0.7.255112,0482,046
/22255.255.252.00.0.3.255101,0241,022
/23255.255.254.00.0.1.2559512510
/24255.255.255.00.0.0.2558256254
/25255.255.255.1280.0.0.1277128126
/26255.255.255.1920.0.0.6366462
/27255.255.255.2240.0.0.3153230
/28255.255.255.2400.0.0.1541614
/29255.255.255.2480.0.0.7386
/30255.255.255.2520.0.0.3242
/31255.255.255.2540.0.0.1122
/32255.255.255.2550.0.0.0011

Read down the Addresses column and every value is half the one above it — that is the whole of CIDR in one observation. The Usable hosts column tracks it two lower, right up to the last two rows: a /31 has two usable addresses rather than zero, and a /32 has one rather than minus one, because RFC 3021 removes the network and broadcast addresses at those lengths. Shorter prefixes than /8 are left out on purpose: they exist in routing tables as registry allocations and aggregate routes, not as networks anyone configures on an interface.

8. Subnet Calculator FAQs

How many usable hosts are in a /24?

254. A /24 holds 256 addresses (2 to the power of 8 host bits), and the first is the network address while the last is the broadcast address. The same subtraction gives 126 for a /25, 62 for a /26, 30 for a /27, 14 for a /28 and 6 for a /29.

What is the subnet mask for a /26?

255.255.255.192, with a wildcard mask of 0.0.0.63. In binary the mask is 11111111.11111111.11111111.11000000 — 26 network bits followed by 6 host bits, which is where the 64 addresses and 62 usable hosts come from.

What network does 10.10.1.5/26 belong to?

10.10.1.0/26, covering 10.10.1.0 to 10.10.1.63 with usable addresses from .1 to .62. Enter any host address with its prefix and the mask is applied for you; the console also states whether what you typed was the network address or a host inside the block.

How do I split a /24 into four subnets?

Borrow two host bits and use /26. Put 26 in the “Split into /” field and the table lists 192.168.1.0/26, .64/26, .128/26 and .192/26, each with 62 usable hosts. Every extra bit doubles the subnet count and halves the size: 2 to the power of (new prefix − old prefix).

What size subnet do I need for 500 hosts?

A /23, which gives 510 usable addresses. Round the host count up to the next power of two and allow for the network and broadcast addresses: 500 does not fit in a /24 (254), so the next size up is required. For 60 hosts you need a /26 with 62 usable, not a /27 with 30.

Why does a /31 have two usable hosts and not zero?

Because RFC 3021 permits a two-address prefix on point-to-point links, where there is no broadcast domain and so no address needs reserving. Both addresses are usable and there is no broadcast address. A /32 is a single host, used for loopbacks, host routes and BGP neighbours.

Which IP ranges are private?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 under RFC 1918. The Scope tile also flags loopback (127.0.0.0/8), link-local or APIPA (169.254.0.0/16), carrier-grade NAT (100.64.0.0/10), the documentation ranges from RFC 5737, benchmarking, multicast and reserved space.

How does IPv6 subnetting work?

In /64s rather than in hosts. A /64 is the standard LAN prefix that SLAAC requires, so a /48 gives 65,536 LANs and a /56 gives 256. Every /64 holds 18,446,744,073,709,551,616 addresses and there is no broadcast address to reserve, because IPv6 uses multicast instead.

Are the addresses I enter looked up or logged?

No. Nothing is resolved, no DNS query is made and no address leaves your browser — all the arithmetic is client-side, which is the point when you are checking internal addressing.

Where is the full CIDR to subnet mask chart?

In the last section of this page: every prefix from /8 to /32 with its mask, wildcard mask, host bits, address count and usable host count. Each row links to a page for that prefix with the mask in binary and a worked example block.