IPv4 Subnet Mask / CIDR Calculator
Enter an IPv4 address and a CIDR prefix length to get its subnet mask, network and broadcast addresses, usable host range, and host count.
- IP address
- 192.168.1.10
- Subnet mask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- Network address
- 192.168.1.0
- Broadcast address
- 192.168.1.255
- Usable host range
- 192.168.1.1 - 192.168.1.254
- Usable host count
- 254
- Total addresses in subnet
- 256
How it works
A CIDR prefix like /24 says how many of the address's 32 bits are the fixed 'network' portion — the rest are 'host' bits, free to vary within that subnet. The subnet mask is just those network bits set to 1 and the host bits set to 0 (a /24 is 11111111.11111111.11111111.00000000, i.e. 255.255.255.0).
The network address is the entered IP with every host bit forced to 0 (the IP ANDed with the mask); the broadcast address is the same but with every host bit forced to 1. Every address strictly between them is a usable host address — ordinary hosts can't use the network or broadcast address itself, so a /24's 256 total addresses yield 254 usable ones.
Two sizes get special treatment, per the standard convention: a /32 is a single address with no network/broadcast split (used for host routes), so it counts as 1 usable address; a /31 is the RFC 3021 point-to-point exception, where both addresses in the pair are usable since a two-address subnet has no room left for a separate broadcast address.
FAQ
What's the wildcard mask for?
It's the subnet mask with every bit flipped — Cisco access-control lists and some routing configurations specify it instead of (or alongside) the subnet mask, since it directly marks which bits are allowed to vary. It's shown here since it's a direct bitwise complement of the mask, not an extra lookup.
Why does a /31 show 2 usable hosts when every other small prefix reserves 2 addresses?
Because RFC 3021 specifically carves out that exception for point-to-point links (like a connection between two routers), where reserving a broadcast address would waste half the already-tiny 2-address subnet for no benefit — both addresses are treated as usable host addresses instead.
Related calculators
- Tip Calculator & Bill Splitter
- Password Entropy Calculator
- Paint Coverage Calculator
- Unit Price Comparison Calculator (Better Buy)
- Roman Numeral Converter
- Sleep Cycle Calculator
- Dilution Calculator (C₁V₁ = C₂V₂)
- 4-Band Resistor Color Code Calculator
- Chmod / Unix File Permissions Calculator
- Grade Needed Calculator
- Stair Calculator
- Great-Circle Distance Calculator
- Wind Chill Calculator
- Tire Size & Speedometer Error Calculator
- Depth of Field Calculator
- Delay Time Calculator (BPM to Milliseconds)
- Baseball Batting Stats Calculator (AVG, OBP, SLG, OPS)
- Concrete Calculator (Volume & Bags Needed)
- Golf Course Handicap Calculator
- Crosswind & Headwind Component Calculator
- Bicycle Gain Ratio Calculator
- Homebrew ABV Calculator
- Rowing Split & Power Calculator
- Guitar Fret Position Calculator
- Heat Index Calculator
- True Wind Calculator (Sailing)
- Knitting Gauge Calculator
- Baker's Percentage Calculator (Bread Dough Formula)
- Board Foot Calculator (Lumber Volume)
- Naismith's Rule Hiking Time Calculator
- Arrow Kinetic Energy & Momentum Calculator
- Wheelchair Ramp Slope Calculator (ADA Compliance)
- 3D Print Filament Weight & Cost Calculator
- Coffee Extraction Yield Calculator (SCA Brewing Chart)
- Candle Fragrance Load Calculator
- Climbing Fall Factor Calculator
- Cricket Net Run Rate (NRR) Calculator
- Density Altitude Calculator (Pilot Preflight)
- SMPTE Timecode Calculator
- Angle of View / Crop Factor Calculator
- Roof Pitch & Rafter Length Calculator
- Displacement Hull Speed Calculator
- Firewood Cord Calculator
- Scuba SAC Rate Calculator
- Guitar String Tension Calculator
- Wallpaper Calculator (Rolls Needed)
- Vehicle Braking Distance Calculator
- Fence Calculator (Posts, Rails & Pickets)