Subnet Calculator — IPv4 & IPv6

IPv4 & IPv6 subnetting — network address, broadcast, host range, binary view, and subnet split

IPv4 Address
Prefix Length (CIDR) — /24
/1/8/16/24/32
— or enter Subnet Mask
Results

Enter an IP address and prefix, then click Calculate.

Frequently Asked Questions

Subnetting divides a large IP network into smaller, more manageable sub-networks (subnets). It improves security (isolating network segments), reduces broadcast traffic, optimises IP address usage, and makes routing more efficient. Both IPv4 and IPv6 use subnetting via prefix lengths (CIDR notation).
CIDR (Classless Inter-Domain Routing) notation appends a slash and prefix length to an IP address, e.g. 192.168.1.0/24 (IPv4) or 2001:db8::/32 (IPv6). The prefix length specifies how many leading bits identify the network. For IPv4, it replaces the older Class A/B/C system. For IPv6, /64 is the standard prefix for a LAN segment.
IPv4: Usable hosts = 2(32-prefix) - 2. The -2 removes the network address and broadcast address. A /24 gives 254 usable hosts. A /30 gives 2 (point-to-point).

IPv6: Total addresses = 2(128-prefix). A /64 gives 264 ~18.4 quintillion addresses. IPv6 has no broadcast — it uses multicast instead. There is no subtraction for IPv6 hosts.
IPv4 uses 32-bit addresses (e.g. 192.168.1.1), supporting ~4.3 billion addresses — nearly exhausted globally. It uses dotted-decimal notation and has broadcast.

IPv6 uses 128-bit addresses (e.g. 2001:db8::1), supporting 3.4×1038 addresses — effectively unlimited. It uses colon-hexadecimal notation, supports auto-configuration (SLAAC), has no broadcast (replaced by multicast), and has built-in IPsec support.
  • Unicast — one-to-one (Global: 2000::/3, Link-local: fe80::/10, Unique-local: fc00::/7)
  • Multicast — one-to-many (ff00::/8), replaces IPv4 broadcast
  • Anycast — one-to-nearest of a group
  • Loopback — ::1/128 (equivalent to 127.0.0.1)
  • Unspecified — ::/128 (equivalent to 0.0.0.0)
RFC 1918 defines three private IPv4 ranges (not routed on the public internet):
  • 10.0.0.0/8 — 10.0.0.0 to 10.255.255.255 (~16.7M addresses)
  • 172.16.0.0/12 — 172.16.0.0 to 172.31.255.255 (~1M addresses)
  • 192.168.0.0/16 — 192.168.0.0 to 192.168.255.255 (~65K addresses)
/64 is the standard prefix length for an IPv6 LAN segment. The first 64 bits identify the network (network prefix) and the last 64 bits identify the host (interface identifier). The host portion is often auto-configured using the device's MAC address (EUI-64) or a random value (SLAAC with privacy extensions). A single /64 contains 264 ~18.4 quintillion addresses.
A wildcard mask is the bitwise inverse of the IPv4 subnet mask. Used in Cisco ACLs and OSPF — bits set to 0 must match, bits set to 1 are ignored. For 255.255.255.0 the wildcard is 0.0.0.255. IPv6 does not use wildcard masks; prefix-based matching is used instead.
RFC 1918 defines three private IPv4 ranges not routed on the public internet:
  • 10.0.0.0/8 — ~16.7 million addresses. Used by large enterprises and ISPs.
  • 172.16.0.0/12 — ~1 million addresses. Often used by Docker.
  • 192.168.0.0/16 — ~65,000 addresses. The most common home and small office range.
Additionally, 169.254.0.0/16 is the link-local (APIPA) range, and 127.0.0.0/8 is the loopback range.

About This Subnet Calculator

This free online Subnet Calculator supports both IPv4 and IPv6 subnetting. For IPv4, enter any address and drag the CIDR prefix slider (or type the subnet mask directly) to instantly calculate the network address, broadcast address, usable host range, subnet mask, wildcard mask, total hosts, IP class, and binary representation. The subnet split tool shows all sub-subnets at any larger prefix.

For IPv6, enter any address in full, compressed, or mixed notation, select a prefix length (typically /48, /56, /64), and instantly see the network prefix, full expanded/compressed forms, address type, and total addresses in the subnet.

IPv4 Subnet Reference

CIDRSubnet MaskHosts
/8255.0.0.016,777,214
/16255.255.0.065,534
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/30255.255.255.2522

IPv6 Common Prefixes

PrefixUsage
2000::/3Global unicast
fc00::/7Unique local (RFC 4193)
fe80::/10Link-local unicast
ff00::/8Multicast
::1/128Loopback
2001:db8::/32Documentation

Related Articles

In-depth guides and technical articles.

View all →
IPv4 Ran Out in 2011 — How Carrier-Grade NAT Has Kept the Internet Running Since, and What IPv6 Changes
IPv4 exhaustion at the IANA level happened in February 2011 — since then, Carrier-Grade NAT (ISPs placing thousands of customers behind a single public IP) has kept the internet running while breaking peer-to-peer connectivity, port forwarding, and IP-based geolocation accuracy. Here's the full exhaustion timeline by regional registry, why IPv6's /64 minimum subnet size is set by SLAAC autoconfiguration, and how NAT64/DNS64 enables completely IPv6-only networks while still reaching IPv4 servers.
Why a /16 Network with 65,534 Addresses Is Often the Wrong Design — Broadcast Domains, Segmentation, and VLSM
A flat /16 network means every broadcast reaches all 65,534 devices and a compromised machine can reach every other device directly. Subnetting reduces broadcast domains and enables firewall policy enforcement at subnet boundaries. Here's why broadcast domain size determines network scalability, the trust-zone segmentation model (DMZ, application, database, management, users), VLSM for right-sizing allocations, and the RFC 1918 private address ranges.
Subnetting Math: Why /24 Gives 254 Hosts, How VLSM Works, and What the Slash Actually Means
A /24 gives 254 usable hosts, not 256 — because subnetting always reserves the first address (network) and last address (broadcast). Here's the 2^n−2 formula across all prefix lengths, VLSM (Variable Length Subnet Masking) for efficiently dividing address space into different-sized subnets, why route summarization (supernetting) is the reverse operation, and what the slash number in CIDR notation actually means in binary.
IPv6 Address Types: Why One Interface Has Link-Local, ULA, and Global Addresses All at Once
A single IPv6 interface normally has 3-4 different addresses simultaneously — link-local, unique local (ULA), and one or more global unicast addresses, each with different scope and purpose. Here's what each address type does, why ULAs exist alongside global addresses unlike IPv4's NAT model, and why privacy extensions cause global addresses to rotate.
Cloud VPC Design: Public vs Private Subnets, NAT Gateways, and the Three-Tier Architecture
AWS VPCs, GCP VPCs, and Azure VNets follow the same three-tier pattern — public subnets for internet-facing resources, private subnets for application and data tiers. Here's the terminology across providers, NAT Gateway mechanics, VPC peering, and the four most common cloud network design mistakes.