Free CIDR subnet calculator for IPv4 and IPv6. Calculate network address, broadcast address, subnet mask, wildcard mask, usable hosts, and total addresses from any CIDR notation. Includes IPv6 prefix calculation, address type detection, and scope identification. Essential for network planning, IP allocation, and subnetting.
A subnet calculator is a tool that computes all subnetting details from an IP address and CIDR prefix length. This tool supports both IPv4 (like 192.168.1.0/24) and IPv6 (like 2001:db8::/48). For IPv4, get the network address, broadcast address, subnet mask, wildcard mask, first and last usable hosts, total addresses, and usable host count. For IPv6, get the expanded and compressed address forms, network prefix, first and last addresses, total addresses, address type, and scope.
Whether you're a network engineer designing enterprise architectures, a system administrator configuring servers, or a student learning subnetting, this free IP subnet calculator eliminates manual binary math and gives you accurate results instantly. Use it as a subnet mask calculator to convert between CIDR and dotted-decimal notation, or as a visual subnet calculator to plan your network layout. All calculations happen in your browser — no data is sent to any server.

CIDR (Classless Inter-Domain Routing) notation represents an IP address and its associated network prefix in the format IP/prefix. For IPv4, the prefix ranges from 0–32 (out of 32 bits). For IPv6, it ranges from 0–128 (out of 128 bits). The prefix indicates how many bits belong to the network portion — the remaining bits identify individual hosts or interface identifiers within that network.
Enter an IPv4 (e.g., 10.0.0.0/16) or IPv6 (e.g., 2001:db8::/32) address
The prefix defines which bits are network (1s) and host (0s)
IP AND prefix mask yields the network address
Network, range, usable hosts, address type — all calculated
Use this subnet mask chart for quick reference when converting between subnet mask and CIDR notation. The chart shows common prefix lengths with their corresponding subnet masks, wildcard masks, and usable host counts — an essential reference for netmask CIDR conversion.
| CIDR | Subnet Mask | Wildcard | Usable Hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,214 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,574 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,534 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,094 |
| /24 | 255.255.255.0 | 0.0.0.255 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 (P2P) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 (host) |

IPv6 uses 128-bit addresses, providing a vastly larger address space than IPv4. The IPv6 subnet calculator handles prefix lengths from /8 to /128. Here are the most common IPv6 prefix lengths used in real-world network planning and ISP allocations.
| Prefix | Typical Use | Addresses |
|---|---|---|
| /32 | ISP allocation (single organization) | 2⁹⁶ ≈ 79.2 sextillion |
| /48 | Site allocation (one customer site) | 2⁸⁰ ≈ 1.2 septillion |
| /56 | Residential assignment (multi-subnet home) | 2⁷² ≈ 4.7 sextillion |
| /64 | Single subnet (standard LAN segment) | 2⁶⁴ ≈ 18.4 quintillion |
| /112 | Point-to-point link (IPv4-like sizing) | 65,536 |
| /126 | Point-to-point link (4 addresses) | 4 |
| /127 | Point-to-point link (RFC 6164) | 2 |
| /128 | Single host (loopback, host route) | 1 |
Unlike IPv4, IPv6 does not use broadcast addresses — it uses multicast and anycast instead. The standard subnet size for LANs is /64, which provides 2⁶⁴ addresses for Stateless Address Autoconfiguration (SLAAC). Our IPv6 calculator also detects the address type (Global Unicast, Link-Local, Unique Local, Multicast, Loopback, or IPv4-Mapped).
When you enter an IP address in CIDR notation into the subnet calculator, it computes several key fields. Understanding each field is essential for proper network configuration and troubleshooting.
The first address in the subnet, identifying the network itself. Obtained by performing a bitwise AND between the IP and subnet mask. Cannot be assigned to any host.
The last address in the subnet, used to send packets to all hosts simultaneously. Calculated by setting all host bits to 1. Also cannot be assigned to hosts.
A 32-bit mask with 1s for network bits and 0s for host bits (e.g., 255.255.255.0). Used by devices to determine if a destination IP is on the same subnet or needs routing.
The bitwise inverse of the subnet mask (e.g., 0.0.0.255). Used in Cisco ACLs and OSPF configurations to match ranges of IP addresses in access control and routing rules.
The range of IP addresses that can be assigned to devices. First usable = network address + 1, last usable = broadcast address - 1. For /31 links, both addresses are usable (RFC 3021).
Total addresses = 2^(32-prefix). Usable hosts = total - 2 (minus network and broadcast). Knowing usable count ensures you don't over-allocate or under-provision subnets.
RFC 1918 defines three blocks of private IPv4 addresses that are not routable on the public internet. These are used for internal networks behind NAT (Network Address Translation). Our subnet calculator automatically detects whether the entered IP falls within a private or public range.
Subnet calculators are essential tools for anyone working with IP networks. From enterprise network architects to home lab enthusiasts, understanding subnetting is a fundamental networking skill.
Design subnetting schemes for enterprise networks, configure OSPF areas, plan VLAN-to-subnet mappings, and optimize IP address utilization across sites.
Configure firewall rules with precise CIDR ranges, segment sensitive systems into isolated subnets, and implement zero-trust network architectures.
Set up server networks, configure DHCP scopes, plan cloud VPC subnets (AWS, Azure, GCP), and troubleshoot connectivity issues between subnets.
Design VPC architectures with properly sized subnets across availability zones, plan CIDR blocks for VPC peering, and avoid IP range overlaps.
Set up home networks with separate subnets for IoT devices, media servers, and workstations. Calculate the right subnet size for each network segment.
Practice subnetting for CCNA, CompTIA Network+, and other networking certifications. Verify manual calculations and build subnetting intuition.

Proper subnetting is crucial for efficient network design. Follow these best practices to avoid common mistakes and plan your IP addressing effectively.
Explore more free network and IP tools on DNS Robot to complement your subnetting work.
A subnet calculator is a tool that takes an IP address and CIDR prefix length (like 192.168.1.0/24 for IPv4 or 2001:db8::/48 for IPv6) and calculates all subnet details. For IPv4: network address, broadcast address, subnet mask, wildcard mask, usable hosts, and IP class. For IPv6: expanded/compressed forms, network prefix, address range, address type, and scope. It helps network administrators plan IP allocation without manual binary math.
CIDR (Classless Inter-Domain Routing) notation represents an IP address and its network prefix in the format IP/prefix (e.g., 192.168.1.0/24). The number after the slash indicates how many bits of the 32-bit IPv4 address are used for the network portion. For example, /24 means the first 24 bits are the network part (subnet mask 255.255.255.0), leaving 8 bits for host addresses (256 total, 254 usable). CIDR replaced the older classful addressing system for more flexible IP allocation.
To convert a subnet mask to CIDR, count the number of consecutive 1-bits in the binary representation. For example, 255.255.255.0 in binary is 11111111.11111111.11111111.00000000 — that's 24 ones, so CIDR is /24. Common conversions: 255.0.0.0 = /8, 255.255.0.0 = /16, 255.255.255.0 = /24, 255.255.255.128 = /25, 255.255.255.192 = /26, 255.255.255.240 = /28, 255.255.255.252 = /30.
A subnet mask and wildcard mask are bitwise inverses. The subnet mask uses 1s for network bits and 0s for host bits (e.g., 255.255.255.0), while the wildcard mask flips this (e.g., 0.0.0.255). Subnet masks are used in network interface configuration and routing tables, while wildcard masks are used in Cisco ACLs and OSPF area configuration. To convert: subtract each octet from 255.
The network address is the first address in a subnet (e.g., 192.168.1.0 in a /24), identifying the network itself. The broadcast address is the last address (e.g., 192.168.1.255), used to send packets to all hosts in the subnet. Neither can be assigned to hosts. Usable addresses fall between them — for a /24, that's 192.168.1.1 through 192.168.1.254 (254 usable).
The formula is 2^(32-prefix) - 2. Common examples: /8 = 16,777,214 hosts, /16 = 65,534 hosts, /20 = 4,094 hosts, /24 = 254 hosts, /25 = 126 hosts, /26 = 62 hosts, /27 = 30 hosts, /28 = 14 hosts, /29 = 6 hosts, /30 = 2 hosts (point-to-point), /31 = 2 hosts (RFC 3021, no broadcast), /32 = 1 host (single address).
RFC 1918 defines three private ranges: 10.0.0.0/8 (16.7M addresses, Class A), 172.16.0.0/12 (1M addresses, Class B), and 192.168.0.0/16 (65K addresses, Class C). These are not routable on the public internet and require NAT to reach external hosts. Our subnet calculator automatically detects private ranges.
Subnetting divides a large IP network into smaller subnets for: (1) efficient IP allocation, (2) improved security via isolation, (3) reduced broadcast traffic, (4) simplified management, (5) regulatory compliance. For example, splitting a /24 into four /26 subnets creates four 62-host networks.
A /31 subnet (RFC 3021) provides exactly 2 IPs with no network or broadcast address — ideal for point-to-point router links, saving one address vs /30. A /32 represents a single host address and is used for loopback interfaces, host routes, firewall rules, and BGP peering.
Count hosts needed per subnet with 20-30% growth buffer, choose the smallest CIDR that fits, allocate from a larger block using powers of 2, reserve the first subnet for infrastructure, and document everything. Example: for a /24 block needing 50 users, 20 servers, 10 IoT devices — use /26 (62), /27 (30), and /28 (14) respectively.
Yes. Our subnet calculator supports both IPv4 and IPv6. Switch to the IPv6 tab to enter any IPv6 address with a prefix length (/8 to /128). The IPv6 calculator shows the expanded and compressed address forms, network prefix, first and last addresses, total addresses, address type (Global Unicast, Link-Local, Unique Local, Multicast, Loopback, IPv4-Mapped), and scope. IPv6 uses 128-bit addresses and does not have broadcast addresses — it uses multicast instead.
The standard IPv6 subnet size is /64, which provides 2^64 (approximately 18.4 quintillion) addresses. This is required for SLAAC (Stateless Address Autoconfiguration) to work correctly, as the last 64 bits are used for the interface identifier. ISPs typically allocate /48 per organization and /56 per residential customer. For point-to-point links, /127 (RFC 6164) is recommended.