Complete Guide to Subnet Calculator: Master IPv4 Subnetting
Learn how to calculate IPv4 subnets, CIDR notation, network and broadcast addresses, and host ranges. A complete subnetting tutorial for network engineers and DevOps.
Free Interactive Tool
Subnet Calculator
IPv4 subnet calculator with CIDR support β compute network address, broadcast, mask, and host range instantly, right in your browser.
Table of Contents
Subnetting is the backbone of every modern network. Every time you spin up an AWS VPC, carve out a VLAN for a new team, or size the pod CIDR for a Kubernetes cluster, you are making a subnetting decision. Get the math right and your infrastructure scales cleanly; get it wrong and you collide addresses, strand capacity, and spend hours debugging why two services can't talk to each other. IPv4 subnetting is the practice of dividing a larger address block into smaller, routable chunks defined by a network address and a subnet mask.
For network engineers and DevOps practitioners, subnet arithmetic is an everyday task. You rarely need a full IPAM suite to answer a quick question β you need to know, for a given address and CIDR, what the network address is, what the broadcast is, and how many usable hosts you have. Doing this by hand with binary conversion is slow and error-prone, and reaching for a CLI tool like ipcalc means context-switching to a terminal (and on some locked-down laptops, it isn't even installed).
That's where a browser-based Subnet Calculator comes in. It runs entirely client-side, returns the network address, broadcast address, host range, and usable host count instantly, and never sends your addresses to a server. It's the fastest way to sanity-check a subnet before you paste it into Terraform, a firewall rule, or a cloud console.
Why Use a Subnet Calculator?
Whether you're studying for a certification or running production infrastructure, a subnet calculator removes the friction from IP math:
- Speed: Instant results the moment you type an address and CIDR β no binary long-division, no waiting on a remote service.
- Accuracy: Bitwise computation eliminates the off-by-one errors that creep into manual subnetting (forgetting to subtract the network and broadcast addresses is the classic one).
- Learning aid: Pair the calculator with the CIDR table below to internalize how each prefix length maps to a mask and host count β great preparation for CCNA, AWS, and CKA exams.
- Planning VPCs and VLANs: Quickly validate that a /22 is big enough for a 1,000-node cluster, or that a /28 covers the handful of management interfaces you need.
- Avoiding IP conflicts: Confirm that two subnets don't overlap before you deploy, by computing the network and broadcast of each and checking they don't intersect.
- Privacy: Because the tool runs fully in your browser, your internal addresses never leave your machine β important when you're working with sensitive corporate ranges.
Key Features
The Subnet Calculator is built around a single, fast computation: given an IPv4 address and a CIDR prefix (0β32), produce a complete subnet breakdown.
| Output | Description |
|---|---|
| Network Address | The first address of the subnet β the identifier routers use to route to the block. |
| Broadcast Address | The last address of the subnet, used to reach every host in it. Not assignable to a device. |
| CIDR | The prefix length echoed back (e.g. /24), confirming the mask you entered. |
| First Usable Host | The lowest address you can assign to a device (network address + 1). |
| Last Usable Host | The highest assignable address (broadcast address β 1). |
| Usable Host Count | The number of addresses available for devices, computed as 2^(32 β cidr) β 2. |
Additional capabilities:
- Full CIDR range (0β32): From a /0 default route to a /32 single-host route, every valid IPv4 prefix length is supported.
- Copy to clipboard: One click copies a formatted summary of the network, broadcast, and host count into your clipboard β ready to paste into a ticket, runbook, or pull request.
- Load Example: Instantly populate the inputs with a worked example so you can see the tool in action without typing.
- Common use-case hints: Built-in guidance for the scenarios engineers hit most β /24 for a small office (~254 hosts), /16 for a medium organization (~65,534 hosts), and /30 for point-to-point links (2 hosts).
- Client-side only: No network requests, no telemetry, no data leaving the browser.
How to Use the Subnet Calculator
Using the tool takes seconds:
- Enter the IP address. Type any valid IPv4 address in dotted-decimal form (e.g. 192.168.1.0). The address you enter is treated as a host within the target subnet β the calculator normalizes it to the correct network address automatically.
- Enter the CIDR notation. Type the prefix length as a plain number from 0 to 32 (e.g. 24). This is the part after the slash in 192.168.1.0/24.
- Read the results. The Subnet Info card shows the Network Address, Broadcast Address, and CIDR. The Host Range card shows the First Usable Host, Last Usable Host, and Usable Host Count.
- Copy the output. Click the Copy button to grab a text summary for documentation or sharing with your team.
Worked Example: 10.0.5.0/23
Let's walk through a real case you might hit when planning a medium-sized subnet. Enter 10.0.5.0 as the IP and 23 as the CIDR. The calculator returns:
| Field | Value |
|---|---|
| Network Address | 10.0.4.0 |
| Broadcast Address | 10.0.5.255 |
| Netmask | 255.255.254.0 |
| First Usable Host | 10.0.4.1 |
| Last Usable Host | 10.0.5.254 |
| Usable Host Count | 510 |
Notice that even though you typed 10.0.5.0, the network address is 10.0.4.0. A /23 covers 512 total addresses (2 addresses in the third octet Γ 256 in the fourth), aligned on even boundaries β so the block runs from 10.0.4.0 through 10.0.5.255. Subtracting the network and broadcast addresses leaves 510 usable hosts. This is exactly the kind of alignment detail that's easy to get wrong on paper but trivial with a calculator.
Understanding CIDR Notation and Subnetting
CIDR (Classless Inter-Domain Routing) notation expresses a subnet as a base address followed by a prefix length, separated by a slash: address/prefix. The prefix is the number of leading bits used for the network portion; the remaining bits identify hosts within that network. For example, 192.168.1.0/24 means the first 24 bits are the network and the last 8 bits are available for hosts.
The prefix maps directly to a dotted-decimal subnet mask. Each /n turns on n leading bits in the 32-bit mask:
| CIDR | Subnet Mask | Total Addresses | Usable Hosts | Typical Use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Class A-sized block |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 | Large regional allocation |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Medium organization / VPC |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Multi-AZ subnet block |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Mid-size cluster subnet |
| /23 | 255.255.254.0 | 512 | 510 | Medium subnet |
| /24 | 255.255.255.0 | 256 | 254 | Small office / typical LAN |
| /28 | 255.255.255.240 | 16 | 14 | Small management subnet |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point link |
| /32 | 255.255.255.255 | 1 | 0 | Single host / loopback |
Network vs. Broadcast Address
Every subnet reserves two addresses:
- Network address (the first address): identifies the subnet itself and cannot be assigned to a host.
- Broadcast address (the last address): used to send a packet to every host in the subnet and also cannot be assigned.
This is why the usable host count is always 2^(32 β cidr) β 2 for any prefix from /0 through /30. The /31 prefix is a special case defined in RFC 3021 for point-to-point links (2 usable hosts, no broadcast), and /32 identifies a single host. The calculator's host count follows the standard formula and returns 0 for /32.
Practical Use Cases
AWS VPC Subnet Planning
When you create a VPC, you assign it a /16, then carve it into subnets β typically one per Availability Zone. A common pattern:
# VPC covering 10.0.0.0/16 (65,536 addresses)
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
}
# Public subnet in AZ-a: 10.0.0.0/24 (254 usable hosts)
resource "aws_subnet" "public_a" {
vpc_id = aws_vpc.main.id
cidr_block = "10.0.0.0/24"
availability_zone = "us-east-1a"
map_public_ip_on_launch = true
}
# Private app subnet in AZ-b: 10.0.4.0/22 (1,022 usable hosts)
resource "aws_subnet" "private_b" {
vpc_id = aws_vpc.main.id
cidr_block = "10.0.4.0/22"
availability_zone = "us-east-1b"
}
Before committing these blocks, run each CIDR through the calculator to confirm the network and broadcast addresses don't overlap and that the host count fits your expected workload. AWS reserves 5 addresses per subnet (network, broadcast, DNS, VPC router, future use), so plan for slightly fewer usable hosts than the calculator shows.
On-Premises VLAN Design
Segmenting traffic by VLAN still requires careful subnet sizing. A corporate network might allocate /24s per floor or department and a /28 for out-of-band management interfaces. Use the calculator to verify that each VLAN's range is correctly bounded before you push the config to your switches.
Point-to-Point /30 Links
Routing links between devices traditionally use /30 subnets, which provide exactly 2 usable hosts β one for each end of the link. The calculator confirms a 10.0.0.0/30 link spans 10.0.0.0 β 10.0.0.3 with usable hosts 10.0.0.1 and 10.0.0.2.
Kubernetes Pod CIDR Sizing
Each node in a Kubernetes cluster needs a pod CIDR β commonly a /24 per node. If you run a large cluster, multiply the per-node allocation by your node count to size the cluster-wide CIDR:
100 nodes Γ /24 each = 100 Γ 256 addresses = 25,600 addresses => A /18 (16,384 Γ 2 = ...) β verify with the calculator before deployment.
Run the resulting prefix through the calculator to double-check the total address space and the alignment of the block.
Firewall and Security Group Rules
Firewall rules often reference entire subnets (e.g. allow 10.0.4.0/23 to reach a database). The calculator tells you exactly which host range that rule covers, so you can verify no unintended addresses are exposed.
Best Practices
- Reserve addresses for infrastructure: Set aside the first few usable addresses for gateways, DNS servers, and load balancers so they're predictable and documented.
- Leave room for growth: Size subnets larger than your current need. Upgrading a /24 to a /23 after the fact can require re-IPing live services β far easier to plan ahead.
- Document every allocation: Record each subnet's CIDR, purpose, and owner in your IPAM tool or a simple spreadsheet. The calculator's copy button makes this painless.
- Use RFC 1918 private ranges: For internal networks, stick to 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 to avoid collisions with public internet space. RFC 1918 defines these blocks.
- Validate before you deploy: Run every CIDR through the calculator one last time before applying changes β catching a misaligned network address in the browser is far cheaper than debugging it in production.
Start Calculating Subnets Today
Stop doing binary long-division in your head and stop context-switching to a terminal. The Subnet Calculator gives you the network address, broadcast address, host range, and usable host count the instant you type a CIDR β all in your browser, all client-side.
Try the Subnet Calculator now β
Related Tools You Might Like:
- IP Lookup: Look up geolocation, ASN, and ownership details for any IPv4 or IPv6 address.
- MAC Address Generator: Generate random or sequential MAC addresses for virtual machines and network interfaces.
- DNS Lookup: Query A, AAAA, MX, CNAME, TXT, and other DNS records for any domain.
Happy subnetting!