Categories
Pages
<>

Subnet Calculator

Calculate network address, broadcast, hosts from CIDR

LIVE
434
Uses
1
Select typeChoose conversion direction
2
Enter amountType the value to convert
3
Get resultsSee live conversion rates
IP ADDRESS
:
CIDR / SUBNET MASK
:

Copy the code below to embed this calculator on your website:

<iframe src="https://calculatorcafe.com/widget/subnet-calculator/" width="100%" height="500" frameborder="0" style="border:1px solid #e2e8f0;border-radius:12px"></iframe>

Free to use · Links back to CalculatorCafe

What This Subnet Calculator Does

Enter an IP address with a CIDR prefix or a dotted-decimal netmask, and this tool instantly returns the network address, broadcast address, first and last usable host, total assignable host count, wildcard mask, and binary breakdown of every octet. It works as an IP subnet calculator for quick lookups and as a CIDR notation calculator when you need to convert between slash prefixes, traditional masks, and full address ranges. Think of it as a subnetting calculator, subnet mask calculator, and CIDR range calculator rolled into one interface - type any valid block and every derived value appears without a single manual binary conversion.

How to Calculate a Subnet Mask From an IP Address

Every IPv4 address is 32 binary bits. The subnet mask splits those bits into a network portion (contiguous 1-bits from the left) and a host portion (remaining 0-bits). A /24 prefix locks the first 24 bits to the network, leaving 8 bits for hosts and producing mask 255.255.255.0. To find the network address, perform a bitwise AND between the IP and its mask. For 10.20.30.200/24 the result is 10.20.30.0; the broadcast is 10.20.30.255; usable addresses run .1 through .254, giving 254 hosts. If you need to calculate a subnet mask from an IP range instead, count how many addresses the range spans, find the next power of two that fits, and derive the prefix length from 32 minus log-base-2 of that power. The tool automates both directions so you never touch binary arithmetic yourself.

CIDR Prefixes and How Host Counts Scale

CIDR replaced the old Class A/B/C system with variable-length prefixes. Each extra prefix bit halves available hosts: /24 → 254, /25 → 126, /26 → 62, /27 → 30, /28 → 14, /29 → 6, /30 → 2 (point-to-point links). The formula is 2^(32 − prefix) − 2; those two subtracted addresses are the network identifier (all host bits zero) and directed broadcast (all host bits one). When you need to go the other direction - calculate CIDR from an IP pair - enter start and end addresses and the tool returns the minimal set of CIDR blocks covering that range, which is exactly what you need for concise ACL entries and BGP announcements.

Calculating the IP Range From a CIDR Block

Given 172.16.0.0/22, this CIDR calculator shows that the mask is 255.255.252.0, the range spans 172.16.0.0 through 172.16.3.255, and 1,022 hosts are assignable. Verifying range boundaries matters most during cloud VPC setup: AWS, Azure, and Google Cloud lock the primary block at creation time and changing it later means rebuilding the entire network. Pasting two candidate blocks into the overlap checker before peering VPCs or establishing a VPN tunnel prevents the routing collisions that cause intermittent connectivity failures nobody can diagnose without packet captures.

IPv6 Subnetting at a Different Scale

An IPv6 address is 128 bits, so the numbers are vastly larger. ISPs receive a /32, hand businesses a /48, and give residential subscribers a /56 or /64. A single /64 holds 2^64 addresses - about 18.4 quintillion - because SLAAC requires 64 host bits. The same prefix math applies (bitwise AND, host-count formula) but the output spans lines of hexadecimal instead of four short octets. This tool functions as an IPv6 subnet calculator that expands abbreviated addresses, displays the full 128-bit range, and converts between prefix lengths and hex boundaries so you can plan dual-stack allocations without juggling two separate utilities.

Wildcard Masks for ACLs and Routing Protocols

A wildcard mask is the bitwise inverse of the subnet mask. Mask 255.255.255.0 becomes wildcard 0.0.0.255. Cisco IOS, many firewall platforms, and OSPF area definitions expect wildcard notation in access-control rules. A wildcard of 0.0.0.0 targets a single host; 0.0.0.255 matches any address in a /24. Mixing up the two formats silently permits or blocks the wrong traffic, which is why the results always show mask and wildcard side by side for every prefix you query.

Variable-Length Masking for Efficient IP Allocation

Uniform /24 subnets waste address space when segments differ in size. A 200-employee floor needs a /24 (254 hosts), the server VLAN a /26 (62), the management VLAN a /28 (14), and each router-to-router link a /30 (2). VLSM lets you assign the right prefix to each segment. Allocate the largest block first, subdivide the remainder, and use this network subnet calculator to confirm that planned subnets never overlap and each one holds enough addresses for its intended device count plus reasonable growth margin.

Real-World Scenarios: Cloud, Firewalls, and BGP

For a production VPC, a /16 (65,534 addresses) gives comfortable room; slice it into /24 public, private, and isolated subnets across availability zones. Firewall rules demand specificity: allow SSH from your office's /32 rather than an entire /16. Supernetting four contiguous /24 routes into one /22 in your BGP table reduces prefix count and simplifies peering policy. Whether you call this workflow an IP address subnet calculator exercise, a CIDR block calculator task, or plain network design, the underlying operation is identical - translate a prefix into a concrete range, verify host capacity, and make sure no two allocations collide.

Frequently asked questions

Is this tool free to use?
Yes, completely free with no registration, no ads tracking, and no usage limits.
Is my data kept private?
Yes. All processing happens in your browser. No data is sent to any external server.
Does it work on mobile devices?
Yes. Fully responsive design works on phones, tablets, and desktop computers.
Can I use the results commercially?
Yes. Output is yours to use for any personal or commercial purpose without restriction.
How accurate are the results?
Uses industry-standard algorithms tested across edge cases. Verify against known values for critical applications.
How do I report a bug or suggest a feature?
Use the feedback option on the page or contact us through the site. We actively maintain and improve all tools.
USER RATINGS

Rate This Calculator

Your feedback helps us improve our tools