CIDR Calculator
Calculate CIDR network ranges.
About this tool
Enter an IPv4 address in CIDR notation and get the network address, subnet mask, broadcast address, first and last usable host and the number of hosts. The address you type does not need to be the network address.
How to use
How it works
The prefix length says how many leading bits are the network part. The mask is those bits set to 1. The network address is the IP ANDed with the mask, the broadcast is the network with all host bits set to 1, and the usable hosts run from network + 1 to broadcast − 1. A /24 has 2^8 − 2 = 254 usable hosts.
usable hosts = 2^(32 − prefix) − 2
Worked example
A /28 from a host address
- Input
- 10.1.2.77/28
- Output
- { "network": "10.1.2.64", "prefix": 28, "mask": "255.255.255.240", "broadcast": "10.1.2.79", "firstHost": "10.1.2.65", "lastHost": "10.1.2.78", "hostCount": 14 }
- Walkthrough
- A /28 spans 16 addresses in blocks of 16. 77 falls in the block starting at 64, so the network is.64 and the broadcast is.79; 14 are usable.
Limitations
- IPv4 only; IPv6 prefixes are not supported.
- /31 (a point-to-point link) reports both addresses as hosts and /32 reports a single host, so the usable-host formula above applies to /30 and larger blocks.
- The prefix must be a whole number from 0 to 32, and octets with leading zeros such as 010 are rejected.
- The address is not checked for being private or public.
Questions
How many hosts are in a /24?
What is the subnet mask for /28?
How do I find the network address from an IP and prefix?
Does CIDR 10.0.0.0/8 work?
Features
- Network, broadcast, range
- Usable host count
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Learn JSON - Full Crash Course
freeCodeCamp.org
JSON is the payload format behind many developer tools here.
Watch on YouTubeWhat Is A RESTful API?
Traversy Media
API context for JWT, JSON, and encoding utilities.
Watch on YouTube
- web.dev
Google
Modern web guidance that pairs with encoding and tooling pages.
- MDN Web Docs
MDN
Primary reference for web APIs these developer tools touch.