What is Subnet Calculator?
Convert a dotted-decimal subnet mask such as 255.255.255.0 to its CIDR prefix /24, or select a prefix to find the mask. No IP address is required: the wildcard mask and total address count are also shown, with separate copy actions.
Optionally add an IPv4 address to calculate its network, directed broadcast, usable host range and equal-size subnet divisions. Pasting an address with /prefix updates the mask. Only IPv4 is supported; /31 uses the point-to-point convention and /32 represents one address.
Convert a subnet mask without an IP address
Leave IP address empty and enter 255.255.255.0. The prefix becomes /24, the wildcard mask is 0.0.0.255 and the block contains 256 addresses. Choose /26 to convert back to 255.255.255.192, with wildcard 0.0.0.63 and 64 total addresses.
A CIDR mask has consecutive 1 bits followed by 0 bits. 255.0.255.0 is not a valid CIDR mask. Invalid mask input pauses dependent results; clearing the optional IP only removes network-specific results. Pasting 192.168.10.42/24 into IP sets the prefix and mask together.
| Subnet mask | CIDR | Total addresses |
|---|---|---|
| 0.0.0.0 | /0 | 4,294,967,296 |
| 255.255.255.0 | /24 | 256 |
| 255.255.255.192 | /26 | 64 |
| 255.255.255.254 | /31 | 2 |
| 255.255.255.255 | /32 | 1 |
Worked example: find the network for an office device
Choose “Office /24” above to load 192.168.10.42/24. The address identifies a device; /24 means the first 24 of its 32 bits identify the network. The calculator clears the remaining eight bits to find 192.168.10.0/24.
Read the mask together with the range. A /24 contains 256 addresses, but a conventional IPv4 subnet reserves its first address for the network and its last for directed broadcast. That leaves 254 host addresses before you reserve any for a gateway, DHCP exclusions or other equipment.
| Field | Result | How to use it |
|---|---|---|
| Network | 192.168.10.0/24 | The shared network prefix; it is not the device address. |
| Subnet mask | 255.255.255.0 | The dotted-decimal form of /24. |
| Wildcard mask | 0.0.0.255 | The bitwise inverse of the subnet mask; interpret it according to your ACL syntax. |
| Host range | 192.168.10.1 – 192.168.10.254 | Candidate host addresses; this tool does not check which ones are occupied. |
| Broadcast | 192.168.10.255 | The directed-broadcast address for this conventional subnet. |
| Address counts | 256 total / 254 usable | Address capacity, not a count of connected devices. |
Split the /24 into four equal networks
Leave “Split into” at 4. Four subnets need two extra network bits, so /24 becomes /26. Each block contains 64 addresses and normally supports 62 hosts. The original device, 192.168.10.42, falls in the first block.
Splitting changes the addressing plan; it does not configure a router or isolate traffic by itself. Apply the intended prefixes, routing and access rules on your own equipment. This tool performs equal-size subdivision, not VLSM allocation for differently sized departments.
| Network | Usable range | Broadcast |
|---|---|---|
| 192.168.10.0/26 | 192.168.10.1 – 192.168.10.62 | 192.168.10.63 |
| 192.168.10.64/26 | 192.168.10.65 – 192.168.10.126 | 192.168.10.127 |
| 192.168.10.128/26 | 192.168.10.129 – 192.168.10.190 | 192.168.10.191 |
| 192.168.10.192/26 | 192.168.10.193 – 192.168.10.254 | 192.168.10.255 |
Why /31 and /32 use different rules
The usual host calculation is 2^(32 − prefix) − 2. It does not apply to a /31 point-to-point link: RFC 3021 permits both addresses to identify its two endpoints, with no directed-broadcast address. Use this interpretation only where the link and equipment support it.
A /32 denotes one address. The “Single host /32” example returns 10.0.0.7 as both the first and last host; there is no separate broadcast address and no smaller subnet to split into. “—” in the broadcast field means not applicable.
Only IPv4 is supported. The address-type label is a simplified classification of common ranges, not an exhaustive special-purpose registry or a test of Internet reachability. No network scan is performed.
| Input | Usable hosts | Directed broadcast |
|---|---|---|
| 10.0.0.0/31 | 10.0.0.0 and 10.0.0.1 (2) | None |
| 10.0.0.7/32 | 10.0.0.7 (1) | None |
Frequently asked questions
Can I convert a subnet mask without an IP address?
Yes. Leave the optional IP field empty to convert between a subnet mask and CIDR, see the wildcard mask and count addresses. Add an IP only when you need a specific network or host range.
Why is 255.0.255.0 rejected?
A CIDR subnet mask must have consecutive 1 bits followed by 0 bits. 255.0.255.0 has 1 bits after 0 bits and cannot be represented by one CIDR prefix. A wildcard mask is a different representation and is shown separately.
Why do /31 and /32 show different host counts?
/31 (RFC 3021) is a point-to-point link where both addresses are usable, and /32 is a single host — the usual "minus two" rule does not apply.
References and example checks
- RFC 4632 — Classless Inter-domain Routing (CIDR)
- RFC 3021 — 31-Bit Prefixes on IPv4 Point-to-Point Links
Examples checked against this tool: .