IP Subnet Calculator
Calculate IPv4 subnets from CIDR notation or a dotted-decimal netmask — instantly get the network address, broadcast address, usable host range, wildcard mask, IP class, and RFC 1918 / RFC 6598 classification. Divide a network into smaller subnets and compute basic IPv6 prefix ranges (network address, address range, total count) with exact BigInt math. Everything runs locally in your browser.
IPv4 address & prefix
Subnet details
Binary representation
Divide into subnets
Splitting 192.168.1.0/24 into /26 blocks produces 4 subnets.
| # | CIDR | Broadcast | Usable range | Usable hosts |
|---|---|---|---|---|
| 1 | 192.168.1.0/26 | 192.168.1.63 | 192.168.1.1 – 192.168.1.62 | 62 |
| 2 | 192.168.1.64/26 | 192.168.1.127 | 192.168.1.65 – 192.168.1.126 | 62 |
| 3 | 192.168.1.128/26 | 192.168.1.191 | 192.168.1.129 – 192.168.1.190 | 62 |
| 4 | 192.168.1.192/26 | 192.168.1.255 | 192.168.1.193 – 192.168.1.254 | 62 |
About IP Subnet Calculator
An IP subnet calculator converts between CIDR notation (192.168.1.0/24) and its equivalent netmask (255.255.255.0), then derives every value that follows from it: the network address, broadcast address, first/last usable host, total vs. usable host counts, the wildcard mask used by Cisco ACLs, and whether the address falls in a private (RFC 1918), carrier-grade NAT (RFC 6598), loopback, link-local, multicast, or public range. It also splits a network into smaller subnets for a target prefix, and computes the basics of an IPv6 CIDR block — network address, prefix range, and total address count — using exact BigInt arithmetic.
Why use a IP Subnet Calculator?
Subnet math is unforgiving: get a prefix length wrong and you either waste hundreds of addresses or run out of room for hosts you already provisioned. Cloud VPCs, Kubernetes pod/service CIDRs, VLANs, VPN split-tunnel routes, and firewall ACLs all require exact CIDR arithmetic, and manual binary-to-decimal conversion is where off-by-one errors creep in — especially around the /31 and /32 edge cases, which don't follow the usual −2 rule. This tool computes every value at once, live as you type, and never asks you to trust a napkin calculation.
Who is it for?
Network engineers and sysadmins planning VLANs or firewall rules, cloud engineers sizing AWS/Azure/GCP VPC and subnet CIDR blocks, DevOps engineers configuring Kubernetes pod/service networks, students and certification candidates (CCNA, Network+) learning subnetting, and anyone who needs to quickly verify whether an address is private, public, or reserved.
How to use the tool
Enter an IPv4 address with CIDR notation (e.g., 192.168.1.10/24), or type the address and prefix/netmask separately — the prefix-length and dotted-decimal netmask fields stay in sync automatically
Read the network address, broadcast address, and first/last usable host, computed instantly as you type
Check total addresses vs. usable hosts — the calculator automatically applies the RFC 3021 exception for /31 and treats /32 as a single host
Copy the netmask, wildcard mask (the inverse mask used in router ACLs), or the binary breakdown of the address and mask with one click
Review the classification panel to see whether the address is private (RFC 1918), carrier-grade NAT (RFC 6598), loopback, link-local, multicast, or public
Open "Divide into subnets," choose a longer target prefix, and view the resulting list of subnets (capped at 256 rows for performance, with a note when more exist)
Switch to the IPv6 tab to enter an address and prefix (0–128) and get the network address, address range, and total address count in both compressed and expanded notation
Use the Reset button to return to the example values at any time — no data is ever sent anywhere; every calculation happens locally in your browser
Frequently Asked Questions
How do I calculate a subnet from an IPv4 address and CIDR prefix?
Enter the address and prefix together (e.g., 192.168.1.10/24), or type the address and a dotted-decimal netmask (255.255.255.0) instead — the two representations sync automatically. The calculator sets the leftmost `prefix` bits of the mask to 1 (e.g., /24 → 255.255.255.0), computes the network address as address AND netmask, and the broadcast address as network OR the inverted netmask. Every address strictly between network and broadcast is a usable host, except for the /31 and /32 special cases. Results — network, broadcast, host range, netmask, and binary breakdown — update instantly as you type, entirely in your browser.
What's the difference between CIDR and classful addressing (Class A/B/C)?
Classful addressing (pre-1993) fixed the network/host boundary to whole octets: Class A (1–126, /8, ~16.7M hosts), Class B (128–191, /16, ~65K hosts), Class C (192–223, /24, 254 hosts) — wasteful, since a company needing 300 hosts had to take an entire Class B block. CIDR (Classless Inter-Domain Routing, RFC 4632, 1993) decouples the prefix length from the address's leading bits, so any prefix from /0 to /32 is valid on any address (e.g., 192.168.1.0/26 for 62 hosts). CIDR also enables route aggregation — combining multiple classful blocks into one routing table entry. This tool always calculates using CIDR; the class shown is historical reference only.
Is this subnet calculator private, and does it send my addresses anywhere?
No. Every calculation — parsing the address, deriving the netmask, computing the network/broadcast/host range, generating subnet lists, and the IPv6 BigInt math — runs entirely in your browser via JavaScript. Nothing is uploaded, logged, or transmitted; there's no backend call involved in computing a subnet. Verify it yourself: open DevTools' Network tab while using the tool, and you'll see zero HTTP requests triggered by typing an address or dividing a subnet. This makes it safe to calculate subnets for internal, non-public ranges — RFC 1918 addresses, VPN topologies, production VLAN plans — without exposing your infrastructure layout to a third party.
What's the difference between a private (RFC 1918) address and a public one?
RFC 1918 reserves three ranges for private, non-internet-routable use: 10.0.0.0/8 (16.7M addresses), 172.16.0.0/12 (1.05M addresses), and 192.168.0.0/16 (65,536 addresses) — routers on the public internet must not forward traffic to or from these ranges. Every home/office network, most cloud VPC internal ranges, and Docker/Kubernetes pod networks use them, relying on NAT to reach the internet. A public address is any address outside these private ranges, the CGN range (100.64.0.0/10, RFC 6598 — used by carriers and some cloud NAT gateways), loopback (127.0.0.0/8), link-local (169.254.0.0/16), and multicast/reserved ranges — it's globally unique and, if routed, directly reachable from the internet. This calculator's classification panel flags all of these automatically.
Why don't /31 and /32 subnets follow the usual 'usable hosts = total − 2' rule?
The −2 rule reserves the all-zeros address as the network identifier and the all-ones address as the broadcast address, leaving total−2 as usable hosts. A /31 (2 total addresses) would leave zero usable hosts under that rule — useless for a point-to-point link. RFC 3021 (2000) fixes this: both addresses in a /31 are treated as usable host addresses, with no network or broadcast address at all, giving 2 usable hosts from 2 total. A /32 is a single address with an all-ones mask — commonly used for loopback interfaces and host routes — where the address itself is the only usable host (1 usable from 1 total). This calculator applies both exceptions automatically and flags them inline.
How do I split a network into smaller subnets for VLANs?
Enter your base network (e.g., 192.168.1.0/24), then use "Divide into subnets" with a target prefix like /26. That splits the 256-address /24 into four /26 blocks of 64 addresses each (62 usable hosts) — useful for separating VLANs, e.g., 192.168.1.0/26 for a server VLAN, .64/26 for workstations, .128/26 for VoIP, .192/26 for guest Wi-Fi. Each resulting subnet needs its own gateway (typically the first or last usable host), its own broadcast domain, and matching VLAN/DHCP scope configuration on your switch and router. The tool lists every resulting subnet with its network, broadcast, and usable range, capped at 256 rows with a note if the target prefix produces more.
What's the difference between the network address, broadcast address, and wildcard mask?
The network address (e.g., 192.168.1.0 in a /24) identifies the subnet itself and is never assigned to a host. The broadcast address (192.168.1.255) sends one packet to every host on the subnet simultaneously (DHCP discovery, ARP) — also never assigned to a host. Both are excluded from the usable-host count via the −2 rule (except /31 and /32). The wildcard mask (0.0.0.255 for a /24) is the bitwise inverse of the netmask (255.255.255.0): where the netmask has a 1, the wildcard has a 0. Cisco IOS access-control lists and OSPF network statements use wildcard masks instead of netmasks — a frequent source of off-by-one ACL errors when engineers instinctively type the netmask.
Does this tool fully support IPv6 subnetting?
It computes the essentials for an IPv6 CIDR block — network address, the first and last address in the prefix's range, and the total address count — shown in both compressed (2001:db8::/32) and expanded notation, using BigInt math for exact 128-bit precision. It does not enumerate IPv6 subnets the way the IPv4 "divide into subnets" feature does: splitting even a single /64 into /80s alone produces 65,536 subnets, and finer splits reach counts with no practical UI representation, so full IPv6 subnetting lists are impractical to enumerate. For raw binary/hex conversions outside networking context, use the [Binary Converter](/tools/binary-converter/); to resolve a hostname to an IP first, use [DNS Lookup](/tools/dns-lookup/).
Share This Tool
Found this tool helpful? Share it with others who might benefit from it!
💡 Help others discover useful tools! Sharing helps us keep these tools free and accessible to everyone.