Subnet &
CIDR Calculator

Calculate network addresses, subnet masks, broadcast addresses, host ranges and more — for IPv4 and IPv6.

IP Address & Prefix Length
/

Enter an IPv4 address with CIDR prefix (0–32) or dotted-decimal subnet mask

Invalid IP address
Quick Examples
Advertisement
AdSense slot 1
IPv4 CIDR Reference Table

🗂️ IP Subnet Cheat Sheet

Quick reference for network engineers, students and sysadmins — covering IPv4 CIDR, common formulas, private ranges and IPv6 prefixes.

IPv4 — Common Subnet Masks
CIDRSubnet MaskWildcardHostsUse Case
/8255.0.0.00.255.255.25516,777,214Class A / large ISP
/16255.255.0.00.0.255.25565,534Class B / campus
/20255.255.240.00.0.15.2554,094Large office LAN
/21255.255.248.00.0.7.2552,046Medium campus
/22255.255.252.00.0.3.2551,022Medium LAN
/23255.255.254.00.0.1.255510Medium office
/24255.255.255.00.0.0.255254★ Standard LAN / Class C
/25255.255.255.1280.0.0.127126Half a /24
/26255.255.255.1920.0.0.6362Quarter of /24
/27255.255.255.2240.0.0.3130Small office VLAN
/28255.255.255.2400.0.0.1514Very small segment
/29255.255.255.2480.0.0.76Small link / DMZ
/30255.255.255.2520.0.0.32★ Point-to-point link
/31255.255.255.2540.0.0.12*P2P (RFC 3021) no BC
/32255.255.255.2550.0.0.01Host route / loopback
* /31 networks (RFC 3021) have no network or broadcast address — both IPs are usable. Used on routed point-to-point links to save addresses.
Key Formulas
2^(32-prefix) Total IP addresses in a subnet (e.g. /24 → 2⁸ = 256)
2^(32-prefix) - 2 Usable host addresses (subtract network + broadcast)
Network = IP & Mask Bitwise AND of IP address and subnet mask
Broadcast = Net | Wild Network address OR-ed with wildcard mask
Wildcard = ~Mask Bitwise inverse of subnet mask (used in ACLs & OSPF)
2^n subnets Number of subnets when borrowing n bits from host portion
Private IP Ranges — RFC 1918
10.0.0.0/8
Class A Private
10.0.0.0 – 10.255.255.255 · 16,777,216 addresses · Large enterprises
172.16.0.0/12
Class B Private
172.16.0.0 – 172.31.255.255 · 1,048,576 addresses · Medium networks
192.168.0.0/16
Class C Private
192.168.0.0 – 192.168.255.255 · 65,536 addresses · Home & SOHO
169.254.0.0/16
Link-local / APIPA (RFC 3927)
Auto-assigned when DHCP fails · Not routable
127.0.0.0/8
Loopback (RFC 5735)
127.0.0.1 = localhost · Never routed externally
0.0.0.0/8
This network (RFC 1122)
Used as source before host has address · Not routable
IPv6 Prefix Quick Reference
PrefixRange / ExamplePurposeRFC
::1/128::1Loopback (localhost)RFC 4291
fe80::/10fe80::…Link-local (auto-config)RFC 4291
fc00::/7fd00::…Unique Local (ULA = private)RFC 4193
2000::/32001:…★ Global Unicast (public)RFC 4291
ff00::/8ff02::1MulticastRFC 4291
2001:db8::/322001:db8::1Documentation & examples onlyRFC 3849
64:ff9b::/9664:ff9b::x.x.x.xIPv4-mapped IPv6 (NAT64)RFC 6052
IPv6 Allocation Hierarchy
RIR Block
/12 – /23
Regional Internet Registry
ISP Allocation
/32
Internet Service Provider
Site Allocation
/48
Enterprise / campus site
Household
/56
Home ISP delegation
★ LAN Subnet
/64
Standard Ethernet segment
Host Route
/128
Single interface address
IPv6 never uses broadcast. Multicast replaces it. A /64 subnet contains 2⁶⁴ ≈ 18.4 quintillion addresses — assign one per LAN segment without worrying about address exhaustion.
Subnetting Rules & Tips
Host bits = 32-prefix e.g. /26 → 6 host bits → 64 addresses, 62 usable
Block size = 256 - last octet of mask e.g. /26 → 256−192 = 64 · Subnets start at: 0, 64, 128, 192
Prefix−1 = summarise 2 Decrease prefix by 1 to combine 2 subnets into one supernet
Prefix+1 = split into 2 Increase prefix by 1 to split a subnet into 2 equal halves
VLSM Tip: Variable Length Subnet Masking lets you use different subnet sizes in the same network. Assign /30 for point-to-point links, /24 for workstations, /27 for servers — saving addresses versus fixed-length subnetting.

About This Subnet Calculator

This free IP subnet calculator supports both IPv4 and IPv6 protocols. Enter any IP address in CIDR notation (e.g. 192.168.1.0/24) and instantly get the complete subnet breakdown.

What Is Subnetting?

Subnetting divides a large IP network into smaller, manageable sub-networks (subnets). It improves network performance, security and address efficiency. A subnet mask determines which portion of an IP address identifies the network versus the individual host.

CIDR Notation Explained

CIDR (Classless Inter-Domain Routing) notation expresses an IP address and its associated prefix length as a single string — for example 192.168.0.0/24. The number after the slash (the prefix length) indicates how many bits represent the network portion. A /24 gives 256 addresses (254 usable hosts); a /30 gives 4 addresses (2 usable hosts), ideal for point-to-point links.

IPv4 vs IPv6

IPv4 uses 32-bit addresses in dotted-decimal notation (e.g. 192.168.1.1), providing approximately 4.3 billion addresses. IPv6 uses 128-bit addresses in hexadecimal notation (e.g. 2001:db8::1), providing a virtually unlimited address space. IPv6 prefixes range from /0 to /128.

Private IP Ranges (RFC 1918)

RFC 1918 defines three private IPv4 address ranges reserved for internal network use: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. These addresses are not routable on the public internet.

Wildcard Masks

A wildcard mask is the bitwise inverse of the subnet mask. It is used in Cisco ACLs (Access Control Lists) and OSPF configurations to specify which bits of an address must match. For example, a subnet mask of 255.255.255.0 has a wildcard mask of 0.0.0.255.

More Tools