IPv4 Subnet Calculator
Calculate an IPv4 subnet, inspect every important value, and generate deployment-ready configuration.
Learn IPv4 subnetting fundamentals
Review CIDR boundaries, broadcast and usable ranges, and worked examples before applying subnet plans.
Calculate a subnet
Enter an IPv4 address with a CIDR prefix.
Subnet details
Click any dashed value to copy it.
Engineer Insights
Operational context based on this prefix and address class.
Configuration generator
Generate common Cisco IOS XE or Juniper Junos snippets.
How to use the IPv4 subnet calculator
Enter an IPv4 address with a CIDR prefix to inspect the subnet, address range, and copy-ready examples for real deployments.
Start with a network address and prefix
Use the format 192.168.50.18/27 or 10.0.0.1/24. The calculator reports the network and broadcast addresses, subnet mask, wildcard mask, and the first and last usable host.
- Use the gateway preference to choose the first or last usable address.
- Review the engineer insights for practical routing and design context.
- Copy Cisco or Juniper snippets for quick configuration work.
Related PacketToolbox resources
- VLSM Planner for splitting a larger block into smaller subnets.
- Route Summarization Calculator for collapsing multiple routes into a summary.
- Cisco ACL Builder for generating standard and extended IPv4 access lists.
- IPv6 Calculator for IPv6 prefix, range, and subnet-index calculations.
- Tools landing page for the full PacketToolbox utility set.
- Switch stacking guide for a field-oriented networking article.
What CIDR notation means
Classless Inter-Domain Routing replaced the older class-based model and lets you size subnets precisely.
CIDR is prefix-based
The slash value after the IPv4 address tells you how many bits are used for the network portion. A /24 reserves 24 bits for the network and leaves 8 bits for hosts.
Why it matters
Prefix notation makes it easier to describe subnets, route summaries, and address planning without converting between classful ranges and custom masks.
How subnet masks work
Subnet masks identify which bits belong to the network and which bits can be assigned to hosts.
Mask bits and host bits
A /27 has 5 host bits, so it supports 32 addresses total and 30 usable addresses in the traditional model. Smaller prefixes create fewer host addresses and are often used for point-to-point links.
Network address, broadcast address, and usable hosts
The first address in the subnet is the network address, the last is the broadcast address, and the addresses in between are the usable hosts. For /31 and /32, special rules apply.
Subnet mask versus wildcard mask
Wildcard masks are commonly used in routing and access-control policies.
Subnet mask
A subnet mask identifies the network portion of an address. It is used for addressing, L3 interface configuration, and host routing.
Wildcard mask
A wildcard mask is the inverse of the subnet mask for many routing and ACL operations. In a wildcard mask, 0 bits match the exact value and 1 bits act as wildcards.
Common CIDR prefix reference
Use this table as a quick reference when planning address space or validating subnet sizes.
| CIDR | Mask | Total addresses | Traditional usable hosts |
|---|---|---|---|
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 (special case) |
| /32 | 255.255.255.255 | 1 | 1 (host route) |
/31 is commonly used for point-to-point links and usually allows two addresses. /32 identifies a single host route and has no ordinary host range.
Practical subnetting examples
These examples show how prefix length changes the available address space.
Example 1: /24
192.168.10.0/24 gives you a standard 256-address block with 254 usable hosts in the traditional model.
Example 2: /27
192.168.10.0/27 gives you 32 total addresses and 30 usable hosts, which is common for small user VLANs.
Example 3: /30
192.168.10.0/30 gives you four addresses with only two usable hosts, which is a common point-to-point design.
Example 4: /31
On many modern routing platforms, /31 prefixes are used for dedicated point-to-point links and may be treated as a two-address segment.
Cisco and Juniper configuration examples
These snippets reflect the same subnetting concepts the calculator reports.
Cisco IOS XE
interface Vlan50
description USER-VLAN
ip address 192.168.50.1 255.255.255.224
no shutdown
Juniper Junos
set interfaces irb unit 50 family inet address 192.168.50.1/27
Frequently asked subnetting questions
Answers to the questions that come up most often in network design and troubleshooting.
What is the difference between a network address and a host address?
The network address identifies the subnet itself, while host addresses are the addresses you assign to devices inside that subnet.
Why do some prefixes have fewer usable hosts?
Smaller prefixes reserve more bits for network and broadcast roles, leaving fewer bits for end devices.
When should I use a /31 or /32?
/31 is commonly used for point-to-point links, while /32 is used for host routes or single-address assignments.
What is the difference between a subnet mask and a wildcard mask?
The subnet mask identifies the network portion of an address, while the wildcard mask is used in routing and ACL logic to match or ignore bits.