Subnet calculator & designer
Break down any IPv4 CIDR, then split it into subnets. Instant · in your browser
The gateway isn't fixed by the subnet — it's whichever address your router uses. By convention it's the first usable host (e.g. .1); some networks use the last usable instead.
Split into subnets
Divide this network into equal-size subnets by choosing a longer prefix.
How to use the subnet calculator
- Enter an IPv4 address in CIDR form — 10.0.0.0/16 or 192.168.1.42/24; a bare address is treated as /24. Type the prefix as a number — dotted masks like 255.255.255.0 aren't accepted as input, though the results show the dotted form.
- Read the full breakdown, updated as you type: network address, usable host range, broadcast, subnet mask, wildcard mask (the inverse, used in Cisco ACLs), total and usable addresses.
- Check the class (A–E) and scope rows — the tool flags RFC 1918 private ranges, loopback, link-local (APIPA) and public space automatically.
- The gateway row shows the two conventions — first usable or last usable — because the subnet itself doesn't fix a gateway; your router does.
- To design subnets, pick a longer prefix under Split into subnets: choosing /20 inside a /16 yields 16 equal blocks, each listed with its range and broadcast.
Common uses
- Plan a cloud network: carve a VPC's 10.0.0.0/16 into /20s per availability zone, then /24s per service, and copy the exact ranges into your IaC templates.
- Answer “are these two hosts on the same subnet?” — check whether both addresses fall inside one network's usable range.
- Configure a static IP for a printer, camera or NAS: look up the correct mask, broadcast and conventional gateway for its network.
- Write firewall rules and ACLs: read the wildcard mask straight from the results instead of inverting the subnet mask in your head.
- Study for CCNA or a networking exam — verify your by-hand subnetting answers, including the /31 and /32 edge cases.
Tips & limitations
- A /31 has two usable hosts and no broadcast — the point-to-point convention (RFC 3021) for router-to-router links; a /32 is a single host. For both, gateway and broadcast show as “—”.
- Cloud providers reserve more than the classic 2 addresses: AWS, for instance, takes 5 per subnet. Expect slightly fewer usable IPs in a VPC than the calculator's standard math shows.
- The splitter produces equal-size subnets only. For a mixed (VLSM) plan, split the block, then paste an individual subnet back in and split it further at a different prefix.
- Large splits are capped at the first 256 rows for browser performance — the header still tells you the true total (a /16 into /28s is 4,096 subnets).
- IPv4 only: IPv6 uses different planning (no broadcast, /64 conventions) and isn't supported here.
How it's built & why it's safe
All the subnet math runs as 32-bit bitwise operations in plain JavaScript, right in your browser — masks are shifts, the network is ip & mask, the broadcast is network | ~mask. That's why every result updates on each keystroke with no server round-trip, it works offline once loaded, and nothing you type is sent anywhere. Class and scope come from the standard first-octet ranges and the RFC 1918/loopback/link-local tables.
Related tools: Number Base Converter · Password Generator · Regex Tester
Frequently asked questions
What does the /24 in CIDR notation mean?
It's the prefix length: how many leading bits of the address are the network part. /24 means a 255.255.255.0 mask and 256 addresses; each added bit (/25, /26…) halves the block, each removed bit doubles it.
Why does a /24 have only 254 usable hosts?
The all-zeros address is the network identifier and the all-ones address is the broadcast, so 2 of the 256 are reserved. The exceptions are /31 (both addresses usable, for point-to-point links) and /32 (one host), which the calculator handles correctly.
What's my gateway IP?
The subnet doesn't define one — the gateway is whatever address your router actually holds. Convention puts it at the first usable address (like .1), some networks use the last instead; the tool shows both candidates.
What is the wildcard mask for?
It's the bitwise inverse of the subnet mask — 0.0.0.255 for a /24 — and it's how Cisco ACLs and OSPF configuration match address ranges. Reading it from the results avoids inverting octets by hand.
Is 172.20.5.1 a private address?
Yes — RFC 1918 reserves 10.0.0.0/8, 172.16.0.0 through 172.31.255.255, and 192.168.0.0/16 for private networks. The scope row labels these automatically, along with loopback (127.x) and link-local 169.254.x addresses.
Does it support IPv6?
No, this calculator is IPv4-only. IPv6 subnetting follows different rules — 128-bit addresses, no broadcast, and a strong /64-per-LAN convention.