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.
Calculated Boundaries & ParametersReady
Key Capabilities
- •100% Client-Side: Zero telemetry or server latency.
- •RFC Compliant: Exact 32-bit and 128-bit integer precision.
- •Quick Copy: Instant access to CIDR, mask, and range bounds.
- •Cross-Platform: Works on desktop, tablet, and mobile browsers.
Related Masks, Wildcards & ACLAll Tools
IP Address and Mask Calculator
Calculate the corresponding network range.
Subnet Mask to CIDR Converter
Find prefix length from contiguous masks.
Subnet Mask Validator
Check mask structure and contiguity.
Subnet Mask to Wildcard Converter
Calculate the inverse IPv4 mask.
Wildcard Mask to Subnet Mask Converter
Convert compatible contiguous wildcard masks.
ACL Wildcard Match Calculator
Evaluate address-and-wildcard matching.
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.
Enter a prefix length
Type a value from /0 to /32, for example
/19.Build the bit string
The converter writes 19 ones and 13 zeros.
Split into 4 octets
11111111.11111111.11100000.00000000.Convert each octet to decimal
The result is
255.255.224.0, with the hex form0xFFFFE000.
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
0Every 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.
| CIDR | Subnet Mask | Hex Mask | Addresses |
|---|---|---|---|
| /0 | 0.0.0.0 | 0x00000000 | 4,294,967,296 |
| /1 | 128.0.0.0 | 0x80000000 | 2,147,483,648 |
| /2 | 192.0.0.0 | 0xC0000000 | 1,073,741,824 |
| /3 | 224.0.0.0 | 0xE0000000 | 536,870,912 |
| /4 | 240.0.0.0 | 0xF0000000 | 268,435,456 |
| /5 | 248.0.0.0 | 0xF8000000 | 134,217,728 |
| /6 | 252.0.0.0 | 0xFC000000 | 67,108,864 |
| /7 | 254.0.0.0 | 0xFE000000 | 33,554,432 |
| /8 | 255.0.0.0 | 0xFF000000 | 16,777,216 |
| /9 | 255.128.0.0 | 0xFF800000 | 8,388,608 |
| /10 | 255.192.0.0 | 0xFFC00000 | 4,194,304 |
| /11 | 255.224.0.0 | 0xFFE00000 | 2,097,152 |
| /12 | 255.240.0.0 | 0xFFF00000 | 1,048,576 |
| /13 | 255.248.0.0 | 0xFFF80000 | 524,288 |
| /14 | 255.252.0.0 | 0xFFFC0000 | 262,144 |
| /15 | 255.254.0.0 | 0xFFFE0000 | 131,072 |
| /16 | 255.255.0.0 | 0xFFFF0000 | 65,536 |
| /17 | 255.255.128.0 | 0xFFFF8000 | 32,768 |
| /18 | 255.255.192.0 | 0xFFFFC000 | 16,384 |
| /19 | 255.255.224.0 | 0xFFFFE000 | 8,192 |
| /20 | 255.255.240.0 | 0xFFFFF000 | 4,096 |
| /21 | 255.255.248.0 | 0xFFFFF800 | 2,048 |
| /22 | 255.255.252.0 | 0xFFFFFC00 | 1,024 |
| /23 | 255.255.254.0 | 0xFFFFFE00 | 512 |
| /24 | 255.255.255.0 | 0xFFFFFF00 | 256 |
| /25 | 255.255.255.128 | 0xFFFFFF80 | 128 |
| /26 | 255.255.255.192 | 0xFFFFFFC0 | 64 |
| /27 | 255.255.255.224 | 0xFFFFFFE0 | 32 |
| /28 | 255.255.255.240 | 0xFFFFFFF0 | 16 |
| /29 | 255.255.255.248 | 0xFFFFFFF8 | 8 |
| /30 | 255.255.255.252 | 0xFFFFFFFC | 4 |
| /31 | 255.255.255.254 | 0xFFFFFFFE | 2 |
| /32 | 255.255.255.255 | 0xFFFFFFFF | 1 |
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
0xFFFFFF00in bitwise checks.Preparing documentation
Design documents show both forms side by side for different readers.