Subnet Mask Converter
Convert between dotted subnet masks, CIDR prefix lengths, wildcard masks, hex and binary, and validate contiguous masks.
Your inputs
Results
Prefix length
/20
- Dotted mask
- 255.255.240.0
- Wildcard (inverse) mask
- 0.0.15.255
- Hexadecimal
- 0xFFFFF000
- Binary
- 11111111.11111111.11110000.00000000
- Addresses per subnet
- 4,096
✓Exact calculation — rounded only for display
What this calculator does
The same mask can be written as 255.255.240.0, /20 or 0.0.15.255 (wildcard).
Formula and method
Prefix = number of leading 1 bits; wildcard = NOT mask
Worked example
Calculated by this tool with its default inputs:
Inputs
- Subnet mask (dotted) or prefix (e.g. /20): 255.255.240.0
Results
- Prefix length: /20
- Dotted mask: 255.255.240.0
- Wildcard (inverse) mask: 0.0.15.255
- Hexadecimal: 0xFFFFF000
- Binary: 11111111.11111111.11110000.00000000
- Addresses per subnet: 4,096
How to read the results
Masks must be contiguous: all ones followed by all zeros.
Assumptions and limitations
- Calculated entirely in your browser — addresses and values are never sent to a server.
Questions
Where are wildcard masks used?
In access control lists on some network equipment.
Methodology and verification
- Result type
- Exact mathematical calculation (rounded only for display)
- Formula version
- 1.0
- Automated verification
- 4 reference and validation test cases, checked against independently computed values. The site cannot be built if any of them fail.
- Editorial review
- Awaiting human editorial review. The explanation was drafted with AI assistance; the formula and examples are verified by the automated tests above.
Privacy
Everything you enter is calculated in this browser and is not sent to Numerith or anyone else. Inputs are added to a share link only if you choose to include them. Privacy policy