Conversion

CIDR to subnet mask converter

Convert a CIDR prefix to an IPv4 subnet mask or a mask back to a prefix. See the wildcard mask and the result in binary.

New to this tool? Start here.

Click an example below the form. Look at the result, then change one value to compare what happens.

CIDR
A way to write a network size as a number after a slash, such as /24. It replaces the longer mask notation 255.255.255.0.
Subnet mask
Separates the network part of an address from the part used for devices. The mask and prefix describe the same split.

01 / Input

Start with your data

Local
E.g. /24, 24 or 255.255.255.0.
Try an example

Your data is processed in the browser. Sharing a result is your choice.

02 / Your result

A result you can understand.

Fill in the form or choose an example. You will see the values and how they were calculated.

How to use it

A subnet mask contains consecutive 1 bits followed only by 0 bits. The result also includes the wildcard mask.

A little network lab

Where does 255.255.254.0 come from?

A /23 does not end at an octet boundary. Break it into groups of bits to understand the mask and block size.

Example result/23 ↔ 255.255.254.0Open example in calculator
  1. Two full octets of ones use 16 bits. Each has value 255. Seven more ones are needed to reach 23.

  2. The third octet is 11111110, or 254. The fourth is 00000000. The mask is therefore 255.255.254.0.

  3. There are 9 host bits: 2⁹ = 512 addresses and 510 ordinary usable hosts. For example, 192.168.0.0/23 ends at 192.168.1.255.

Your turn

Which mask corresponds to /25?

Show answer and explanation

255.255.255.128. The final octet has a single one bit: 10000000. The block contains 128 addresses.

Official documents

Standards & sources

Sources checked:

The date refers to checking the listed documents and registries, not endorsement by their authors. Calculation assumptions and limits appear with the result. How we prepare the material.