... LIVE
🖧 IPv4 Subnetting Tools
IPv4 address e.g. 192.168.1.50 Enter a valid IPv4 address.
Network Address
⚠️ Disclaimer: Results use standard IPv4 subnetting formulas per RFC 950. Usable hosts = total IPs minus 2 (network and broadcast reserved) except /31 and /32 per RFC 3021.
Format: 10.0.0.0/16 or 192.168.0.0/24 Enter network as IP/prefix e.g. 10.0.0.0/16 (prefix 1-30).
Subnets Created
Minimum usable host addresses needed in the subnet Enter hosts between 1 and 16,777,214.
Recommended Prefix

Sources & Methodology

All formulas verified against RFC 950 (Internet Standard Subnetting Procedure) and RFC 1918 (Private IP Ranges). Network = IP AND Mask. Broadcast = Network OR Wildcard. Usable Hosts = 2^(32 minus prefix) minus 2.
📘
RFC 950 — Internet Standard Subnetting Procedure (IETF)
Foundational IETF standard defining subnet mask usage, network address derivation using bitwise AND, and broadcast address calculation. Source for all core subnetting formulas in this calculator.
📙
RFC 1918 — Address Allocation for Private Internets (IETF)
Defines the three private IPv4 address ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). This calculator identifies RFC 1918 ranges and displays the appropriate classification for each input.
📊
RFC 4632 — Classless Inter-Domain Routing (IETF)
Defines CIDR slash notation for expressing network prefixes, replacing classful A/B/C addressing. Source for CIDR prefix-to-mask conversion and variable-length subnet calculations used throughout.

IPv4 Subnetting Guide: Formulas, Cheat Sheet & How-To

Subnetting is the single most tested topic on every Cisco certification exam and the most commonly used skill in daily network engineering. Whether you are designing a new network, troubleshooting an addressing issue, or studying for CCNA, mastering subnetting formulas is essential. This guide covers the complete IPv4 subnetting process with worked examples, a cheat sheet reference table, the magic number method for fast mental calculation, and RFC 1918 private range guidance.

Network Address = IP Address AND Subnet Mask (bitwise) Broadcast Address = Network Address OR Wildcard Mask (bitwise) Total Addresses = 2^(32 - prefix_length) Usable Hosts = Total Addresses - 2 (network + broadcast) Wildcard Mask = 255.255.255.255 - Subnet Mask
Worked example: 192.168.10.100/26
Mask = 255.255.255.192 | Wildcard = 0.0.0.63 | Block size = 64
100 falls in the .64 block (64 is the nearest multiple of 64 below 100)
Network = 192.168.10.64/26 | Broadcast = 192.168.10.127
Usable = 192.168.10.65 to 192.168.10.126 (62 hosts)

Subnetting Cheat Sheet: All Common Prefixes

Memorize these values for fast mental subnetting on CCNA exams and in the field. The block size is 256 minus the interesting octet of the subnet mask.

CIDRSubnet MaskTotal IPsUsable HostsBlock SizeUse Case
/24255.255.255.0256254256Standard LAN segment
/25255.255.255.128128126128Split /24 in half
/26255.255.255.192646264Department subnet
/27255.255.255.224323032Small office floor
/28255.255.255.240161416Small department
/30255.255.255.252424Point-to-point WAN
/22255.255.252.01,0241,0221,024EKS / large app subnet
/16255.255.0.065,53665,53465,536Large campus / VPC

RFC 1918 Private IP Ranges: Which to Use and When

Three address ranges are reserved for private networks by RFC 1918 and are not routable on the public internet. All corporate and home networks use these ranges with NAT to reach the internet. Choosing the right range avoids future conflicts with VPC peering, Direct Connect, or VPN links.

RangeCIDRAddressesBest Used For
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216Large enterprise, data centers
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576Medium business, AWS default VPC
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536Home networks, small offices

How to Subnet Manually: The Magic Number Method

The magic number method lets you subnet any network in under 2 minutes without a calculator. This is the standard technique for CCNA and CCNP exam subnetting questions.

  1. Identify the interesting octet from the prefix. Prefix /25 to /32 = last octet. /17 to /24 = third octet. /9 to /16 = second octet. /1 to /8 = first octet.
  2. Calculate block size: 256 minus the subnet mask value in the interesting octet. For /26 (mask 192): block = 256 minus 192 = 64.
  3. List subnets at multiples of the block size. For /26 from 192.168.1.0/24: .0, .64, .128, .192.
  4. Find the subnet for your IP. For .100: nearest multiple of 64 below 100 is 64. Network = 192.168.1.64/26.
  5. Broadcast = next subnet start minus 1 = 192.168.1.128 minus 1 = 192.168.1.127.
  6. Usable range: 192.168.1.65 to 192.168.1.126 (62 hosts).
💡 CCNA exam tip: Block sizes follow the pattern 128, 64, 32, 16, 8, 4, 2, 1 for prefixes /25 through /32. Memorize these 8 values to subnet any problem in seconds. The block size equals 2^(32 minus prefix) in the relevant octet. Practice with random IPs until you can do any /24 to /32 subnet in under 60 seconds.

CIDR vs Classful Addressing: Understanding IP Classes

Before CIDR was introduced in 1993, IPv4 used three fixed classes. Today all modern networking uses CIDR, but class terminology still appears in CCNA exams, legacy documentation, and RFC 1918 descriptions. Class A addresses (1.0.0.0 to 126.x.x.x, default mask /8) were assigned to very large organizations with 16.7 million hosts each. Class B addresses (128.0.0.0 to 191.255.x.x, default /16) gave 65,534 hosts per network. Class C addresses (192.0.0.0 to 223.255.255.x, default /24) gave 254 hosts each. CIDR replaced this rigid structure, enabling any prefix from /0 to /32 and preventing early IPv4 address exhaustion through efficient allocation.

Frequently Asked Questions
Subnetting divides a large IP network into smaller sub-networks called subnets. Each subnet has its own network address, broadcast address, and usable host range. Subnetting reduces broadcast traffic, improves security by isolating department traffic, simplifies troubleshooting, and makes IP address management more efficient in any network.
1) Identify prefix length (e.g. /24). 2) Subnet mask: /24 = 255.255.255.0. 3) Network address = IP AND subnet mask. 4) Total hosts = 2^(32 minus prefix). 5) Usable hosts = total minus 2. 6) Broadcast = network OR wildcard mask. 7) Wildcard = 255.255.255.255 minus subnet mask. Use the calculator above for instant results on any IP and CIDR prefix.
A /24 subnet has 256 total addresses and 254 usable host addresses. The first IP (network address) and last IP (broadcast address) are reserved and cannot be assigned to hosts. For 192.168.1.0/24: first usable host is 192.168.1.1, last is 192.168.1.254, broadcast is 192.168.1.255.
Both express the same network boundary in different formats. CIDR uses slash notation: /24. Subnet mask uses dotted decimal: 255.255.255.0. Convert by counting the 1-bits in the binary of the subnet mask. 255.255.255.0 in binary has 24 leading ones, so it equals /24. Both formats are used interchangeably in network configuration tools and documentation.
RFC 1918 defines three private IPv4 ranges not routable on the public internet: 10.0.0.0/8 with 16.7 million addresses for large enterprises, 172.16.0.0/12 covering 172.16.0.0 to 172.31.255.255 for medium business, and 192.168.0.0/16 with 65,536 addresses for home and small office. All three require NAT to access the internet from these addresses.
Dividing a /24 into /26 subnets gives 4 subnets (26 minus 24 equals 2 borrowed bits; 2^2 equals 4). Each /26 has 64 total addresses and 62 usable hosts. Block size is 64. The four subnets of 192.168.1.0/24 are: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26, and 192.168.1.192/26.
VLSM (Variable Length Subnet Masking) allows subnets of different sizes within the same network. Unlike fixed-length subnetting where all subnets are equal, VLSM allocates exactly the right size for each requirement. A WAN link needs /30 (2 hosts), a server room needs /27 (30 hosts), and a large department needs /22 (1,022 hosts), minimizing IP address waste throughout the network.
A wildcard mask is the bitwise inverse of a subnet mask, used in Cisco ACLs, OSPF network statements, and EIGRP. A 0-bit means must match exactly, a 1-bit means ignore. Calculated as 255.255.255.255 minus the subnet mask. For /24 (mask 255.255.255.0), wildcard equals 0.0.0.255. ACL example: permit 192.168.1.0 0.0.0.255 matches all addresses in the 192.168.1.x range.
Use the magic number method: block size equals 256 minus the interesting octet of the subnet mask. For /26 (mask 192): block equals 64. Subnets start at 0, 64, 128, 192. For any IP, find the nearest multiple of 64 below the host octet to get the network address. Add block minus 1 for broadcast. Practice until you can subnet any prefix in under 90 seconds without a calculator.
/30 is the traditional standard for router-to-router WAN links (4 addresses, 2 usable hosts, one per router). RFC 3021 allows /31 for point-to-point links, using only 2 addresses both as usable host addresses with no broadcast address, saving 2 IPs per link. Modern Cisco IOS supports /31 natively for P2P interfaces, and it is increasingly used in carrier networks.
Route summarization combines multiple contiguous subnets into a single route advertisement, reducing routing table size and router CPU load. Four /26 subnets (192.168.1.0, .64, .128, .192) can be summarized as one /24 route. Summarization requires contiguous subnets starting on a boundary that aligns with the summary prefix. Improper summarization can cause routing black holes if subnets are not all reachable.
Number of subnets equals 2^(new prefix minus original prefix). To divide a /16 into /24 subnets: 24 minus 16 equals 8 borrowed bits. 2^8 equals 256 subnets each with 254 usable hosts. For 10 required subnets: 2^3 equals 8 (too few), 2^4 equals 16 (sufficient). Borrow 4 bits, giving 16 subnets. Use the Divide Network mode above for instant subnet lists.
Classful routing protocols (RIPv1, IGRP) do not include subnet mask information in routing updates, requiring all subnets of a major network to use the same mask. Classless routing protocols (OSPF, EIGRP, RIPv2, BGP) include the subnet mask with each route advertisement, enabling VLSM and CIDR. All modern networks use classless routing exclusively.
Related Networking Calculators
🧮

Missing a Networking Calculator?

Can’t find the tool you need? Tell us — we build new ones every week.