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

Network
192.168.1.0/24
Broadcast
192.168.1.255
Netmask
255.255.255.0
Wildcard mask
0.0.0.255
Host range
192.168.1.1 – 192.168.1.254
Total addresses
256
Usable hosts
254
Address class
C
Scope
Private (192.168.0.0/16)
Host bits set
yes (normalised)
Network: 192.168.1.0/24
Broadcast: 192.168.1.255
Netmask: 255.255.255.0
Wildcard: 0.0.0.255
Host range: 192.168.1.1 – 192.168.1.254
Usable hosts: 254

Supported formats

Input
text
Output
text, number

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

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.
textSelect to copy
network = address AND mask
  • A non-contiguous subnet mask is rejected rather than guessed.
  • /31 and /32 follow RFC 3021 host counting.

Methodology

  1. Parse the address strictly and accept the mask as dotted-quad or prefix length.
  2. Verify the mask bits are contiguous before using it.
  3. Compute network, broadcast, netmask, wildcard, host range and counts as unsigned 32-bit integers.

Usage

  1. Enter the IPv4 address.
  2. Enter the subnet mask (255.255.255.0) or prefix length (24).
  3. 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

jsonSelect to copy
{
  "ip": "192.168.1.10",
  "mask": "255.255.255.0"
}

A /26 subnet from a prefix

jsonSelect to copy
{
  "ip": "10.0.0.130",
  "mask": "26"
}

A point-to-point /30

jsonSelect to copy
{
  "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

  1. RFC 950: Internet Standard Subnetting Procedure — IETF
  2. RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links — IETF