Subnet calculator (CIDR)
Enter an address with a prefix or a netmask. You get the network range in decimal and binary, and below it you can practise subnetting.
The tool could not be loaded. Check your connection and reload the page.
Network bits in teal, host bits in yellow.
Subnetting practice
Random exam-style questions. Work them out in your head or on paper; checking and the solution are instant.
How it works
An IPv4 address is a 32-bit number. The prefix /26 says the first 26 bits belong to the network and the remaining 6 to hosts. The network address is the address with the host bits set to zero (a bitwise AND with the mask), the broadcast has them all set to one.
The number of usable addresses is 2 to the power of the host bits minus two (network and broadcast). The exceptions are /31 for links between two routers (2 addresses, RFC 3021) and /32 for a single address.
The calculator also recognises special ranges: RFC 1918 private networks, the shared carrier-grade NAT space (100.64.0.0/10), loopback, link-local and documentation addresses.
For IPv6 it shows the compressed and full notation per RFC 5952, the prefix range and the address type.
When it helps
- You plan addresses for a VLAN, an office or a cloud network (VPC).
- You prepare for an exam or a certification such as CCNA.
- You review firewall rules and access lists.
- You need to turn the mask 255.255.252.0 into a prefix quickly.
Frequently asked questions
// 01 Which prefix do I need for 50 devices?
/26. It gives 64 addresses, 62 of them usable. A /27 would only fit 30 devices.
// 02 Why can't the network and broadcast addresses be assigned?
The network address names the whole network and the broadcast reaches every device in it. Devices get the addresses in between.
// 03 What is a wildcard mask?
An inverted mask with ones in the host bits. Cisco ACLs and OSPF use it: the mask 255.255.255.192 has the wildcard 0.0.0.63.
You may also need
Did this save you time?
The tools and simulations are free, ad-free and need no sign-up. If they helped you, you can send a contribution for coffee and new tools.
Donate via PayPalWhat happens to your data
Privacy policy (in Czech)- The tools process your input with JavaScript on your device. Nothing you paste is sent to the server, stored or logged.
- The exception is the SPF/DKIM/DMARC check: it asks public DNS (Cloudflare, Google as a fallback) directly from your browser. Only the domain name is sent.
- Analytics (only if you accept analytics cookies) records anonymous events such as "a tool was opened". Never your input or results.
- No ads or advertising scripts run on the tool and simulation pages.
Need a hand?
I build and maintain web applications in Laravel and PHP. If something on these pages is giving you trouble in a project, get in touch.
Get in touch