Convert between a CIDR prefix and an IPv4 mask

Administrators use it when they need to move between a CIDR prefix and an IPv4 mask while reviewing rules or planning addresses.

Convert between a CIDR prefix and an IPv4 mask. Everything runs in your browser, so the values you enter are never uploaded, shared, or stored.

How to use

  1. Enter a CIDR prefix, written as a slash followed by the number of bits, or a full IPv4 mask.
  2. Import a text file if you need to convert several values from an addressing plan.
  3. Run the conversion to get the same mask written in the other notation.
  4. Read the result before copying it into a firewall rule or an address plan.

Example

The sample is a short prefix. Once converted, you get the equivalent IPv4 mask in dotted decimal form, which helps when you need to read a rule written in the other convention or complete an addressing sheet.

Input

/24

Output

255.255.255.0

Limits and formats

Where processing happens

Conversion takes place in your browser only. The prefix or mask you type stays on your device, is not transmitted anywhere and is not saved, so you can freely convert addresses taken from a private addressing plan.

Frequently asked questions

Can I type a dotted decimal mask directly?

Yes, the tool accepts either a prefix or a mask written in dotted decimal notation and shows the matching form in the other style. That saves you from converting by hand during a review.

Does the output include the number of usable hosts?

No, the conversion covers the mask notation only. Working out usable addresses would also require the network address and the broadcast address of the subnet.

Why was my value rejected?

Check that it is a valid, contiguous mask with no missing or extra digits. A prefix also has to stay within the bounds allowed by IPv4 addressing.

Tools in the same category