Skip to main content
IP Range CalculatorPRO
Masks, Wildcards & ACLInstant Client-Side Tool

CIDR to Subnet Mask Converter

Convert IPv4 prefixes to dotted masks.

CIDR to Subnet Mask Converter: inputs and results

Enter an IP address, CIDR prefix, or range. Then check its first and last address below.

Quick presets:

Calculated Boundaries & ParametersReady

Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Total Addresses256
Usable Host Range254

How CIDR to Subnet Mask Converter Works?

This tool works by writing p ones followed by (32 − p) zeros and splitting the 32 bits into 4 decimal octets.

  1. Enter a prefix length

    Type a value from /0 to /32, for example /19.

  2. Build the bit string

    The converter writes 19 ones and 13 zeros.

  3. Split into 4 octets

    11111111.11111111.11100000.00000000.

  4. Convert each octet to decimal

    The result is 255.255.224.0, with the hex form 0xFFFFE000.

CIDR to Subnet Mask Converter Formula

The formula is Mask = 2^32 − 2^(32 − p), written as 4 dotted octets.

Integer mask

M = 2^32 − 2^(32−p)

For /19: 4,294,967,296 − 8,192 = 4,294,959,104.

Full octets

floor(p ÷ 8) octets of 255

/19 → 2 octets of 255.

Partial octet

256 − 2^(8 − (p mod 8))

/19 → 256 − 2^5 = 224.

Remaining octets

0

Every octet after the partial octet is 0.

Worked example: /19

floor(19 ÷ 8) = 2 → 255.255
19 mod 8 = 3 → 256 − 2^5 = 224
Remaining → 0
Mask = 255.255.224.0  (0xFFFFE000)

CIDR to Subnet Mask Converter Conversion Table

The table maps all 33 prefix lengths, /0 to /32, to their dotted subnet mask and hexadecimal mask.

CIDRSubnet MaskHex MaskAddresses
/00.0.0.00x000000004,294,967,296
/1128.0.0.00x800000002,147,483,648
/2192.0.0.00xC00000001,073,741,824
/3224.0.0.00xE0000000536,870,912
/4240.0.0.00xF0000000268,435,456
/5248.0.0.00xF8000000134,217,728
/6252.0.0.00xFC00000067,108,864
/7254.0.0.00xFE00000033,554,432
/8255.0.0.00xFF00000016,777,216
/9255.128.0.00xFF8000008,388,608
/10255.192.0.00xFFC000004,194,304
/11255.224.0.00xFFE000002,097,152
/12255.240.0.00xFFF000001,048,576
/13255.248.0.00xFFF80000524,288
/14255.252.0.00xFFFC0000262,144
/15255.254.0.00xFFFE0000131,072
/16255.255.0.00xFFFF000065,536
/17255.255.128.00xFFFF800032,768
/18255.255.192.00xFFFFC00016,384
/19255.255.224.00xFFFFE0008,192
/20255.255.240.00xFFFFF0004,096
/21255.255.248.00xFFFFF8002,048
/22255.255.252.00xFFFFFC001,024
/23255.255.254.00xFFFFFE00512
/24255.255.255.00xFFFFFF00256
/25255.255.255.1280xFFFFFF80128
/26255.255.255.1920xFFFFFFC064
/27255.255.255.2240xFFFFFFE032
/28255.255.255.2400xFFFFFFF016
/29255.255.255.2480xFFFFFFF88
/30255.255.255.2520xFFFFFFFC4
/31255.255.255.2540xFFFFFFFE2
/32255.255.255.2550xFFFFFFFF1

What is CIDR to Subnet Mask Converter?

The CIDR to Subnet Mask Converter is a tool that turns a CIDR prefix length into the equivalent dotted-decimal IPv4 subnet mask. /24 becomes 255.255.255.0.

CIDR notation and dotted masks express the same 32-bit value. Cloud consoles, Linux, and modern routers use the prefix form. Windows network settings, many firewalls, and embedded devices still ask for the dotted form.

Only 33 valid IPv4 masks exist, one for each prefix length from /0 to /32. The converter lists all 33 with their hexadecimal form for scripts and packet analysis.

What are the uses of CIDR to Subnet Mask Converter?

There are 4 main uses of the CIDR to Subnet Mask Converter, including device configuration, scripting, and documentation.

  • Configuring Windows and appliances

    Windows IPv4 settings require a dotted mask. A /20 entry becomes 255.255.240.0.

  • Translating cloud designs

    Cloud plans in CIDR form become dotted masks for on-premises firewalls.

  • Writing scripts

    Scripts compare hex masks such as 0xFFFFFF00 in bitwise checks.

  • Preparing documentation

    Design documents show both forms side by side for different readers.