Subnet Calculator — IPv4 & IPv6 Network Address, Host Range & CIDR
By sadiqbd · June 6, 2026
Subnetting is where most networking knowledge goes to die
IPv4 addresses, CIDR notation, subnet masks, network and broadcast addresses, usable host ranges — subnetting sits at the intersection of binary arithmetic and network architecture, and it trips up even experienced practitioners when done by hand. A subnet calculator takes the inputs and instantly returns every value you need: network address, broadcast address, host range, number of usable hosts, and wildcard mask.
IPv4 Addressing Basics
An IPv4 address is 32 bits, written as four decimal octets separated by dots: 192.168.1.100
Each octet ranges from 0–255 (8 bits). The 32-bit address is divided into:
- Network portion — identifies the network
- Host portion — identifies the specific device on that network
The subnet mask determines where this division falls.
Subnet masks
A subnet mask has all 1s in the network portion and all 0s in the host portion:
| Subnet Mask | CIDR | Network Bits | Host Bits | Usable Hosts |
|---|---|---|---|---|
| 255.255.255.0 | /24 | 24 | 8 | 254 |
| 255.255.255.128 | /25 | 25 | 7 | 126 |
| 255.255.255.192 | /26 | 26 | 6 | 62 |
| 255.255.255.224 | /27 | 27 | 5 | 30 |
| 255.255.255.240 | /28 | 28 | 4 | 14 |
| 255.255.0.0 | /16 | 16 | 16 | 65,534 |
| 255.0.0.0 | /8 | 8 | 24 | 16,777,214 |
Usable hosts = 2^(host bits) − 2 (subtract network and broadcast addresses)
CIDR Notation
CIDR (Classless Inter-Domain Routing) notation appends the network prefix length after the address:
192.168.1.0/24 — a /24 network (24 bits for network, 8 bits for hosts)
10.0.0.0/8 — a /8 network (8 bits for network, 24 bits for hosts)
172.16.0.0/12 — a /12 network (12 bits for network, 20 bits for hosts)
CIDR replaced the older classful addressing (Class A/B/C) and allows arbitrary prefix lengths for more efficient address allocation.
How to Use the Subnet Calculator on sadiqbd.com
- Enter the IP address — any host IP in the subnet (e.g.
192.168.1.45) - Enter the subnet mask or CIDR prefix —
255.255.255.0or/24 - Read the results:
- Network address
- Broadcast address
- Usable host range (first to last usable IP)
- Number of usable hosts
- Wildcard mask (inverse of subnet mask — used in access control lists)
- Binary representation of the address and mask
Real-World Examples
Designing a small office network
An office needs approximately 50 IP addresses for devices. Which subnet to use?
50 devices → need at least 52 addresses (50 + network + broadcast).
2^6 = 64 total addresses → /26 subnet → 62 usable hosts ✓ 2^5 = 32 total addresses → /27 subnet → 30 usable hosts ✗ (too few)
Subnet: 192.168.1.0/26
- Network:
192.168.1.0 - Broadcast:
192.168.1.63 - Host range:
192.168.1.1–192.168.1.62 - Usable hosts: 62
A /26 provides 62 addresses — sufficient for 50 devices with 12 addresses spare for growth.
Calculating host range for a given IP and mask
IP: 10.20.30.45
Mask: 255.255.255.0 (/24)
Calculator returns:
- Network:
10.20.30.0 - Broadcast:
10.20.30.255 - First host:
10.20.30.1 - Last host:
10.20.30.254 - Usable hosts: 254
10.20.30.45 belongs to this network range and is a valid host address.
Verifying whether two IPs are on the same subnet
IP A: 172.16.5.10/22
IP B: 172.16.7.50/22
/22 means the first 22 bits are the network. Calculate both networks:
172.16.5.10/22 → network: 172.16.4.0 (round down to nearest /22 boundary)
172.16.7.50/22 → network: 172.16.4.0
Same network — both are on 172.16.4.0/22. They can communicate directly without routing.
Splitting a /24 into smaller subnets
You have 192.168.10.0/24 and need to divide it into 4 equal subnets.
4 subnets = 2² → borrow 2 bits → /24 + 2 = /26 subnets
Four /26 subnets:
192.168.10.0/26(hosts .1–.62)192.168.10.64/26(hosts .65–.126)192.168.10.128/26(hosts .129–.190)192.168.10.192/26(hosts .193–.254)
Each subnet has 62 usable host addresses. The calculator confirms each network address, broadcast address, and host range.
IPv6 Subnetting
IPv6 addresses are 128 bits, written as eight groups of four hexadecimal digits:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Leading zeros in groups can be omitted; consecutive all-zero groups can be collapsed to :::
2001:db8:85a3::8a2e:370:7334
IPv6 subnetting works on the same principles as IPv4 but with a much larger address space:
- A /64 subnet provides 2^64 ≈ 18.4 quintillion addresses — standard for a single LAN segment
- Typical ISP allocations to customers: /48 or /56 (allowing many internal /64 subnets)
The subnet calculator handles IPv6 CIDR notation and returns the same information: network prefix, host range, and address count.
Private vs. Public IP Ranges
Private IPv4 ranges (RFC 1918 — not routable on the public internet):
10.0.0.0/8— 16.7 million addresses172.16.0.0/12— 1 million addresses192.168.0.0/16— 65,536 addresses
These are used for internal networks (home, office, data centre). Routers performing NAT (Network Address Translation) map private IPs to a public IP for internet access.
Link-local (APIPA): 169.254.0.0/16 — automatically assigned when DHCP fails; indicates a DHCP problem.
Loopback: 127.0.0.0/8 — the local machine itself. 127.0.0.1 is localhost.
Tips for Working With Subnets
The network address is always the lowest address; broadcast is always the highest. Usable hosts fall between these two.
CIDR /30 is the smallest practical subnet. A /30 has 4 addresses: 2 usable hosts, 1 network, 1 broadcast. Used for point-to-point links between routers.
Document your subnet plan. In multi-site or multi-VLAN networks, keep a record of which subnets are assigned to which locations or functions. Overlapping subnets cause routing failures.
Watch for subnet overlap when connecting networks. If two offices both use 192.168.1.0/24, you can't route between them without NAT or renumbering. Different subnets must be used for different network segments connected by a router.
Frequently Asked Questions
What's the difference between subnet mask and CIDR notation?
They represent the same information differently. 255.255.255.0 is the dotted-decimal subnet mask; /24 is the CIDR prefix length (24 bits set to 1 in the mask). They're interchangeable.
What is a wildcard mask?
The wildcard mask is the bitwise inverse of the subnet mask: 255.255.255.0 inverts to 0.0.0.255. Used in Cisco ACLs and OSPF area configurations to match IP addresses.
What does "supernetting" mean? Subnetting divides a network into smaller pieces. Supernetting (aggregation) combines multiple networks into a larger one — used in routing tables to summarise multiple routes into a single, more general route.
What's the difference between /24 and /32? /24 is a standard subnet covering 256 addresses (254 usable). /32 is a single host — exactly one address. /32 routes are used in host-based routing, loopback addresses, and VPN configurations.
Is the subnet calculator free? Yes — completely free, supports both IPv4 and IPv6, no sign-up required.
Subnetting is one of those skills where a calculator eliminates tedious binary arithmetic without removing the need to understand what you're doing. The tool confirms your calculations and catches the easy-to-make boundary errors that cause real routing problems.
Try the Subnet Calculator free at sadiqbd.com — instant IPv4 and IPv6 subnet calculations for any address and prefix.