Subnet Calculator
Compute subnet details for an IPv4 address and a subnet mask or prefix, including the host range.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Subnet /24 starting at 192.168.1.0.
How it works
- Parsed the IPv4 address and converted the subnet mask to a prefix length.
- Normalised the address to its network boundary with a bitwise AND.
- Computed the wildcard mask and the usable range 192.168.1.1 – 192.168.1.254.
- Classified the address class and scope for reference.
network = address AND mask- A non-contiguous subnet mask is rejected rather than guessed.
- /31 and /32 follow RFC 3021 host counting.
Methodology
- Parse the address strictly and accept the mask as dotted-quad or prefix length.
- Verify the mask bits are contiguous before using it.
- Compute network, broadcast, netmask, wildcard, host range and counts as unsigned 32-bit integers.
Usage
- Enter the IPv4 address.
- Enter the subnet mask (255.255.255.0) or prefix length (24).
- Run the calculation and copy the result.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
A /24 subnet from a dotted mask
{
"ip": "192.168.1.10",
"mask": "255.255.255.0"
}A /26 subnet from a prefix
{
"ip": "10.0.0.130",
"mask": "26"
}A point-to-point /30
{
"ip": "198.51.100.9",
"mask": "255.255.255.252"
}Limitations
Mask or prefix, same boundary
A subnet mask is the binary boundary between the network and host parts of an address, written as a dotted quad. A prefix length is the number of leading network bits. The two are interchangeable, and this tool accepts either.
Contiguity matters: routers interpret masks as a single run of ones, so a mask like 255.0.255.0 has no defined prefix length and is rejected.
Frequently asked questions
- Can I enter a prefix instead of a mask?
- Yes. Enter 24 or /24 and the tool derives 255.255.255.0.
- Why is my mask rejected?
- Subnet masks must be a contiguous run of leading ones; masks such as 255.0.255.0 are invalid and are reported instead of guessed.
Sources
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.