Developer Tools
Subnet Calculator
IPv4 CIDR calculator — network, broadcast, host range, masks, all copyable.
Updated July 8, 2026
How to use the subnet calculator
- 1Enter any IPv4 address in the subnet you care about.
- 2Set the CIDR prefix with the slider or the common-size shortcuts.
- 3Read the network, broadcast, host range, and both masks.
- 4Copy any value straight into your config or homework.
Common uses
- Carving a network into right-sized subnets for VLANs or a homelab
- Checking whether two IPs share a subnet before debugging routing
- Getting the wildcard mask right for an ACL or OSPF statement
- Working through networking-class subnetting problems with instant feedback
Frequently asked questions
What does CIDR notation like /24 mean?
The number of leading bits locked as the network portion. A /24 fixes the first 24 bits, leaving 8 for hosts: 256 addresses, 254 usable after the network and broadcast addresses. Each step smaller (/23) doubles the space; each step larger (/25) halves it.
Why are two addresses unusable in most subnets?
The all-zeros host address identifies the network itself and the all-ones address is the broadcast. The exceptions: /31 (RFC 3021) uses both addresses for point-to-point links, and /32 is a single host route — the calculator handles both correctly.
What's a wildcard mask?
The subnet mask inverted — 0.0.0.255 instead of 255.255.255.0 — used by Cisco ACLs and OSPF network statements, where set bits mean 'don't care.' Getting it backwards is a classic config error, which is why it's computed for you.
How do I pick a prefix size for N hosts?
Find the smallest power of two that fits N + 2. Thirty hosts need 32 addresses → /27. Slide the CIDR control and watch the usable-hosts figure — it's the fastest way to build the intuition.
About this tool
The subnet calculator takes any IPv4 address and CIDR prefix and computes everything a network task needs: network and broadcast addresses, first and last usable host, usable host count, subnet mask, wildcard mask (for Cisco ACLs and OSPF), total address count, and the mask in binary for when you're learning why any of this works. It recognizes and labels special ranges — RFC 1918 private space, loopback, and link-local — and handles the modern edge cases correctly: /31 as an RFC 3021 point-to-point pair and /32 as a single host. Every value has a copy button, because subnet math usually ends with pasting into a config.
Like everything on UtilityBase, the subnet calculator runs entirely in your browser — nothing you enter is uploaded or stored on a server. It's free to use with no account required. Browse more developer tools here.
Was this tool helpful?
Related tools
Binary Translator
Convert text to binary and back, plus a decimal/hex/binary/octal converter.
Developer Tools
Hash Generator
Generate SHA-1, SHA-256, SHA-384, and SHA-512 hashes from any text, live.
Developer Tools
Regex Tester
Test regular expressions live with match highlighting, groups, and a cheat sheet.
Developer Tools
Cron Expression Explainer
Type a cron expression and get plain English — '0 9 * * 1-5' explained instantly.
Developer Tools
JSON Formatter
Format, validate, and minify JSON with precise error locations.
Developer Tools
Color Contrast Checker
Check WCAG contrast ratios between text and background colors — AA and AAA.
Developer Tools