NETWORK
IPv4 Subnet Calculator
Calculate CIDR networks, masks, address ranges, and usable hosts.
LOCAL NETWORK MATH
Calculate an IPv4 network
Paste CIDR notation into the address field or enter a prefix or dotted-decimal mask separately.
| Input address | |
|---|---|
| Address type | |
| Subnet mask | |
| Wildcard mask | |
| Network address | |
| Broadcast address | |
| First usable address | |
| Last usable address |
Show 32-bit binary values
- Address
- Mask
- Network
Subnet calculations run in your browser and no address is contacted or uploaded.
IPv4 subnet calculator guide
Calculate an IPv4 network from an address and CIDR prefix or dotted-decimal subnet mask. The tool shows the network, broadcast, usable host range, subnet mask, wildcard mask, address counts, and binary values.
Use it when planning a LAN, checking firewall rules, reviewing cloud network ranges, or learning how CIDR boundaries work. The calculation runs entirely in your browser and does not contact the address you enter.
How to use the IPv4 subnet calculator
Enter an IPv4 address such as 192.168.1.42, then enter /24 or 255.255.255.0 as the mask. You can also paste 192.168.1.42/24 into the address field. The calculator normalises the result to the network address, so that example belongs to 192.168.1.0/24.
The input address can be any address inside the network. It does not need to be the network address already.
Worked example: 192.168.1.42/24
A /24 prefix keeps 24 bits for the network and leaves 8 host bits. That gives 2^8, or 256, total addresses. The network address is 192.168.1.0 and the broadcast address is 192.168.1.255.
For an ordinary IPv4 subnet, the usable host range is 192.168.1.1 through 192.168.1.254, giving 254 usable addresses after the network and broadcast addresses are excluded.
CIDR prefixes and subnet masks
CIDR writes the number of leading network bits after a slash. For example, /8 corresponds to 255.0.0.0, /16 to 255.255.0.0, and /24 to 255.255.255.0. A valid dotted-decimal mask has one uninterrupted run of 1 bits followed by 0 bits.
The wildcard mask is the bitwise inverse of the subnet mask. Network equipment and access-control rules sometimes use it to identify which address bits may vary.
Understanding /31 and /32 results
The usual usable-host formula subtracts two addresses, but /31 and /32 are special cases. On an RFC 3021 point-to-point link, both addresses in a /31 can identify endpoints and no directed broadcast address is used.
A /32 contains one address and is commonly used as a host route. Whether a device or service accepts /31 or /32 depends on that system, so check the target platform rather than applying the ordinary host formula blindly.
Practical checks before using a subnet
- Confirm that the proposed range does not overlap another LAN, VPN, cloud VPC, container, or tunnel network.
- Reserve addresses needed by gateways, DHCP, DNS, load balancers, or infrastructure conventions.
- Check routes, firewall rules, DHCP pools, and provider-specific reserved addresses separately.
- Use private IPv4 ranges for internal addressing unless you have been assigned public address space.
Frequently asked questions
What does /24 mean?
A /24 prefix uses 24 network bits and leaves 8 host bits. Its subnet mask is 255.255.255.0 and it contains 256 total IPv4 addresses.
How many usable hosts are in a subnet?
For prefixes /0 through /30, usable hosts are usually 2^(32 − prefix) minus the network and broadcast addresses. /31 point-to-point links and /32 host routes use different rules.
What is the difference between a subnet mask and a wildcard mask?
A subnet mask marks network bits with 1s. A wildcard mask is its inverse, so each subnet-mask octet plus the matching wildcard octet equals 255.
Can I enter a dotted-decimal subnet mask?
Yes. Enter a contiguous mask such as 255.255.255.0. Non-contiguous masks are rejected because they do not represent a CIDR prefix.
Does this calculator support IPv6?
No. This page calculates 32-bit IPv4 subnets. IPv6 uses 128-bit addresses and different address and broadcast conventions.
Does the calculator look up or scan the IP address?
No. It only performs arithmetic in your browser. It does not contact, scan, store, or geolocate the address.
Privacy note: subnet calculations happen in your browser. Your IP address is not contacted, stored, or uploaded.