Subnet Mask Calculator
Type a subnet mask such as 255.255.255.192, a prefix length such as /26, or a wildcard mask such as 0.0.0.63, and see all the equivalent forms: dotted mask, prefix, wildcard, binary and hexadecimal, plus the number of addresses and usable hosts. A reference table of every IPv4 mask from /0 to /32 highlights your choice.
- Runs in your browser
- No sign-up
- Free to use
For example 255.255.255.192, /26, 26 or the wildcard 0.0.0.63.
| Prefix | Subnet mask | Wildcard | Addresses | Usable hosts |
|---|
How to use Subnet Mask Calculator
- Enter a mask, a prefix length or a wildcard.
- Read the equivalent forms and the host counts.
- Use the table to compare neighbouring sizes.
- Copy the form your device or software expects.
Subnet Mask Calculator features
Three inputs
Dotted mask, prefix length or wildcard, recognised automatically.
Validation
Rejects masks whose one-bits are not contiguous.
Binary and hex
For understanding and for software that needs them.
Host counts
Addresses, usable hosts and subnets per /24.
Reference table
All 33 IPv4 masks with wildcards and sizes.
Private
Runs in your browser.
When to use Subnet Mask Calculator
- Translating /24 into 255.255.255.0 for a device setting.
- Checking whether a mask is valid.
- Converting a router wildcard back to a mask.
- Revising for networking exams.
Subnet Mask Calculator FAQ
What is a subnet mask?
A 32-bit value whose leading one-bits mark the network part of an address and whose zero-bits mark the host part. 255.255.255.0 has 24 one-bits, so it is a /24.
Why are some masks invalid?
The one-bits must be contiguous from the left. 255.0.255.0 mixes ones and zeros and is not a valid subnet mask.
What is a wildcard mask?
The inverse of a subnet mask, used in Cisco ACLs and OSPF: zero bits must match, one bits are ignored. The wildcard for /26 is 0.0.0.63.
How many hosts does a /26 have?
64 addresses, of which 62 are usable hosts.
What about /31 and /32?
/31 is used for point-to-point links with two usable addresses (RFC 3021); /32 is a single host.
Is anything sent?
No.
Three spellings of the same boundary
A subnet mask marks where the network part of an IPv4 address ends and the host part begins. It can be written in three ways: dotted decimal, as in 255.255.255.192; as a prefix length, /26; or inverted, as a wildcard mask, 0.0.0.63. Devices and documentation use all three, which is why converting between them is a daily task for network administrators.
The relationship is simple in binary. A /26 mask is twenty-six ones followed by six zeros. Dotted decimal writes those bits in four groups of eight; the prefix counts the ones; the wildcard flips every bit. Showing the binary form makes the boundary visible.
The number of host bits determines the size of the subnet: two to the power of the host bits. Two of those addresses, the network and broadcast addresses, are normally reserved, which is where the familiar 254, 126, 62, 30 host counts come from.
Only masks with contiguous ones are valid. Older equipment sometimes accepted non-contiguous masks, but modern routing and every current standard require contiguous masks. The calculator rejects anything else and suggests what was probably meant when a wildcard is entered by mistake.