Loading...

About the Subnet Calculator

Subnetting arithmetic is simple and extremely easy to get wrong under pressure, usually in the direction of an overlap that is not discovered until two networks need to talk to each other. This calculator takes an address and a prefix length and gives the network address, broadcast address, usable host range, and mask.

The habit worth forming is planning the address space before allocating any of it. Overlapping ranges between a VPC and an on-premises network, or between two VPCs that later need peering, cannot be fixed by routing — the only remedies are renumbering or address translation, and both are painful long after the fact.

Be careful with cloud subnets specifically. AWS reserves five addresses in every subnet rather than the two you subtract on traditional equipment, so a /28 offers eleven usable addresses there, not fourteen.

Frequently asked questions

How many usable hosts are in a /24?

Traditionally 254 — the 256 addresses minus the network and broadcast addresses. In AWS it is 251, because the platform also reserves the first three addresses in every subnet for the router, DNS, and future use. Sizing a cloud subnet with the textbook figure is a reliable way to run out of addresses slightly earlier than planned.

What do /31 and /32 mean in practice?

A /32 is a single address, used for host routes and loopback interfaces. A /31 is a two-address block with no network or broadcast address, defined specifically for point-to-point links where both addresses are usable — it halves the waste of the older convention of using a /30 for a link between two routers.

Which private address ranges should I use?

The three RFC 1918 ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Avoid the very common ranges for anything that might later connect to another network — 192.168.0.0/24 and 192.168.1.0/24 are the default on essentially every consumer router, so a VPN client sitting behind one collides immediately. Allocating from the middle of 10.0.0.0/8 avoids most accidental overlaps.

What is the difference between CIDR and a subnet mask?

They express the same thing. A /24 prefix and a 255.255.255.0 mask both say the first 24 bits identify the network. CIDR notation is more compact and is what routing tables, cloud APIs, and firewall rules use; dotted-decimal masks survive mainly in older interface configuration and some vendor CLIs.

How do I choose a VPC CIDR size?

Larger than you think, and non-overlapping with everything you might ever peer with. A VPC CIDR cannot be shrunk after creation and can only be extended by adding secondary blocks, so the cost of being generous is a few unused addresses in private space while the cost of being tight is renumbering. A /16 per VPC with /20 or /24 subnets per availability zone is a common, comfortable layout.

Need this managed for you, not just automated?

We're also a hands-on DevOps consultancy — Kubernetes, CI/CD, and cloud infrastructure.

Explore Our Services