Subnet Mask Calculator

Compute network ID, broadcast address, usable host range, wildcard mask, binary breakdown for IPv4, and IPv6 network prefix, address range, total addresses. Supports CIDR notation for both protocols.

Standard dotted decimal (0.0.0.0 – 255.255.255.255)
Prefix length (1-32) or mask like 255.255.255.0
 
? Class C /24: 192.168.1.45/24
? Class B /16: 172.16.10.1/16
? Class A /8: 10.0.5.20/8
⚡ VLSM /27: 192.168.1.100/27
? Point-to-Point /30: 10.10.10.1/30
? /31 (RFC 3021): 192.168.1.0/31
Privacy assured: All subnet calculations are performed locally in your browser — no data is transmitted.
Standard IPv6 notation (compressed allowed, e.g., 2001:db8::1)
1-128, with or without leading slash
? Unique Local /48: fd00::/48
? Global Unicast /32: 2001:db8::/32
? Standard /64: 2001:db8:1234::/64
? Link-Local /64: fe80::1/64
?️ Host route /128: 2001:db8::1/128
Privacy assured: All IPv6 calculations are performed locally in your browser.

Master IPv4 & IPv6 Subnetting – Complete Guide

In modern networking, subnetting divides a single IP network into smaller logical subnetworks. For IPv4, a subnet mask defines the network portion; for IPv6, the prefix length (CIDR) serves the same purpose. This calculator delivers instant network IDs, address ranges, and critical details for both protocols.

IPv4: Network Address = IP & Mask, Broadcast = Network | ~Mask, Usable hosts = 2(32 - prefix) - 2 (except /31, /32)
IPv6: Network Prefix = IP & (Mask128), Address Range = [Network, Network + (2(128-prefix) - 1)]

Why Network Engineers Rely on Subnet Calculators

  • Efficient IP Planning: Avoid overlapping subnets and wasted address space.
  • Security Boundaries: Subnets improve segmentation and reduce broadcast domains.
  • Certification Prep: CCNA, CompTIA Network+, and JNCIA heavily test subnetting.
  • Cloud & Datacenter: VPC design requires precise CIDR blocks (AWS, Azure, GCP) for IPv4 and IPv6.

Step-by-Step Calculation Logic

IPv4: Given an IPv4 address and mask, the tool performs bitwise AND for network ID, sets host bits to 1 for broadcast, and derives usable range.
IPv6: The IPv6 address is converted to a 128-bit integer, masked with the prefix length to obtain the network prefix, then the last address is computed by adding (2(128-prefix) - 1). All calculations are done using native BigInt for exactness.

Practical Examples from Real Networks

Enterprise IPv6 Deployment

An organization receives 2001:db8:abcd::/48. They need /64 subnets for each department. Using our IPv6 calculator, they quickly determine that 2(64-48) = 65536 subnets are available, and each /64 contains 264 addresses — more than enough for any LAN.

AWS VPC CIDR Planning

When designing a VPC with CIDR 172.31.0.0/16, subnets require /24 ranges. Using this tool, engineers can compute the number of available subnets (256) and precise host counts per subnet — critical for auto-scaling groups.

Common Subnetting Mistakes & Expert Tips

  • Mistake: Forgetting to subtract 2 for network/broadcast in IPv4 (except /31). Tip: Always verify usable host range.
  • Mistake: Overlapping subnets cause routing failures. Use VLSM to optimize space.
  • Mistake: Misconfiguring ACL wildcard masks. Our tool provides the exact wildcard mask needed for Cisco-style access lists.
  • Expert note: For IPv6, always use /64 for end-user subnets to ensure SLAAC and other features work. Avoid subnets larger than /64 unless you have a specific reason.

Frequently Asked Questions

CIDR uses a suffix like /24 to indicate the number of leading 1 bits in the mask, while a subnet mask uses dotted decimal (e.g., 255.255.255.0). Both represent the same network boundary.

The first address (network ID) identifies the subnet itself; the last address (broadcast) is used to send traffic to all hosts in the subnet. They cannot be assigned to individual devices.

RFC 3021 allows /31 subnets for point-to-point links (e.g., router-router). It provides two usable addresses without wasting IPs on network/broadcast.

/64 is the standard for most networks because it enables SLAAC (Stateless Address Autoconfiguration) and is required for many IPv6 features.

All operations use 32-bit unsigned integers for IPv4 and 128-bit BigInt for IPv6, ensuring results are identical to industry‑standard network calculators. Verified against Cisco and RFC specifications.

Authoritative networking reference – This tool is built on foundational RFCs (RFC 950, RFC 1812, RFC 3021, RFC 4291 for IPv6) and validated with real-world routing tables. Content reviewed by getzenquery Tech team. Last updated March 2026.