Developer Tools
IPv4 Subnet Calculator
Inspect IPv4 networks and CIDR ranges without sending addresses to an API.
192.168.1.0/24
The entered host 192.168.1.42 belongs to this subnet.
- Network address
- 192.168.1.0
- Broadcast address
- 192.168.1.255
- Subnet mask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- Address range
- 192.168.1.0 – 192.168.1.255
- Total addresses
- 256
- Conventional usable hosts
- 254
Host-count conventions depend on subnet use. /31 is commonly used for point-to-point links under RFC 3021, while /32 identifies one address.
About This Tool
IPv4 subnetting divides the 32 bits of an address into a network prefix and the remaining address space. This calculator accepts an IPv4 address in CIDR notation, such as 192.168.1.42/24, and determines the containing network, broadcast address, subnet mask, wildcard mask, complete address range, and address counts. It is useful when checking firewall rules, cloud network plans, router configuration, lab exercises, and whether a host belongs to the network boundary you expected. The calculation is deterministic and runs locally; it does not look up or transmit the entered IP address.
How To Use It
- Enter four decimal IPv4 octets followed by / and a prefix length from 0 through 32.
- Use either a host address or the network address. The calculator masks the entered address to find the network boundary.
- Review the network, broadcast, mask, wildcard mask, range, and counts. Copy individual values where useful.
- Treat the usable-host count as a convention rather than a universal deployment rule, especially for /31 and /32 networks.
Examples
Typical /24
192.168.1.42/24 belongs to 192.168.1.0/24. Its mask is 255.255.255.0 and its broadcast address is 192.168.1.255.
Prefix not aligned to an octet
10.0.12.34/20 uses mask 255.255.240.0, so the third octet advances in blocks of 16. The containing network begins at 10.0.0.0 and ends at 10.0.15.255.
Point-to-point /31
A /31 contains two addresses. RFC 3021 permits both addresses to be used on qualifying point-to-point links, so the old subtract-two host rule should not be applied blindly.
Useful Notes
How the network address is calculated
A CIDR prefix tells how many leading bits identify the network. The corresponding subnet mask contains that many 1 bits followed by 0 bits. A bitwise AND between the IPv4 address and mask clears host bits and produces the network address.
Broadcast and wildcard masks
The wildcard mask is the bitwise inverse of the subnet mask. Setting every host bit in the network address to 1 produces the traditional directed broadcast address. For example, /24 has mask 255.255.255.0 and wildcard mask 0.0.0.255.
Address counts
A prefix /p leaves 32-p address bits, so the block contains 2^(32-p) addresses. Historically, ordinary multi-access IPv4 subnets reserve the all-zero host portion as the network address and the all-one host portion as broadcast, giving 2^(32-p)-2 conventional host addresses for prefixes through /30.
/31 and /32 are special cases
A /31 has two addresses and is commonly used on point-to-point links under RFC 3021, where network/broadcast semantics are adjusted and both can identify endpoints. A /32 represents one IPv4 address. Actual platform rules can still depend on the router, cloud, or service being configured.
CIDR versus dotted masks
CIDR /24 is a compact way to express the same contiguous mask as 255.255.255.0. /20 corresponds to 255.255.240.0. Prefix notation also makes block size and route aggregation easier to reason about.
Scope and privacy
This tool performs IPv4 arithmetic only. It does not determine an IP's owner, location, reachability, DNS name, routing path, or whether a proposed subnet is available in a particular cloud account. No entered address is sent to a lookup service.
FAQ
Can I enter a host IP instead of the network address?
Yes. The calculator applies the prefix mask and reports the containing network. It also tells you whether the entered IP was already exactly on the network boundary.
Why is the traditional usable-host count usually two less than the total?
On conventional IPv4 subnets through /30, the first address represents the network and the last is the directed broadcast address. /31 and /32 require different interpretation and are handled separately.
Does /24 always mean 255.255.255.0?
Yes for a normal contiguous IPv4 CIDR mask. A /24 has 24 leading 1 bits, producing 255.255.255.0.
Does this calculator support IPv6?
No. IPv6 addressing and prefix behavior deserve a dedicated interface and explanations rather than being mixed into an IPv4 calculator.
Related Tools
Number Base Converter
Convert integers between binary, octal, decimal, and hexadecimal.
URL Parser & Inspector
Inspect URL components and query parameters.
Unix Timestamp Converter
PopularConvert Unix seconds, milliseconds, ISO dates, UTC, and local time.
JSON Formatter & Validator
PopularValidate JSON, pretty-print it, minify it, and inspect JSON paths.