CIDR Calculator
Convert CIDR notation into network address, subnet mask, broadcast address and usable host count.
About CIDR Calculator
CIDR (Classless Inter-Domain Routing) notation combines an IP address with a prefix length that states how many leading bits form the network portion. The remaining bits identify hosts within that network. The network address is found by ANDing the IP with the mask derived from the prefix, and the broadcast address is the network ORed with the inverse mask. Usable hosts are the total addresses in the block minus the network and broadcast addresses (2^(32−prefix) − 2), except for the /31 point-to-point (RFC 3021) and /32 host-route special cases.
Formula
Usable hosts from prefix
hosts = 2^(32 − prefix) − 2
- p
- CIDR prefix length (0–32)
Worked example
With the default values below, CIDR Calculator returns CIDR Block of 192.168.1.0/24. Change any input above and every figure here is recalculated in your browser.
Inputs used
- IPv4 Address
- 192.168.1.0
- CIDR Prefixaccepts 0–32 /
- 24 /
Results
- CIDR Block
- 192.168.1.0/24
- Network Address
- 192.168.1.0
- Broadcast Address
- 192.168.1.255
- Usable Host Range
- 192.168.1.1 – 192.168.1.254
- Subnet Mask
- 255.255.255.0
- Total Addresses
- 256
- Usable Hosts
- 254
Step by step
- 1Values used
- 2Usable hosts from prefix
- 3CIDR Block= 192.168.1.0/24
- 4Network Address= 192.168.1.0
- 5Broadcast Address= 192.168.1.255
- 6Usable Host Range= 192.168.1.1 – 192.168.1.254
- 7Subnet Mask= 255.255.255.0
- 8Total Addresses= 256
Assumptions and limits
- The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Guides that use this calculator
Frequently Asked Questions
What is CIDR notation?
CIDR notation writes an IP address followed by a slash and a number (e.g. 192.168.1.0/24), where the number is the count of leading bits that make up the network portion of the address.
How is the number of usable hosts calculated?
Usable hosts = 2^(32 − prefix) − 2. The subtraction removes the network address and the broadcast address, which cannot be assigned to hosts. /31 subnets (point-to-point links) and /32 (single host) are exceptions per RFC 3021.
Why does a smaller prefix mean a bigger network?
The prefix counts network bits; fewer network bits leaves more host bits, which doubles the address space for every bit removed. A /23 has twice the addresses of a /24.
Does the entered IP need to be the network address?
No — any address inside the block works. The calculator ANDs your address with the derived mask to find the actual network address for you.
