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.

Prefix length/24
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
Total addresses256
Usable hosts254

Quick reference — common prefixes

PrefixSubnet maskWildcardUsable hosts
/8255.0.0.00.255.255.25516,777,214
/12255.240.0.00.15.255.2551,048,574
/16255.255.0.00.0.255.25565,534
/20255.255.240.00.0.15.2554,094
/22255.255.252.00.0.3.2551,022
/23255.255.254.00.0.1.255510
/24255.255.255.00.0.0.255254
/25255.255.255.1280.0.0.127126
/26255.255.255.1920.0.0.6362
/27255.255.255.2240.0.0.3130
/28255.255.255.2400.0.0.1514
/29255.255.255.2480.0.0.76
/30255.255.255.2520.0.0.32
/31255.255.255.2540.0.0.12
/32255.255.255.2550.0.0.01
See these masks in action

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 module

Prefix, 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

CIDR to Netmask Converter — prefix, subnet mask, wildcard, hosts · NetForge-AI