IPv4 Subnet Mask Calculator
Enter an IPv4 address and either a CIDR prefix or subnet mask. If both are filled, the subnet mask will be used.
What is a mask calculator IP tool?
A mask calculator IP tool helps you quickly determine network details from an IPv4 address and subnet definition. Instead of calculating by hand, it instantly provides the network address, broadcast address, host range, wildcard mask, and host capacity. This is useful for network engineers, students, IT administrators, and anyone working with routers, firewalls, VLANs, or cloud networking.
In modern networks, subnetting is everywhere. Whether you are splitting one large block into smaller departments or validating ACL rules, getting mask math right prevents outages and configuration mistakes.
How to use this subnet mask calculator
- Enter an IPv4 address (for example: 10.20.30.40).
- Enter a CIDR prefix like /24 or provide a subnet mask like 255.255.255.0.
- Click Calculate.
- Review the output: network, broadcast, first host, last host, usable hosts, and binary mask.
Tip: if your organization still documents networks in dotted-decimal masks while your cloud platform uses CIDR, this calculator bridges both styles instantly.
Subnet mask fundamentals
CIDR notation vs dotted-decimal mask
CIDR notation expresses how many leading bits are set to 1 in the subnet mask. For example:
- /8 = 255.0.0.0
- /16 = 255.255.0.0
- /24 = 255.255.255.0
- /27 = 255.255.255.224
The larger the prefix, the smaller the subnet and the fewer hosts available.
What the calculator derives
- Network Address: the subnet ID (all host bits set to 0).
- Broadcast Address: the last address in the subnet (all host bits set to 1).
- First / Last Host: usable address range for devices.
- Total Addresses: all addresses in the subnet block.
- Usable Hosts: typically total minus network and broadcast (except /31 and /32 behavior).
- Wildcard Mask: inverse of subnet mask, often used in ACL definitions.
Practical examples
Example 1: Small office LAN
Address: 192.168.10.77, Prefix: /24
This yields a network of 192.168.10.0 and broadcast 192.168.10.255, with host range
192.168.10.1 - 192.168.10.254. This is the classic 254-host private subnet.
Example 2: Department segmentation
Address: 10.1.5.130, Prefix: /27
A /27 creates 32-address blocks. The matching subnet is 10.1.5.128/27, broadcast is
10.1.5.159, and there are 30 standard usable hosts.
Example 3: WAN point-to-point link
Address: 172.16.40.2, Prefix: /31
This subnet has only two addresses and is commonly used on router-to-router links to conserve address space.
Common mistakes this calculator helps prevent
- Using a non-contiguous mask like 255.0.255.0 (invalid for subnetting).
- Assigning the network or broadcast address to a host.
- Mismatching ACL wildcard masks with subnet masks.
- Assuming all prefixes reserve two addresses even for /31 and /32 use cases.
- Mixing private and public ranges without route planning.
Why subnet calculation still matters
Even with SDN, cloud templates, and automation, engineers still troubleshoot packets at Layer 3. Wrong masks break reachability, NAT rules, VPN tunnels, and security policy scopes. A fast IP mask calculator keeps your planning accurate and your changes safe.
Use this tool when designing VLANs, validating static routes, preparing firewall objects, or reviewing incident logs. Correct subnetting is one of those basic skills that prevents surprisingly expensive mistakes.