CIDR to netmask
- Network address
- 0.0.0.0
- Broadcast address
- 0.0.0.255
- First usable host
- 0.0.0.1
- Last usable host
- 0.0.0.254
- Usable hosts
- 254
- Total addresses
- 256
- Subnet mask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- CIDR notation
- 0.0.0.0/24
- Address range
- 0.0.0.0 – 0.0.0.255
- Class
- A
- Scope
- This network
- Mask in binary
- 11111111.11111111.11111111.00000000
- Address in binary
- 00000000.00000000.00000000.00000000
- Subnets of /26
- 4
- Usable hosts in each
- 62
- Smallest block for 50 hosts
- /26
Calculated in your browser · nothing is looked up or uploaded
Converts a CIDR prefix length into its dotted-decimal subnet mask and wildcard mask, with the number of addresses the prefix covers.
How to use the cidr to netmask
The conversion is mechanical — a /n mask is n ones followed by 32−n zeros — but the table is worth having because only nine values can appear in a mask octet: 0, 128, 192, 224, 240, 248, 252, 254 and 255. Anything else is not a valid mask, and recognising that at a glance catches typos before they reach a router.
The prefixes worth memorising are /24 (255.255.255.0, 254 hosts), /16 (255.255.0.0, 65,534 hosts) and /8 (255.0.0.0, 16.7 million). Below /24 the useful ones are /25 through /30, halving each time: 126, 62, 30, 14, 6 and 2 usable hosts.
The wildcard mask is the inverted subnet mask and it is not interchangeable. Cisco access lists and OSPF network statements take a wildcard, so writing 255.255.255.0 where 0.0.0.255 belongs matches an entirely different set of addresses — and does so silently, which is the dangerous part.
Questions
255.255.255.0 — 24 ones then 8 zeros, giving 254 usable hosts.