IT
OmnvertImage • Document • Network

Subnet Calculator

Server-sideProcessed server-side

This tool uses a server-side service for processing; uploaded files or requests are not kept for long-term storage.

About

Paste an IPv4 or IPv6 address with a CIDR prefix (e.g. 192.168.1.10/24 or 2001:db8::1/64) and get back the network address, broadcast, first and last usable host, netmask and total address count. IPv6 skips broadcast — the protocol simply doesn’t have one — and shows the size of the range instead.

The arithmetic behind every answer is the same. The prefix length says how many leading bits are fixed by the network; whatever is left belongs to hosts. A /24 fixes 24 bits and leaves 8, so the block holds 2^(32−24) = 256 addresses, of which 254 are usable: the first address identifies the network and the last is the broadcast. From there the table is easy to memorise — /25 is 128 addresses and 126 hosts, /26 is 64/62, /27 is 32/30, /28 is 16/14, /29 is 8/6, /30 is 4/2. The part people forget is that splitting costs you addresses. Carve a /24 into four /26s and you drop from 254 usable hosts to 248, because each new subnet reserves its own network and broadcast pair.

/31 is the documented exception to the minus-two rule. RFC 3021 allows both addresses of a /31 to be used as hosts on a point-to-point link, since there is nobody else on the wire that a broadcast could reach. Every mainstream router vendor has supported it for years, and on a network with a few hundred WAN links it halves the address waste compared with the traditional /30. /32 isn’t really a subnet at all — it’s a single host route, the form you see on loopback interfaces, in BGP advertisements for anycast VIPs, and in firewall rules that name exactly one machine.

The practical cases where you actually reach for this: sizing a VPC or VLAN before clicking create in a cloud console; expanding a vendor-supplied CIDR allowlist into a readable range so you can confirm it covers the IPs you expect; sanity-checking a firewall rule where someone wrote /26 and you need to know whether that is 32, 64 or 128 addresses; splitting a /24 for a branch-office plan.

Variable Length Subnet Masking is why the calculator gets opened more than once per project. Instead of chopping a /16 into equal pieces, you size each subnet to what it actually needs — a /22 for a user VLAN with 900 devices, a /26 for servers, a /29 for the DMZ, /31s for the transit links. The constraint is alignment: a subnet has to start on its own natural boundary, so a /26 begins at .0, .64, .128 or .192 and nowhere else. Type an address that isn’t the network address and the calculator shows you which network it actually falls into, which is the fastest way to catch a misaligned plan before it reaches a router.

A few reserved blocks are worth recognising on sight. RFC 1918 gives you 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private use — and the 172.16 one is regularly misread, because /12 covers 172.16.0.0 through 172.31.255.255, not just the 172.16 range. Beyond that: 100.64.0.0/10 is CGNAT space handed out by ISPs that have run out of public IPv4; 169.254.0.0/16 is link-local, and seeing it on a host almost always means DHCP failed; 127.0.0.0/8 is loopback; 224.0.0.0/4 is multicast.

IPv6 changes the habits more than the maths. There is no broadcast, its role having been taken over by multicast groups, and subnets are effectively always /64 because stateless autoconfiguration (SLAAC) expects 64 bits of interface identifier. A site typically receives a /48, which contains 65,536 /64s, so you plan by allocating subnet IDs in the 16 bits between /48 and /64 rather than by counting hosts — a single /64 already holds about 18 quintillion addresses and will never fill. Prefixes longer than /64 are legal and sometimes used on point-to-point links and loopbacks, but they break SLAAC, so use them deliberately or not at all.

What this calculator will not do is check whether a range is already in use, talk to your router, or tell you that a plan is routable. It is arithmetic on the numbers you type — no packets, no scanning, no external lookup — which is exactly why you can paste a production range or an internal RFC 1918 block without worrying about it being logged or probed. If the question is who owns a public range rather than how it divides, that’s an ASN or WHOIS lookup instead.

How it works

  1. 1Open Subnet Calculator and choose your file or enter the required input.
  2. 2Check the settings and start the process.
  3. 3The tool creates the result with temporary server-side processing.
  4. 4Download the output or copy the result when it is ready.

FAQ

Which formats are supported?
IPv4 and IPv6 with a CIDR prefix, for example 10.0.0.5/16 or 2001:db8::/48. The address doesn’t have to be the network address — if you paste a host address, the network it belongs to is derived for you.
What about broadcast?
Shown for IPv4 only. IPv6 has no broadcast address; its functions are handled by multicast, so for IPv6 the first and last addresses of the range are shown instead.
How do I get the usable host count?
For IPv4 it is the total minus two: one address for the network, one for the broadcast. So /29 gives 6 usable hosts, /28 gives 14, /24 gives 254. The exception is /31, where both addresses are usable on point-to-point links.
Why does /31 allow both addresses?
RFC 3021 defines /31 for point-to-point links, where there is no need for a broadcast address because only two devices share the segment. Both addresses become hosts, which halves address consumption on WAN and transit links compared with /30.
Why is CIDR required?
The prefix length is what defines the subnet boundary. Without it there is no way to know whether 192.168.1.10 sits in a /24, a /28 or a /16, so the network and broadcast addresses can’t be derived.
Why did my router reject 192.168.1.100/26?
Subnets must start on their natural boundary. A /26 can only begin at .0, .64, .128 or .192, so .100 is inside the .64/26 block rather than the start of one. The calculator shows you the network the address actually belongs to.
Does 172.16.0.0/12 include 172.20.0.0?
Yes. The /12 spans 172.16.0.0 to 172.31.255.255, which covers the whole 172.16–172.31 second octet range. Assuming it only covers 172.16.x.x is one of the most common private-addressing mistakes.
What is 100.64.0.0/10 doing on my WAN interface?
That is shared CGNAT space. Your ISP has placed you behind carrier-grade NAT rather than giving you a public IPv4 address, which is why inbound port forwarding does nothing on that connection.
Why are IPv6 subnets always /64?
SLAAC address autoconfiguration is defined around a 64-bit interface identifier, so anything longer than /64 stops hosts from configuring themselves. Even though a /64 is far larger than any LAN needs, keeping to it avoids a class of problems that are painful to debug.
How many subnets fit in my allocation?
Subtract the prefix lengths and raise two to that power. A /24 split into /27s gives 2^(27−24) = 8 subnets; a /48 split into /64s gives 2^16 = 65,536 subnets.
Is any data stored?
No. The calculation happens per request and nothing is written or logged. There is no lookup against an external service, so an internal range you paste stays internal.

Guides & tutorials