IP Subnet Calculator
Calculate IP subnets, CIDR ranges, network addresses, broadcast addresses, and available hosts — nothing leaves your browser.
IP Address & Subnet Mask
Accepts CIDR (/24) or dotted decimal (255.255.255.0)
Network Details
| Network Address | 192.168.1.0 |
| Broadcast Address | 192.168.1.255 |
| First Usable Host | 192.168.1.1 |
| Last Usable Host | 192.168.1.254 |
| Total Hosts | 256 |
| Usable Hosts | 254 |
| CIDR Notation | 192.168.1.0/24 |
| Subnet Mask | 255.255.255.0 |
| Wildcard Mask | 0.0.0.255 |
| IP Class | C |
| IP Type | Private (RFC 1918) |
| IP Address | 192.168.1.0 |
Binary Representation
Network bits · Host bits
| Field | Binary (dotted-octet) |
|---|---|
| IP Address | 11000000.10101000.00000001.00000000 |
| Subnet Mask | 11111111.11111111.11111111.00000000 |
| Network Address | 11000000.10101000.00000001.00000000 |
| Broadcast | 11000000.10101000.00000001.11111111 |
Subnet Breakdown
| # | Network | First Host | Last Host | Broadcast | Usable |
|---|---|---|---|---|---|
| 1 | 192.168.1.0/25 | 192.168.1.1 | 192.168.1.126 | 192.168.1.127 | 126 |
| 2 | 192.168.1.128/25 | 192.168.1.129 | 192.168.1.254 | 192.168.1.255 | 126 |
CIDR Quick Reference
| Prefix | Subnet Mask | Total Hosts | Usable | Notes |
|---|---|---|---|---|
| /0 | 0.0.0.0 | 4295.0M | 4295.0M | All addresses (default route) |
| /8 | 255.0.0.0 | 16.8M | 16.8M | Class A block (16M+ hosts) |
| /12 | 255.240.0.0 | 1.0M | 1.0M | Private range 172.16.0.0/12 |
| /16 | 255.255.0.0 | 65.5K | 65.5K | Class B block (65K+ hosts) |
| /20 | 255.255.240.0 | 4.1K | 4.1K | Large subnet (4K+ hosts) |
| /21 | 255.255.248.0 | 2.0K | 2.0K | Medium-large subnet (2K+ hosts) |
| /22 | 255.255.252.0 | 1.0K | 1.0K | Medium subnet (1K+ hosts) |
| /23 | 255.255.254.0 | 512 | 510 | Medium subnet (512 hosts) |
What Is IP Subnetting?
Subnetting is the practice of dividing a large IP network into smaller, more manageable sub-networks (subnets). Each subnet has its own:
- Network address — identifies the subnet itself
- Broadcast address — the last address, used to reach all hosts in the subnet
- Host range — the addresses available for assignment to devices
- Subnet mask — defines which bits belong to the network vs. the host
Subnetting is fundamental to network design, firewall rules, cloud VPC configuration, and OSPF/BGP routing.
Understanding CIDR Notation
CIDR (Classless Inter-Domain Routing) notation combines an IP address with a prefix length:
192.168.1.0/24
│ └─ 24 network bits → 8 host bits → 256 addresses
└─ Network IP address
The prefix length (0–32) specifies how many of the 32 IP bits represent the network. The remaining bits identify individual hosts.
| CIDR | Subnet Mask | Total Addresses | Usable Hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /30 | 255.255.255.252 | 4 | 2 |
| /32 | 255.255.255.255 | 1 | 1 (host route) |
How to Calculate Subnet Information
Step 1: Apply the subnet mask
Perform a bitwise AND between the IP address and the subnet mask to find the network address:
IP: 192.168.1.100 → 11000000.10101000.00000001.01100100
Mask: 255.255.255.0 → 11111111.11111111.11111111.00000000
AND: 192.168.1.0 → 11000000.10101000.00000001.00000000
Step 2: Find the broadcast address
Flip all the host bits to 1 (OR with the wildcard mask):
Network: 192.168.1.0 → 11000000.10101000.00000001.00000000
Wildcard: 0.0.0.255 → 00000000.00000000.00000000.11111111
Broadcast: 192.168.1.255 → 11000000.10101000.00000001.11111111
Step 3: Count usable hosts
Total addresses = 2^(32 - prefix)
Usable hosts = Total - 2 (subtract network and broadcast addresses)
For a /24: 2⁸ = 256 total, 254 usable.
What Is a Wildcard Mask?
The wildcard mask is the bitwise complement of the subnet mask — every 0 in the mask becomes 1, and every 1 becomes 0. It marks the “don’t care” bits.
Subnet mask: 255.255.255.0 = 11111111.11111111.11111111.00000000
Wildcard mask: 0.0.0.255 = 00000000.00000000.00000000.11111111
Wildcard masks are used extensively in:
- Cisco ACLs — match traffic from a range of addresses
- OSPF — specify which interfaces participate in an area
- Route summarization — define summary routes
IPv4 Address Classes
Before CIDR, IPv4 used a classful addressing scheme:
| Class | Range | Default Mask | Typical Use |
|---|---|---|---|
| A | 1.0.0.0 – 126.255.255.255 | /8 | Large enterprises, ISPs |
| B | 128.0.0.0 – 191.255.255.255 | /16 | Medium organizations |
| C | 192.0.0.0 – 223.255.255.255 | /24 | Small networks |
| D | 224.0.0.0 – 239.255.255.255 | N/A | Multicast groups |
| E | 240.0.0.0 – 255.255.255.255 | N/A | Reserved/experimental |
CIDR superseded classful routing in 1993, allowing any prefix length — but the class system still appears in configuration tools and documentation.
Private IP Address Ranges (RFC 1918)
These ranges are reserved for private use and are not routable on the public internet:
| Range | CIDR | Notes |
|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | Large private networks |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | Medium private networks |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | Home and office networks |
Additional reserved ranges:
- 127.0.0.0/8 — Loopback (localhost)
- 169.254.0.0/16 — Link-local (APIPA auto-configuration)
- 0.0.0.0/8 — “This” network
Subnetting a Network
Subnetting divides a larger network into smaller ones by extending the prefix length. Each additional bit doubles the number of subnets and halves the host count:
Starting with 192.168.0.0/24 (254 hosts):
| Subdivision | Subnets | Hosts Each | Example |
|---|---|---|---|
| /24 (unchanged) | 1 | 254 | 192.168.0.0/24 |
| /25 | 2 | 126 | 192.168.0.0/25, 192.168.0.128/25 |
| /26 | 4 | 62 | 192.168.0.0/26, …192.168.0.192/26 |
| /27 | 8 | 30 | 192.168.0.0/27, …192.168.0.224/27 |
| /28 | 16 | 14 | 192.168.0.0/28, …192.168.0.240/28 |
| /30 | 64 | 2 | Ideal for point-to-point links |
Special Cases: /31 and /32
/31 — Point-to-point links (RFC 3021):
Normally a subnet with 2 addresses would have 0 usable hosts (both consumed by network and broadcast). RFC 3021 defines /31 for point-to-point links where both addresses are usable, eliminating wasted IPs.
/32 — Host route:
A /32 identifies a single IP address. Used for loopback interfaces, null routes (ip route 0.0.0.0/0 null0), and advertising specific host IPs in BGP.
Frequently Asked Questions
How many hosts can a /24 subnet hold?
A /24 has 2⁸ = 256 addresses. Subtracting the network address (.0) and broadcast address (.255) leaves 254 usable host addresses.
What is the difference between /24 and 255.255.255.0?
They are equivalent representations. /24 is CIDR notation indicating 24 network bits. 255.255.255.0 is the dotted-decimal form of the same mask — 24 consecutive 1s followed by 8 zeros.
How do I subnet a /22 into /24 networks? A /22 contains 4 times as many addresses as a /24 (because 24 - 22 = 2, and 2² = 4). Enter your /22 network address in the calculator, then use the Subnet Breakdown section to select /24, which will list all four /24 subnets within it.
What does the binary view tell me? The binary representation shows each octet as 8 bits. The colored network bits (left, determined by the prefix length) must match between a device’s IP and the network address for the device to be in that subnet. The host bits (right) can be anything within the valid host range.
Is my data private? Yes. All subnet calculations happen entirely in your browser using JavaScript. No IP addresses or network configurations are ever sent to any server, stored, or logged.