Fieldeng
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

NameUnit
Prefix length1
Subnet maskipv4

Outputs

NameUnit
CIDR prefix (hero result)1
Subnet maskipv4
Host bits1
Number of addresses1

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.

On this page