Networking & Communications
CIDR / Subnet Mask
Convert between CIDR prefix length and a contiguous dotted-decimal IPv4 mask.
Networking & Communications
Convert between CIDR prefix length and a contiguous dotted-decimal IPv4 mask.
App id: NET-02. Reference version 1.0.
How to fill it
Leave one field blank. The tool solves the rest.
On the tool screen, Calc is the working sheet. Presets stores values you reuse. Reference is the formula, assumptions, and provenance below.
Formula
mask = first n bits set; prefix = popcount(mask)Inputs
| Name | Unit |
|---|---|
| Prefix length | 1 |
| Subnet mask | ipv4 |
Outputs
| Name | Unit |
|---|---|
| CIDR prefix (hero result) | 1 |
| Subnet mask | ipv4 |
| Host bits | 1 |
| Number of addresses | 1 |
Diagnose
This tool does not attach diagnose observations.
Assumptions
- Non-contiguous masks are rejected. Address count includes network and broadcast addresses.
Provenance
- CIDR prefix length and contiguous IPv4 subnet masks.