IP Subnet Calculator
Calculate subnet mask, network address, broadcast address, usable host range, wildcard mask, and more — for both IPv4 and IPv6 networks. Instant results with detailed binary breakdown.
| # | Network Address | First Host | Last Host | Broadcast |
|---|
What Is IP Subnetting? A Complete Beginner-to-Advanced Guide
IP subnetting is the process of dividing a large IP network into smaller, more manageable sub-networks called subnets. Each subnet is a logical partition of a larger network that allows network administrators to improve performance, security, and organisation of IP address space.
Every device connected to the internet or a local network — computers, smartphones, printers, routers, servers — requires a unique IP address. Without subnetting, all these devices would be on one flat, unorganised network, creating enormous security risks, performance bottlenecks, and administrative nightmares. Subnetting solves these problems by creating structured, hierarchical networks.
Why Is Subnetting Important?
Subnetting is not just a theoretical networking concept — it has major practical implications for how networks are built and managed:
- Security isolation: Separating departments (finance, HR, engineering) onto different subnets prevents lateral movement in the event of a security breach.
- Performance improvement: Broadcast traffic only reaches devices on the same subnet, dramatically reducing network congestion in large networks.
- Efficient IP address utilisation: Instead of wasting a large Class A block on a small office, you allocate exactly the right-sized subnet.
- Simplified troubleshooting: Problems can be isolated to a specific subnet rather than affecting the entire network.
- VLANs and routing: Subnets align with VLANs in enterprise networking, enabling fine-grained traffic control between segments.
- Compliance and auditing: Regulatory frameworks like PCI-DSS require cardholder data environments to be isolated on separate network segments.
Understanding IP Address Structure
Before diving into subnetting, you need a solid understanding of how IP addresses are structured. IPv4 and IPv6 are the two versions in active use today, and they work very differently.
IPv4 Address Structure
An IPv4 address is a 32-bit number, typically written in dotted decimal notation — four groups of decimal numbers (called octets) separated by dots. Each octet represents 8 bits and can range from 0 to 255.
The 32-bit address is split into two parts by the subnet mask:
- Network portion (prefix): Identifies which network the device belongs to. All devices on the same subnet share the same network portion.
- Host portion: Identifies the specific device within that network. This must be unique for each device on the subnet.
IP Address: 192.168.10.50
Subnet Mask (/24): 255.255.255.0
Network Address: 192.168.10.0 (first 24 bits)
Host Part: .50 (last 8 bits — the device identifier)
Broadcast: 192.168.10.255 (all host bits set to 1)
Usable Range: 192.168.10.1 – 192.168.10.254 (254 hosts)
The Subnet Mask Explained
The subnet mask is a 32-bit number that uses a contiguous sequence of 1s to indicate the network portion, followed by 0s for the host portion. It is written either in dotted decimal (255.255.255.0) or CIDR notation (/24).
| CIDR | Subnet Mask | Binary Pattern | Usable Hosts | Class |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 11111111.00000000.00000000.00000000 | 16,777,214 | A |
| /16 | 255.255.0.0 | 11111111.11111111.00000000.00000000 | 65,534 | B |
| /24 | 255.255.255.0 | 11111111.11111111.11111111.00000000 | 254 | C |
| /25 | 255.255.255.128 | 11111111.11111111.11111111.10000000 | 126 | C sub |
| /26 | 255.255.255.192 | 11111111.11111111.11111111.11000000 | 62 | C sub |
| /27 | 255.255.255.224 | 11111111.11111111.11111111.11100000 | 30 | C sub |
| /28 | 255.255.255.240 | 11111111.11111111.11111111.11110000 | 14 | C sub |
| /29 | 255.255.255.248 | 11111111.11111111.11111111.11111000 | 6 | C sub |
| /30 | 255.255.255.252 | 11111111.11111111.11111111.11111100 | 2 | Point-to-point |
Key Addresses in Every Subnet
Every subnet has three special addresses that are reserved and cannot be assigned to hosts:
- Network Address (first): All host bits are 0. Identifies the subnet itself. Example: 192.168.1.0 in a /24.
- Broadcast Address (last): All host bits are 1. Packets sent here reach every device on the subnet. Example: 192.168.1.255 in a /24.
- Default Gateway: Not technically reserved by the protocol, but conventionally the first usable host (e.g., 192.168.1.1) is assigned to the router interface.
CIDR vs. Classful Networking
To fully understand modern subnetting, you need to know the historical context — specifically the transition from classful networking to CIDR (Classless Inter-Domain Routing).
Classful Networking (Pre-1993)
Originally, the Internet Engineering Task Force (IETF) defined IP address allocation based on rigid, predefined classes. The class of an address determined the network size, with no flexibility:
| Class | First Octet Range | Default Mask | Networks | Hosts per Network | Use Case |
|---|---|---|---|---|---|
| Class A | 1 – 126 | 255.0.0.0 (/8) | 126 | 16,777,214 | Large ISPs, governments |
| Class B | 128 – 191 | 255.255.0.0 (/16) | 16,382 | 65,534 | Universities, large companies |
| Class C | 192 – 223 | 255.255.255.0 (/24) | 2,097,150 | 254 | Small businesses, offices |
| Class D | 224 – 239 | N/A | — | — | Multicast groups |
| Class E | 240 – 255 | N/A | — | — | Experimental / Reserved |
CIDR — Classless Inter-Domain Routing (Post-1993)
CIDR, introduced in RFC 1519 in 1993, replaced the rigid class system with flexible prefix-based allocation. Using CIDR, any number of bits can be designated as the network prefix, expressed with slash notation (e.g., /22, /27).
Start with 192.168.1.0/24. Borrow 2 bits from the host portion to create 4 subnets (/26):
Subnet 1: 192.168.1.0/26 → hosts .1–.62, broadcast .63
Subnet 2: 192.168.1.64/26 → hosts .65–.126, broadcast .127
Subnet 3: 192.168.1.128/26 → hosts .129–.190, broadcast .191
Subnet 4: 192.168.1.192/26 → hosts .193–.254, broadcast .255
Each subnet has 62 usable host addresses.
Private vs. Public IP Addresses
Not all IP addresses route across the public Internet. RFC 1918 defines three ranges of private IP addresses reserved exclusively for internal/local network use. These addresses are not routable on the Internet — they are translated to public IPs through Network Address Translation (NAT) at the router boundary.
| Range | CIDR Block | Addresses Available | Common Use |
|---|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,216 | Large enterprises, data centres |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | 1,048,576 | Medium organisations |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,536 | Home networks, small offices |
Special-Purpose IPv4 Addresses
| Address Range | Purpose |
|---|---|
| 127.0.0.0/8 | Loopback (localhost) — testing local networking stack |
| 169.254.0.0/16 | Link-local (APIPA) — auto-assigned when DHCP fails |
| 0.0.0.0/8 | This network — used in routing tables |
| 255.255.255.255 | Limited broadcast — reaches all hosts on local subnet |
| 224.0.0.0/4 | Multicast — Class D addresses |
| 100.64.0.0/10 | Shared address space (RFC 6598) — ISP NAT environments |
IPv6 — The Next Generation of IP Addressing
IPv6 (Internet Protocol version 6) was developed to address the imminent exhaustion of IPv4 addresses. While IPv4 provides approximately 4.3 billion unique addresses, IPv6 provides an almost incomprehensible 340 undecillion (3.4 × 10³⁸) addresses — enough to assign a unique address to every atom on the surface of the Earth, multiple times over.
IPv6 Address Format
An IPv6 address is a 128-bit number written as eight groups of four hexadecimal digits, separated by colons:
IPv6 Address Types
| Type | Prefix | Description |
|---|---|---|
| Global Unicast | 2000::/3 | Publicly routable — equivalent to public IPv4 |
| Link-Local | fe80::/10 | Auto-configured, not routable beyond local segment |
| Unique Local | fc00::/7 | Private addresses — equivalent to RFC 1918 |
| Loopback | ::1/128 | Equivalent to IPv4 127.0.0.1 |
| Multicast | ff00::/8 | One-to-many delivery |
| Unspecified | ::/128 | Equivalent to IPv4 0.0.0.0 |
IPv6 Prefix Hierarchy
IPv6 uses a structured prefix allocation hierarchy designed for aggregation and efficiency:
- /32 — Allocated to Internet Service Providers (ISPs)
- /48 — Allocated to individual sites or customers
- /56 — Allocated to home users by some ISPs
- /64 — Standard subnet size (recommended for all end-user subnets)
- /128 — Single host address (loopback, anycast)
How to Subnet: Step-by-Step Method
Subnetting can be done mathematically or using a calculator like this one. Understanding the manual process gives you deeper insight into how networks work and prepares you for networking certifications (CCNA, Network+, etc.).
Step 1 — Identify Your Requirements
Before subnetting, determine: How many subnets do you need? How many hosts per subnet? Start with the larger requirement.
Step 2 — Choose Your Starting Block
You need an IP block large enough to accommodate all your subnets and hosts. Use the formula: Total addresses needed = number of subnets × hosts per subnet (rounded up to nearest power of 2).
Step 3 — Determine the CIDR Prefix
Step 4 — Calculate Key Addresses
Network: 172.16.0.0
Mask /20: 255.255.240.0 → binary: 11111111.11111111.11110000.00000000
Wildcard: 0.0.15.255
Broadcast: 172.16.15.255 (network OR wildcard)
First host: 172.16.0.1
Last host: 172.16.15.254
Total hosts: 2^12 = 4,096 → usable: 4,094
Variable Length Subnet Masking (VLSM)
VLSM allows you to use different subnet sizes within the same network, assigning exactly the right number of addresses to each segment. This is essential for efficient addressing in complex enterprise networks.
Department A (100 hosts needed): 192.168.10.0/25 → 126 usable hosts
Department B (50 hosts needed): 192.168.10.128/26 → 62 usable hosts
Department C (25 hosts needed): 192.168.10.192/27 → 30 usable hosts
WAN Link (2 hosts needed): 192.168.10.224/30 → 2 usable hosts
Total used: 250 of 254 available — 98% efficiency
Complete IPv4 Subnet Reference Table
This comprehensive reference table covers all 32 possible IPv4 prefix lengths, their corresponding subnet masks, usable host counts, and the number of subnets they create from a /8, /16, or /24 base block.
| CIDR | Subnet Mask | Wildcard | Total IPs | Usable Hosts | Class |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | A |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 | A |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 | A |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 | A |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 | A |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 | A |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 | A |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 | A |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | B |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | B |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | B |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | B |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | B |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | B |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | B |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | B |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | C |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | C |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | C |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | C |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | C |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | C |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | Point-to-Point |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 0* | P2P (RFC 3021) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 0* | Host Route |
* /31 and /32 are special cases. /31 allows 2 usable hosts for point-to-point links per RFC 3021. /32 is used for host routes in routing tables.
Frequently Asked Questions — IP Subnet Calculator
Answers to the most commonly asked questions about IP addressing, subnetting, CIDR, and network design.
192.168.1.0/24 means a /24 network prefix (255.255.255.0 mask). CIDR replaced the rigid class system (A/B/C) in 1993 and enables far more flexible and efficient IP address allocation. It also enables route aggregation, which reduces global routing table sizes.network statements.Related Calculators & Tools
