Interactive toolSubnetting & CIDREN master
ToolSubnettingMáscara / CIDR

Subnet Mask ↔ CIDR Converter

Convert IPv4 CIDR prefixes to dotted-decimal subnet masks and back, validate contiguous masks, and optionally inspect the resulting network range.

Practical modeEnter your data and review the result

Subnet Mask ↔ CIDR

Convert CIDR prefixes and dotted-decimal masks and inspect their ranges.

Conversion
Understand the result

What this tool calculates and how to interpret the result.

Convert subnet masks and CIDR prefixes

This tool converts between the two common ways of expressing an IPv4 network prefix: CIDR notation such as /24 and dotted-decimal subnet masks such as 255.255.255.0. Both describe exactly the same boundary between network bits and host bits, but each is common in different interfaces, operating systems and network documentation.

The converter validates that a dotted-decimal mask is contiguous. A valid IPv4 subnet mask consists of consecutive binary ones followed by consecutive zeros; values that switch back from zero to one are not valid subnet masks. If you also enter an IPv4 address, the tool calculates the normalized network and range so you can immediately see what the mask means in practice.

How to convert CIDR to a subnet mask

Select CIDR mode and choose a prefix. A /24 becomes 255.255.255.0, a /25 becomes 255.255.255.128, and a /26 becomes 255.255.255.192. The calculator also shows block size and the changing-octet increment, which is useful when doing subnetting by hand.

If the relationship between binary bits and decimal octets is not yet intuitive, review the IP addressing guide. You can later compare the same value with the English binary converter once that tool family is published.

How to convert a mask to CIDR

Select mask mode and enter a dotted-decimal value such as 255.255.255.224. The converter counts the consecutive network bits and returns /27. Because a /27 leaves five host bits, the block contains 32 total addresses. This conversion is especially useful when older device configurations display masks while modern documentation uses CIDR.

Invalid masks are rejected instead of being interpreted loosely. For example, 255.0.255.0 contains separated groups of ones and zeros and therefore does not represent a contiguous IPv4 prefix.

Why only certain octet values appear in masks

Within a contiguous mask octet, the valid decimal values are 0, 128, 192, 224, 240, 248, 252, 254 and 255. They are simply the decimal forms of binary patterns that start with ones and finish with zeros. Learning this small set makes manual prefix conversion much faster.

The changing octet also determines the subnet increment. If the mask octet is 224, the increment is 256 − 224 = 32. Networks therefore begin at multiples of 32 in that octet.

Using a base IP to understand the result

Enter an optional host address and the converter will normalize it to the corresponding network. This connects the abstract mask to concrete boundaries: network address, usable range and broadcast for normal IPv4 LAN semantics. For a dedicated boundary calculation, use the network and broadcast calculator.

In production networks, this conversion is also useful when reading mixed vendor documentation. One device may display a prefix length, another may request a dotted mask, and an ACL or routing policy may use a wildcard derived from that mask. Keeping the representations connected reduces transcription mistakes and makes configuration reviews easier.

Frequently asked questions

Is /24 always 255.255.255.0?

Yes. A /24 has 24 consecutive network bits, which produces 255.255.255.0.

Can every dotted-decimal value be a subnet mask?

No. A valid subnet mask must be contiguous in binary, with all network bits first and all host bits after them.

What is the mask for /30?

A /30 corresponds to 255.255.255.252 and contains four total IPv4 addresses.

Does this converter change the IP address itself?

No. It converts or validates the prefix representation. If a base IP is provided, it uses that information only to calculate the surrounding network range.

Next step

Once mask conversion is comfortable, use the subnet block-size calculator to practice increments, then move to the FLSM calculator or VLSM calculator for complete address plans.