CIDR Subnet Calculator
CIDR subnet calculator with membership checks
What is CIDR Subnet Calculator?
A CIDR calculator takes a network in prefix notation and returns the network address, subnet mask, broadcast address, usable host range, and total address count, then tells you whether a given IP falls inside that block. Everything is computed locally in your browser.
How to use CIDR Subnet Calculator
- 1Enter a network in CIDR notation, such as 192.168.16.0/20.
- 2Review the network address, subnet mask, broadcast address, and usable host range.
- 3Enter an IP address below to instantly check whether it belongs to the block.
How do I do this in code?
Use the tool above for one-off work; for anything you repeat, move it into a script or your project.
# Requires ipcalc or sipcalc
ipcalc 192.168.16.0/20
# Python standard library
python3 -c "import ipaddress;n=ipaddress.ip_network('192.168.16.0/20');print(n.network_address,n.broadcast_address,n.num_addresses)"Frequently asked questions
Why is the usable host count 2 less than the total?+
The first address in every block is the network address and the last one is the broadcast address, so neither can be assigned to a host. The exceptions are /31, which RFC 3021 reserves for point-to-point links, and /32, a single host; no addresses are subtracted in those two cases.
How many addresses are in a /20?+
A 20-bit prefix leaves 12 host bits, which works out to 4,096 addresses and 4,094 usable hosts, the equivalent of sixteen /24 networks. When planning internal ranges, round up to the next prefix that covers your expected host count so you keep room to grow without wasting a large block.
Related tools
All toolsHTTP Status Codes
HTTP status code reference with likely causes and where to look
URL Parser
Break a URL into its components and query parameters
MIME Type Lookup
MIME type and file extension reference
User Agent Parser
Parse a User-Agent string into browser and OS details
HTTP Header Analyzer
Inspect response headers and security header coverage
DNS Lookup
DNS record lookup across 8 record types