~/subnet-calculator ☀ LIGHT apps ← about me

🌐 Language

Network Engineering Tool
███████╗ ██╗ ██╗ ██████╗ ███╗ ██╗ ███████╗ ████████╗ ██╔════╝ ██║ ██║ ██╔══██╗ ████╗ ██║ ██╔════╝ ╚══██╔══╝ ███████╗ ██║ ██║ ██████╔╝ ██╔██╗ ██║ █████╗ ██║ ╚════██║ ██║ ██║ ██╔══██╗ ██║╚██╗██║ ██╔══╝ ██║ ███████║ ╚██████╔╝ ██║ ██║ ██║ ╚████║ ███████╗ ██║ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚══════╝ ╚═╝

// Subnet Calculator & Network Planner_

IPv4 & IPv6 subnet calculator, CIDR notation, wildcard masks, VLSM planner, and full cheat sheet — instant results, 100% in your browser

/

VLSM (Variable Length Subnet Masking) divides a network into subnets of different sizes. Enter a network and add subnets with their required host counts — the planner allocates the most efficient CIDR blocks automatically.

/
Subnets Required

Complete IPv4 CIDR cheat sheet — all 33 prefix lengths from /0 to /32 with subnet masks, wildcard masks, total addresses, and usable hosts.

IPv6 Subnet Calculator — enter an IPv6 address with prefix length to see the full network range, total addresses, and expanded notation.

/

Subnetting, CIDR and IP planning — every question answered

Seventy-three questions on CIDR and masks, host maths and the magic-number shortcut, VLSM design, private and reserved ranges, what AWS, Azure, GCP and Kubernetes really do to your address space, IPv6 subnetting, and the mistakes behind most “it should be reachable” tickets.

01. Using this calculator

What does this subnet calculator do?

Enter any IPv4 or IPv6 address with a CIDR prefix and it returns the network address, broadcast address, subnet mask, wildcard mask, usable host range, host count, binary breakdown and address classification — instantly, in your browser. It also plans variable-length subnets, and includes a full CIDR reference table.

Do I have to type the mask as well as the prefix?

No — either one is enough. Type 192.168.1.10/24 and the mask is derived; type the dotted mask 255.255.255.0 and the prefix is derived. The calculator accepts a host address as well as a network address and works out which network it belongs to.

What are the four tabs for?
  • Calculator — full detail for one IPv4 subnet
  • VLSM — split a block into subnets sized to real host requirements
  • Cheat sheet — every prefix from /0 to /32 with masks and host counts
  • IPv6 — expand, compress and calculate IPv6 prefixes
Can I link straight to a subnet?

Yes, and the address bar stays in sync as you type. ?ip=192.168.1.0&cidr=24 loads that subnet; the CIDR can be inline (?ip=10.0.0.0/8), you can pass ?mask=255.255.255.0 instead, open a tab with ?tab=calc|vlsm|cheat|ipv6, and link an IPv6 prefix with ?tab=ipv6&ip6=2001:db8::&prefix6=64.

Is anything sent to a server?

No. Every calculation is arithmetic done in JavaScript in your tab. Nothing is uploaded and nothing is stored, which matters when the addresses describe a customer's internal network.

Does it work offline?

Yes, once the page has loaded. There are no external libraries and no API calls, so it keeps working on a plane, in a datacentre aisle or on a locked-down jump box.

Is it free?

Free, no account, no limits, no ads. One of a set of client-side tools at jasperbernaers.com/apps.

02. CIDR, prefixes and subnet masks

What is CIDR notation?

Classless Inter-Domain Routing notation writes an address followed by the number of network bits: 192.168.1.0/24 means the first 24 bits identify the network and the remaining 8 identify hosts. It replaced classful addressing in 1993 (RFC 1519) because Class A, B and C blocks wasted enormous amounts of address space.

How do I convert a CIDR prefix to a subnet mask?

Write the prefix as that many 1 bits followed by 0s, then group into four octets. /2411111111.11111111.11111111.00000000255.255.255.0. /20255.255.240.0. The only octet values you will ever see in a mask are 0, 128, 192, 224, 240, 248, 252, 254 and 255.

How do I convert a subnet mask back to a prefix?

Count the 1 bits. 255.255.255.192 is 8+8+8+2 = /26. A quick shortcut for the last octet: 128→1, 192→2, 224→3, 240→4, 248→5, 252→6, 254→7, 255→8.

What is a wildcard mask?

The bitwise inverse of the subnet mask. For 255.255.255.0 the wildcard is 0.0.0.255. Cisco ACLs, OSPF network statements and several other IOS commands take a wildcard rather than a mask — a 0 bit means “must match”, a 1 bit means “don't care”.

Why is the mask sometimes written /24 and sometimes 255.255.255.0?

They are the same thing in different notations. Linux, cloud providers, routing protocols and modern documentation use CIDR; Windows dialogs, older Cisco interface configuration and many appliances use the dotted mask. Wildcard masks are a third form of the same information.

Can a subnet mask have non-contiguous bits?

Not in practice. A valid mask is an unbroken run of 1s followed by 0s. Something like 255.255.0.255 is a discontiguous mask — historically legal in a few implementations, rejected by essentially everything modern, and a reliable sign of a typo.

What does /31 mean?

A two-address block with no network or broadcast address, defined by RFC 3021 for point-to-point links. Both addresses are usable, which halves the waste compared with a /30. Most modern routers support it; some older gear does not, which is why /30 is still common on WAN links.

What does /32 mean?

A single address — a host route. You see it on loopback interfaces, in firewall rules that match exactly one host, in BGP advertisements of a single address, and in VPN split-tunnel configuration.

What is /0?

The whole IPv4 address space, 0.0.0.0/0 — the default route. In a firewall rule it means “any source” or “any destination”, which is why 0.0.0.0/0 on an inbound rule deserves a second look.

What is a supernet?

The opposite of subnetting: combining adjacent blocks into one shorter prefix. Four contiguous /24s aligned on a boundary become a single /22, which is how route summarisation shrinks routing tables. The blocks must be contiguous and correctly aligned — 192.168.4.0/24 through 192.168.7.0/24 summarise to 192.168.4.0/22, but starting at .5 does not.

Why can't I use any starting address for a subnet?

Because a subnet must start on a boundary that is a multiple of its own size. A /26 (64 addresses) can start at .0, .64, .128 or .192 — never at .50. If a tool tells you your network address is not what you typed, this alignment rule is why.

03. Hosts, network and broadcast addresses

How many usable hosts does a subnet have?

2^(32 − prefix) − 2 for IPv4. A /24 has 2⁸ = 256 addresses, minus the network and broadcast addresses, so 254 usable. A /26 has 62, a /28 has 14, a /30 has 2. The exception is /31, where both addresses are usable, and /32, which is a single host.

Why subtract two?

The first address in the block has all host bits set to 0 and identifies the network itself; the last has all host bits set to 1 and is the directed broadcast address. Neither can be assigned to an interface, so every subnet costs two addresses in overhead.

What is the network address?

The result of ANDing the IP address with the subnet mask — the first address in the range. 192.168.1.77/26 AND 255.255.255.192 gives 192.168.1.64. It is what appears in a routing table.

What is the broadcast address?

The last address in the subnet: the network address with every host bit set to 1. For 192.168.1.64/26 it is 192.168.1.127. Traffic sent there reaches every host on the local segment — which is also why very large subnets are a bad idea.

Which address is the gateway?

Nothing in the standard says. By convention it is the first usable address (.1 in a /24) or sometimes the last (.254). Cloud providers make their own choice — AWS and Azure both reserve the first usable address in every subnet for the router.

How many addresses does a /22 have?

1,024 total and 1,022 usable — the equivalent of four /24s. Each step down the prefix doubles the block: /23 is 512, /22 is 1,024, /21 is 2,048, /20 is 4,096, /16 is 65,536.

What is the “magic number” trick for subnetting in your head?

Subtract the interesting octet of the mask from 256. For /26 the mask octet is 192, so 256 − 192 = 64: subnets start at .0, .64, .128 and .192. For /28 the step is 16, for /27 it is 32. Find the block your host falls into and you have the network and broadcast addresses without any binary.

How do I find which subnet an address belongs to?

Round the address down to the nearest multiple of the block size. 10.1.2.200/27 has a block size of 32, and 200 ÷ 32 = 6 remainder 8, so the network is 10.1.2.192, the broadcast is 10.1.2.223, and the usable range is .193–.222. Typing the host address into the calculator does exactly this.

Are two addresses in the same subnet?

Apply the same mask to both and compare the results. 10.0.0.5/24 and 10.0.1.5/24 give networks 10.0.0.0 and 10.0.1.0 — different subnets, so they need a router between them. This is the calculation behind almost every “I can't reach it” ticket.

What is the difference between a subnet and a VLAN?

A VLAN is a layer-2 broadcast domain; a subnet is a layer-3 address range. They are usually mapped one-to-one, so people use the words interchangeably, but they are different layers — you can technically put two subnets on one VLAN (secondary addressing), and it is almost always a mistake.

04. VLSM and network design

What is VLSM?

Variable Length Subnet Masking means using different prefix lengths inside one parent block instead of splitting it into equal parts. A /24 can hold a /25 for 100 users, a /27 for 20 servers, a /28 for printers and a /30 for a WAN link — sized to what each segment actually needs.

How do I plan subnets with VLSM?

List every segment with its host count, sort largest first, then allocate from the top of the block downwards. Each subnet must start on a boundary that is a multiple of its own size, and allocating big-to-small keeps that alignment automatic. The VLSM tab does the arithmetic and shows what is left over.

Why does VLSM allocation have to start with the biggest subnet?

Because of alignment. If you place a /28 first at .0 and then need a /25, the /25 cannot start until .128, and you have stranded 112 addresses. Largest first packs the block without holes.

How much headroom should I leave in a subnet?

Size for roughly twice the current host count, then round up to the next prefix. A segment with 50 devices fits in a /26 (62 usable) but has almost no room; a /25 (126 usable) survives growth. Resizing a subnet in production means re-addressing every host on it.

Is it better to use one big subnet or several small ones?

Several. A single flat /16 puts 65,000 hosts in one broadcast domain — ARP and broadcast traffic scale badly, and any host can reach any other with nothing in between. Smaller subnets give you segmentation points for firewalls and ACLs.

How should I structure addressing across sites?

Allocate a contiguous block per site so it can be summarised into one route — for example a /20 per site, subdivided internally. Encoding meaning into the octets (site, function, VLAN) makes ACLs shorter and routing tables smaller. The design that cannot be summarised is the one you regret at 200 sites.

Should I use 10.0.0.0/8 or 192.168.0.0/16 for a company network?

Use 10.0.0.0/8 for anything that might grow, because it gives you room to encode site and function and to summarise. 192.168.0.0/16 is fine for a home or a single small office, but it is also what every consumer router uses, which guarantees VPN conflicts with home workers.

Why do overlapping ranges cause VPN problems?

If both ends of a tunnel use 192.168.1.0/24, a host cannot tell whether a destination is local or remote — the local route always wins and the traffic never enters the tunnel. Picking an unusual range from 10.0.0.0/8 for the office avoids the collision entirely; the fix afterwards is NAT, which nobody enjoys.

How big should a point-to-point link subnet be?

A /31 if your equipment supports RFC 3021, otherwise a /30. Using a /24 for a link with two routers on it wastes 252 addresses, and it happens more often than it should.

05. Private, reserved and special ranges

What are the private IPv4 ranges?

RFC 1918 reserves three blocks: 10.0.0.0/8 (16,777,216 addresses), 172.16.0.0/12 (172.16.0.0–172.31.255.255, about a million), and 192.168.0.0/16 (65,536). They are never routed on the public internet, so every organisation can use them internally.

Is 172.16.0.0/12 the same as 172.16.0.0/16?

No, and this is a classic mistake. The private block is a /12, covering 172.16 through 172.31. A /16 would only cover 172.16.x.x. Firewall rules written with the wrong prefix here silently miss most of the range.

What is 127.0.0.0/8 for?

Loopback. The whole /8 belongs to the local host, not just 127.0.0.1 — you can bind services to 127.0.0.2 or 127.1.2.3 and they never leave the machine.

What is 169.254.0.0/16?

Link-local, also called APIPA. A host assigns itself one of these when DHCP fails, so seeing a 169.254 address on a client almost always means “no DHCP server answered”. Cloud instance metadata services also live here, at 169.254.169.254.

What is 100.64.0.0/10?

Carrier-grade NAT space (RFC 6598), used by ISPs to number customer equipment when they have run out of public addresses. It is not routable on the internet and not RFC 1918 — if you see it on a home connection, you are behind CGNAT, which is why inbound port forwarding will not work.

Which ranges are reserved for documentation?

192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 (RFC 5737), plus 2001:db8::/32 for IPv6. Use these in examples, diagrams and blog posts rather than someone's real address space.

What is 224.0.0.0/4?

Multicast. Inside it, 224.0.0.0/24 is link-local control traffic — 224.0.0.5 and .6 for OSPF, 224.0.0.9 for RIPv2, 224.0.0.251 for mDNS. 240.0.0.0/4 above it is reserved and effectively unusable.

Are Class A, B and C still relevant?

Only as vocabulary. Classful addressing was replaced by CIDR in 1993, and no modern router assumes a mask from the first octet. People still say “a class C” when they mean a /24 — harmless as shorthand, misleading if you actually believe the mask is implied.

Can I use public addresses internally without owning them?

Technically yes, and it is a well-known way to create a problem for yourself: the day someone needs to reach the real owner of that block, they cannot. Squatting on 1.1.1.0/24 or on another company's space breaks exactly when you least want it to.

06. Cloud subnets and containers

How many addresses does AWS reserve in a subnet?

Five per subnet: the network address, the VPC router (.1), the DNS resolver (.2), one reserved for future use (.3), and the broadcast address. A /24 in AWS gives you 251 usable addresses, not 254 — and a /28, the smallest AWS allows, gives you 11.

What are the subnet size limits in AWS?

A VPC CIDR can be /16 to /28, and subnets follow the same range. Anything smaller than a /28 is rejected, which is why a two-instance subnet still costs 16 addresses.

How many addresses does Azure reserve?

Five as well: the network address, the default gateway (.1), two for Azure DNS (.2 and .3), and the broadcast address. Azure subnets can be /2 to /29, so a /29 leaves three usable addresses.

And Google Cloud?

GCP reserves four addresses per subnet: the network address, the default gateway, the second-to-last address, and the broadcast address. Subnet ranges are also expandable in place, which is unusual and very useful.

Why does my cloud subnet run out of addresses so fast?

Because managed services consume them invisibly. Load balancer nodes, NAT gateways, private endpoints, container ENIs and database instances all take addresses from your subnet. Kubernetes with AWS VPC CNI assigns a real VPC address to every pod, so a /24 node subnet can be exhausted by a few dozen pods.

What size subnets should I use for Kubernetes?

Depends on the CNI. With an overlay (Calico, Flannel) the pod network is separate and node subnets stay small. With AWS VPC CNI or Azure CNI, each pod takes a subnet address — plan a /22 or larger per node subnet, and check the maximum pods per instance type before sizing.

Can I resize a subnet after creating it?

In AWS and Azure, no — you create a new subnet and migrate. GCP allows expanding a subnet range in place. On-premises you can technically re-mask, but every host on the segment needs the new mask, which in practice means a maintenance window.

How do I pick VPC ranges that will not collide?

Allocate from a single well-documented plan — one /16 per region or per environment out of 10.0.0.0/8, recorded in an IPAM tool or at minimum a spreadsheet. Overlapping VPC ranges cannot be peered, and the discovery usually happens on the day two teams first need to talk to each other.

07. IPv6

How is IPv6 subnetting different?

The arithmetic is the same, the scale is not. An IPv6 address is 128 bits, so a single /64 holds 18.4 quintillion addresses. There is no broadcast address and no reason to size subnets to host counts — you allocate /64s because that is what the protocol expects.

Why is /64 the standard subnet size?

Because SLAAC — stateless address autoconfiguration — builds the last 64 bits from the interface identifier. Use anything longer than /64 on a LAN and SLAAC stops working. The rule of thumb is simple: every LAN gets a /64, however few devices are on it.

What size block should a site get?

A /48 per site is the common recommendation, which gives 65,536 /64 subnets — enough for any realistic site. Home users typically receive a /56 (256 subnets) from their ISP, and a /64 to a home is considered stingy because it prevents internal subnetting.

How do I compress an IPv6 address?

Drop leading zeros in each group and replace one run of consecutive zero groups with ::. 2001:0db8:0000:0000:0000:ff00:0042:8329 becomes 2001:db8::ff00:42:8329. The double colon may appear only once, otherwise the length is ambiguous.

What is fe80::/10?

Link-local. Every IPv6 interface has one automatically, and it is used for neighbour discovery and as the next-hop address in routing. It is never routed off the link, which is why you often need a zone index such as fe80::1%eth0.

What is the IPv6 equivalent of RFC 1918?

Unique local addresses, fc00::/7 — in practice fd00::/8 with a randomly generated 40-bit global ID. They are not routed on the internet. Unlike IPv4 private space, they are not the default choice: most IPv6 deployments use globally routable addresses with a firewall.

Is there a broadcast address in IPv6?

No. IPv6 replaced broadcast with multicast — ff02::1 reaches all nodes on the link, ff02::2 all routers. That means an IPv6 subnet loses no addresses to overhead, so a /64 really does have 2⁶⁴ usable addresses.

What does ::1 mean?

The IPv6 loopback, equivalent to 127.0.0.1. :: on its own is the unspecified address, equivalent to 0.0.0.0 — you see it when a service binds to all interfaces.

Do I still need NAT with IPv6?

No, and that is the point. Every device can have a globally routable address, with a stateful firewall providing the security that NAT was accidentally providing before. NAT66 exists but is discouraged.

08. Troubleshooting and common mistakes

Two hosts cannot reach each other on the same switch — why?

Almost always mismatched masks. 10.0.0.5/24 and 10.0.0.130/25 look adjacent but are in different subnets: the second host thinks anything below .128 is remote and sends it to a gateway that may not answer. Put both addresses into the calculator and compare the network addresses.

My host has a 169.254.x.x address.

DHCP did not answer, so the operating system self-assigned a link-local address. Check the cable and VLAN first, then whether the DHCP scope is exhausted — a full scope produces exactly this symptom on new devices while existing ones keep working.

The calculator says my network address is different from what I typed.

You typed a host address rather than a network address, or a subnet that is not aligned to its own size. 192.168.1.50/26 is a host inside the 192.168.1.0/26 network — the tool is showing you the real network boundary.

Why does my firewall rule with /24 not match?

Usually because the base address is not the network address. Many firewalls silently normalise 10.0.0.55/24 to 10.0.0.0/24, and some reject it — and if you meant only that one host, the prefix should have been /32.

Can two subnets overlap?

Not usefully. Overlapping ranges make routing ambiguous, and the longest-prefix match wins in ways that are hard to predict. If two blocks overlap in your design, one of them is wrong — the calculator's network and broadcast output makes the collision obvious.

How do I split a /24 into four subnets?

Add two bits: four /26 subnets of 64 addresses each — .0, .64, .128 and .192, with 62 usable hosts in each. To split into two, use /25; into eight, /27; into sixteen, /28.

How do I merge subnets back together?

Remove bits from the prefix, and check alignment. Two adjacent /25s become a /24 only if the first starts on a /24 boundary. 10.0.0.0/25 plus 10.0.0.128/25 merges; 10.0.0.128/25 plus 10.0.1.0/25 does not.

What is the fastest way to sanity-check a design?

Take the largest and smallest subnets in the plan and confirm both start on a valid boundary and have room for growth, then confirm the whole plan fits inside one summarisable parent block. Most addressing problems are alignment problems, and they are visible in thirty seconds.

Which browsers does the calculator work in?

Any current version of Chrome, Edge, Firefox, Safari, Brave, Opera or Vivaldi, on desktop or mobile. No frameworks, no external libraries — the page is self-contained.

Free Online Subnet Calculator — IPv4/IPv6 CIDR, VLSM & Network Planning

This free subnet calculator instantly computes all subnet details from any IPv4 or IPv6 address with CIDR prefix. Whether you're a network engineer, sysadmin, CCNA student, or cloud architect, get instant answers for subnet masks, wildcard masks, network and broadcast addresses, usable host ranges, and binary breakdowns. All calculations happen instantly in your browser — no data is sent to a server, no signup required.

Subnet Calculator Features

Common Subnet Reference — Most Searched CIDR Blocks

These are the subnets network engineers look up most often. Each row shows the subnet mask, wildcard mask, usable host count, and a typical use case:

CIDR Subnet Mask Wildcard Usable Hosts Typical Use
/8255.0.0.00.255.255.25516,777,214Class A networks (10.0.0.0/8)
/16255.255.0.00.0.255.25565,534Large campus / VPC supernets
/24255.255.255.00.0.0.255254Standard office / home LAN (192.168.1.0/24)
/25255.255.255.1280.0.0.127126Split /24 into two equal halves
/26255.255.255.1920.0.0.6362Small department / VLAN
/27255.255.255.2240.0.0.3130Server segments / DMZ
/28255.255.255.2400.0.0.1514Small server cluster / management VLAN
/29255.255.255.2480.0.0.76Small server group
/30255.255.255.2520.0.0.32Point-to-point WAN links / router interfaces
/32255.255.255.2550.0.0.01Host routes, loopback interfaces, firewall rules

RFC 1918 Private Address Ranges

These address blocks are reserved for private networks and are not routed on the public internet. Use them for internal LANs, VPCs, and VLANs:

Range Class Total Addresses Typical Use
10.0.0.0/8A16,777,216Large enterprise networks, cloud VPCs (AWS, Azure, GCP)
172.16.0.0/12B1,048,576Medium-sized networks, Docker default bridge (172.17.0.0/16)
192.168.0.0/16C65,536Home & small office networks (192.168.1.0/24 is the most common LAN)

Who Uses a Subnet Calculator?

Network engineers, system administrators, DevOps teams, cloud architects, CCNA/CCNP students, and anyone working with IP addressing and subnetting. Common use cases include:

How to Read Subnet Calculator Results

When you enter 192.168.1.100/24, the subnet calculator shows: Network Address 192.168.1.0 (the identifier for the subnet), Broadcast Address 192.168.1.255 (sends to all hosts), Subnet Mask 255.255.255.0 (used in device configuration), Wildcard Mask 0.0.0.255 (used in ACLs and routing protocols), First Usable Host 192.168.1.1, Last Usable Host 192.168.1.254, and 254 usable hosts out of 256 total addresses. The binary breakdown visually separates network bits (first 24) from host bits (last 8), making it clear which portion of the address identifies the network versus the device.