CIDR to Netmask Converter
Paste whatever you have — a prefix like /24, a subnet mask like 255.255.255.0, or a wildcard like 0.0.0.255 — and get all three forms plus the host count.
Quick reference — common prefixes
| Prefix | Subnet mask | Wildcard | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,214 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,574 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,534 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,094 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 |
The difference between /24 and /25 is one bit — and one bit changes which hosts can talk to each other. In the NetForge-AI lab you can assign both masks to the same topology and watch the pings prove it.
Start the free Addressing modulePrefix, mask, wildcard — why three formats?
They all say the same thing: how many bits are network and how many are host. The prefix length is the shortest form (/24). The subnet mask writes it in dotted decimal (255.255.255.0) — that's what you type on an interface. The wildcard mask flips every bit (0.0.0.255) — that's what ACLs and OSPF need.
Converting between them is pure arithmetic: mask = 32 ones left-shifted, wildcard = 255.255.255.255 minus the mask, host count = 2(32 − prefix) − 2. The converter above runs that instantly, but once you can do it from the bit pattern in your head, every subnetting question on an exam becomes a 15-second answer. The full method is taught step-by-step in Module 2 · IP Addressing & Subnetting.
CIDR & netmask FAQ
What does CIDR notation mean?
CIDR (Classless Inter-Domain Routing) notation writes an IP block as address/prefix — for example 10.0.0.0/24. The number after the slash is the prefix length: how many of the 32 bits identify the network. A /24 means the first 24 bits are fixed and the last 8 address hosts, giving 256 addresses (254 usable).
Why does /24 equal 255.255.255.0?
A /24 means 24 network bits set to 1 and 8 host bits set to 0. Written as four octets that's 11111111.11111111.11111111.00000000, which in decimal is 255.255.255.0. The mask simply writes the prefix length in a format that routers and interfaces understand.
What is the difference between classful and classless addressing?
Classful (the original system) locked addresses into /8, /16, or /24 based on the first octet — Class A, B, or C. CIDR removed that restriction: any prefix is valid, so a company needing 500 addresses can get a /23 instead of wasting a whole /16 (65 534 addresses). All modern routing is classless.
When would I need a wildcard mask instead of a subnet mask?
Access-list (ACL) rules and OSPF network statements use wildcard masks because they can express non-contiguous bit patterns that subnet masks can't. For the common case, the wildcard is just 255 minus each mask octet: mask 255.255.255.192 → wildcard 0.0.0.63.
More free tools: Subnet Calculator · VLSM Planner · Wildcard Mask Converter · OSI Model Chart