Subnet calculator — quick reference
Here is a worked example using 192.168.1.0/24 — the most common home and small-office subnet:
| Field | Value |
|---|---|
| Network address | 192.168.1.0 |
| Subnet mask | 255.255.255.0 |
| CIDR notation | /24 |
| Wildcard mask | 0.0.0.255 |
| Broadcast address | 192.168.1.255 |
| First usable host | 192.168.1.1 |
| Last usable host | 192.168.1.254 |
| Total addresses | 256 |
| Usable hosts | 254 |
The network address (192.168.1.0) and broadcast address (192.168.1.255) are reserved — you cannot assign them to a device. That leaves 254 usable IP addresses for hosts.
How to use this subnet calculator
- Enter your IP address — type any IPv4 address, e.g.,
10.0.0.1or172.16.5.0. - Enter the prefix or mask — use CIDR notation (
/24) or a dotted subnet mask (255.255.255.0). Both formats are accepted. - Read the results — the calculator instantly shows network address, broadcast, first/last usable host, wildcard mask, total addresses, and usable hosts.
- Check the binary view — the binary visualization shows exactly which bits are network bits (fixed) and which are host bits (variable), making CIDR notation concrete.
- Note the IP class — the subnet calculator automatically identifies whether the address is private (RFC 1918), loopback, CGNAT, link-local, or public.
CIDR notation explained
CIDR (Classless Inter-Domain Routing) writes a network as address/prefix. The prefix is the count of leading 1-bits in the subnet mask, which determines how many bits identify the network versus the host.
- /8 — 8 network bits, 24 host bits. Mask:
255.0.0.0. Hosts: 16,777,214. Used for large ISP and corporate blocks (e.g.,10.0.0.0/8). - /16 — 16 network bits, 16 host bits. Mask:
255.255.0.0. Hosts: 65,534. Common for mid-size corporate networks (e.g.,172.16.0.0/16). - /24 — 24 network bits, 8 host bits. Mask:
255.255.255.0. Hosts: 254. The default home and small-office subnet (e.g.,192.168.1.0/24). - /28 — 28 network bits, 4 host bits. Mask:
255.255.255.240. Hosts: 14. Common for cloud VPC subnets and small service tiers. - /30 — 30 network bits, 2 host bits. Mask:
255.255.255.252. Hosts: 2. Used for point-to-point router links. - /32 — all network bits. Identifies a single host. Used in routing tables and firewall rules.
The formula for usable hosts is 2h − 2, where h is the number of host bits. The −2 excludes the network address and broadcast address.
Common subnet masks — cheat sheet
| CIDR | Subnet mask | Wildcard mask | Usable hosts | Common use |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | Single host / route |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | P2P link (RFC 3021) |
| /30 | 255.255.255.252 | 0.0.0.3 | 2 | Router-to-router link |
| /29 | 255.255.255.248 | 0.0.0.7 | 6 | Micro-segment |
| /28 | 255.255.255.240 | 0.0.0.15 | 14 | Cloud VPC subnet |
| /27 | 255.255.255.224 | 0.0.0.31 | 30 | Small department |
| /26 | 255.255.255.192 | 0.0.0.63 | 62 | Medium VLAN |
| /25 | 255.255.255.128 | 0.0.0.127 | 126 | Half a /24 |
| /24 | 255.255.255.0 | 0.0.0.255 | 254 | Home / small office |
| /23 | 255.255.254.0 | 0.0.1.255 | 510 | Medium network |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,022 | Campus segment |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,094 | Large building |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,534 | Enterprise / class B |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,214 | ISP / class A |
| /0 | 0.0.0.0 | 255.255.255.255 | all | Default route |
Private IP ranges (RFC 1918)
These ranges are not routed on the public internet. They can be reused freely inside any private network:
- 10.0.0.0/8 — 16.7 million addresses. Used by large corporate networks, Docker's default bridge network (
172.17.0.0/16is a sub-range of the 172.16.0.0/12 block). - 172.16.0.0/12 — covers 172.16.0.0 to 172.31.255.255. About 1 million addresses. Kubernetes and Docker default ranges live here.
- 192.168.0.0/16 — 65,536 addresses. Most home routers assign
192.168.1.0/24or192.168.0.0/24.
Other reserved ranges: 100.64.0.0/10 (CGNAT — RFC 6598), 169.254.0.0/16 (link-local / APIPA), 127.0.0.0/8 (loopback — localhost).
Network, broadcast, and usable host range
- Network address — all host bits are 0. Identifies the subnet. Cannot be assigned to a host. For 192.168.1.0/24 this is 192.168.1.0.
- Broadcast address — all host bits are 1. Delivers packets to all hosts on the subnet. Cannot be assigned. For 192.168.1.0/24 this is 192.168.1.255.
- Usable host range — every address between network and broadcast. For /24: 192.168.1.1 to 192.168.1.254 (254 hosts).
Exception: /31 (RFC 3021) has no network or broadcast address — both addresses are usable for point-to-point links. /32 is a host route identifying exactly one address.
Wildcard mask
A wildcard mask is the bitwise inverse of the subnet mask. Cisco ACLs, OSPF area statements, and some firewall rules use wildcard masks rather than subnet masks. For /24 (mask 255.255.255.0), the wildcard is 0.0.0.255. A 0-bit means "must match exactly"; a 1-bit means "any value is accepted."
FAQ
What is a subnet calculator used for?
A subnet calculator takes an IP address and subnet mask (or CIDR prefix) and calculates the network boundaries: network address, broadcast address, first and last usable hosts, and total host count. Network engineers use it when planning IP address allocation, creating VLANs, configuring firewalls, or provisioning cloud subnets.
What is the difference between a subnet mask and CIDR notation?
They represent the same information in different formats. 255.255.255.0 (dotted decimal) and /24 (CIDR) both mean 24 network bits. CIDR notation is more compact; dotted-decimal masks are required by older network equipment and some config files.
How many usable hosts does a /24 subnet have?
A /24 subnet has 256 total addresses (28). Two are reserved — the network address (x.x.x.0) and the broadcast address (x.x.x.255). That leaves 254 usable hosts.
What is the difference between a /24 and a /16 subnet?
A /24 has 8 host bits → 254 usable hosts. A /16 has 16 host bits → 65,534 usable hosts. Every time you decrease the prefix by 1, the number of hosts doubles. A /16 is 256× larger than a /24.
Does this subnet calculator support IPv6?
Not yet. IPv6 uses 128-bit addresses and the same CIDR prefix logic, but the address space is vastly larger. IPv6 support is on the roadmap.
What is a wildcard mask and when do I need it?
A wildcard mask is the inverse of the subnet mask (255.255.255.255 minus the mask). You need it when writing Cisco IOS ACL entries and OSPF network statements. For a /24, the wildcard is 0.0.0.255. This subnet calculator shows the wildcard mask alongside the subnet mask in every result.
Related tools
- UUID Generator — Generate UUID v4 and v7 identifiers in bulk.
- Regex Tester — Test regular expressions with live match highlighting and explanation.
- Timestamp Converter — Convert Unix timestamps, epoch seconds/milliseconds, and ISO 8601 dates.
- HTTP Status Codes — Full HTTP status code reference with explanations and when to use each.
Related articles
- 4 min readDHCP IP Allocation — How Dynamic IP Assignment WorksDHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses, subnet masks, gateways, and DNS servers to devices. Learn how the DORA process works, DHCP lease...
- 5 min readIPv6 Subnetting — Addresses, Prefixes, and Network PlanningIPv6 subnetting uses 128-bit addresses and /64 prefix lengths for LAN segments. Learn IPv6 address format, how to calculate subnet ranges, common prefix allocations, and the...
- 7 min readCIDR Notation Explained — What /24, /16, /8 Mean in IP AddressesCIDR notation is the slash number after an IP address — /24, /16, /8. It specifies how many bits belong to the network portion. Here's how to read CIDR, calculate address...
- 6 min readIP Address Calculator — Calculate Network and Host RangesAn IP address calculator finds the network address, broadcast address, and usable host range from an IP and subnet mask or CIDR notation. Here's how the math works and common...
- 6 min readIPv4 Subnetting Tutorial — How to Subnet a Network Step by StepSubnetting divides a network into smaller subnetworks. Learn how to subnet using CIDR notation: calculate subnets, determine usable hosts, borrow host bits, and subnet a /24...
- 5 min readPrivate IP Address Ranges — RFC 1918 and Reserved IP BlocksPrivate IP address ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are not routable on the public internet. Here's a complete guide to private, loopback, link-local, and...
Part of Dev Productivity
This subnet calculator is part of the Dev Productivity toolset on Xerobit. Other useful tools: Timestamp Converter, HTTP Status Codes, Regex Tester.
Written by Mian Ali Khalid. Last updated 2026-05-12.