Subnet Calculator

Convert a mask or CIDR prefix

Edit either representation to convert. Add an IP when you need network details.

Dotted decimal, for example 255.255.255.0.

Network bits, from /0 to /32.

Or paste 192.168.10.42/24; its prefix updates the mask.

Try an example:

Conversion results

Subnet mask
255.255.255.0
CIDR prefix
/24
Wildcard mask
0.0.0.255
Total addresses
256

Add an IP to see its network, host range and equal-size subnets.

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.

Mask and prefix equivalents
Subnet maskCIDRTotal addresses
0.0.0.0/04,294,967,296
255.255.255.0/24256
255.255.255.192/2664
255.255.255.254/312
255.255.255.255/321

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.

Expected result for 192.168.10.42/24
FieldResultHow to use it
Network192.168.10.0/24The shared network prefix; it is not the device address.
Subnet mask255.255.255.0The dotted-decimal form of /24.
Wildcard mask0.0.0.255The bitwise inverse of the subnet mask; interpret it according to your ACL syntax.
Host range192.168.10.1 – 192.168.10.254Candidate host addresses; this tool does not check which ones are occupied.
Broadcast192.168.10.255The directed-broadcast address for this conventional subnet.
Address counts256 total / 254 usableAddress 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.

Four /26 blocks inside 192.168.10.0/24
NetworkUsable rangeBroadcast
192.168.10.0/26192.168.10.1 – 192.168.10.62192.168.10.63
192.168.10.64/26192.168.10.65 – 192.168.10.126192.168.10.127
192.168.10.128/26192.168.10.129 – 192.168.10.190192.168.10.191
192.168.10.192/26192.168.10.193 – 192.168.10.254192.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.

Boundary examples available above
InputUsable hostsDirected broadcast
10.0.0.0/3110.0.0.0 and 10.0.0.1 (2)None
10.0.0.7/3210.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

Examples checked against this tool: .