/cidr CIDR / Subnet Calculator
Give it a CIDR block and get the whole picture back — network and broadcast addresses, netmask and wildcard, the usable host range and the address count.
curl curlhub.sh/cidr/10.0.0.0/24
Usage
With curl
curl curlhub.sh/cidr/10.0.0.0/24
curl "curlhub.sh/cidr?cidr=192.168.1.0/26"
With the CLI
curlhub cidr/10.0.0.0/24
Structured output for scripts
curl -s curlhub.sh/cidr/10.0.0.0/24 -H 'Accept: application/json'
Output
curl curlhub.sh/cidr/10.0.0.0/24
CIDR 10.0.0.0/24
Netmask 255.255.255.0 = /24
Wildcard 0.0.0.255
Network 10.0.0.0
Broadcast 10.0.0.255
First host 10.0.0.1
Last host 10.0.0.254
Usable hosts 254
Total addrs 256
Parameters
| Input | What it does |
|---|---|
/{ip}/{bits} | The block as path segments — curlhub.sh/cidr/10.0.0.0/24. |
?cidr= | The block as a single query parameter. |
Accept: application/json | Return every field as JSON for scripting. |
Recipes
Size a subnet before you cut it
curl -s curlhub.sh/cidr/10.0.0.0/22 | grep Usable
Find the broadcast address
curlhub cidr/192.168.1.0/26 | grep Broadcast