CIDR to Subnet Mask Converter — /24 Becomes 255.255.255.0
Convert /1 through /32 CIDR prefix length into netmask, wildcard & usable hosts.
| Input | Subnet mask | Wildcard | Total addresses | Usable |
|---|---|---|---|---|
/24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
/21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
/30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
/31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
/32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
/8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
When to use the /CIDR Prefix to Subnet & Wildcard Mask Converter
Mask, wildcard and capacity
Every prefix from /0 to /32 becomes its subnet mask, wildcard mask, total address count and the number of hosts you can really use. For example /26 becomes 255.255.255.192 with wildcard 0.0.0.63, 64 addresses and 62 hosts.
For older devices
Printers, CCTV cameras and industrial devices often only accept a dotted subnet mask. Enter the prefix and copy the right mask.
/31 and /32 counted right
/31 has two hosts for point-to-point links per RFC 3021 and /32 has one host, not zero as some calculators show.
Free format
Write /24 or just 24, one per line, to convert many prefixes at once. Values outside /0 to /32 are flagged in red and left out of the copied or downloaded result.
Frequently asked questions
How do I convert by hand?
Write as many 1 bits as the prefix, then 0 bits up to 32, and convert each 8 bits to decimal. /21 becomes 255.255.248.0.
How many hosts does a /29 have?
8 addresses and 6 usable hosts, a size often used for small public IP blocks from ISPs.
What is a wildcard mask?
The inverse of the subnet mask, used in Cisco ACLs and OSPF. The wildcard for /24 is 0.0.0.255, and for /30 it is 0.0.0.3.
What about the reverse?
Use the Subnet Mask to CIDR converter to turn a dotted mask such as 255.255.240.0 back into /20.
Is my data sent to a server?
No. Everything is computed in your browser, with no server connection.
Similar tools
- Dotted-Decimal Subnet Mask to /CIDR Prefix ConverterConvert dotted netmask (e.g. 255.255.248.0) into /prefix, binary & wildcard.
- CIDR Exclusion & WireGuard AllowedIPs BuilderSubtract LAN or private ranges from 0.0.0.0/0 or any block and get the minimal CIDR list for WireGuard, routing or MikroTik.
- CIDR & IP Range to Full Address List ExpanderExpand IPv4/IPv6 CIDRs and start–end ranges into every individual address, ready to export as TXT for scanners and ACLs.
- IP / CIDR List Diff & Allowlist AuditorCompare two IP/CIDR lists by real address coverage: what was added, removed, or overlaps — ideal for firewall allowlist reviews.