How to use the CIDR calculator
- Type a block into CIDR block:
192.168.1.10/24, an address and dotted netmask such as10.20.30.40 255.255.255.192, or an IPv6 prefix such as2001:db8::/48. - A plain address with no prefix is read as a single host (/32 or /128).
- Read the summary: usable hosts, total addresses and netmask for IPv4, or the address count and prefix for IPv6.
- Use the table for exact boundaries, the wildcard mask and the binary view.
What it does and when to use it
Subnet maths is quick once you think in bits, but a wrong boundary can cause an overlapping VPC, a firewall rule that misses half its hosts, or a DHCP pool that hands out the broadcast address. This calculator gives the edges of a block without mental arithmetic. Use it when you size a cloud subnet, write a security-group rule, read a route table or check whether two blocks overlap.
To learn what kind of address something is (private, CGNAT, link-local, documentation), use IP Info. For practice with the binary arithmetic behind masks, try the Binary Arithmetic tool.
How it works
For IPv4 the address and mask are 32-bit numbers, as defined for CIDR in RFC 4632:
network = address AND mask
broadcast = network OR (NOT mask)
total = 2^(32 − prefix)
usable = total − 2 (except /31 = 2, /32 = 1)
A dotted mask is converted to a prefix length and must be contiguous: all 1 bits before the 0 bits. IPv6 uses the same idea on 128 bits with BigInt arithmetic. IPv6 has no broadcast address, so the tool shows first and last address, the expanded form, and how many /64 subnets fit. Everything runs in your browser.
Worked examples
A /22 for a small VPC.
Usable hosts: 1,022
Network address | 10.0.0.0
Broadcast address | 10.0.3.255
Wildcard mask | 0.0.3.255
Host range | 10.0.0.1 – 10.0.3.254
Range type | Private network
Cloud providers usually reserve a few more addresses in each subnet, so check their docs for the real count.
An address with a dotted mask. 172.16.5.130 255.255.255.224 is read as /27. The network is 172.16.5.128, the broadcast 172.16.5.159, and there are 30 usable hosts.
An IPv6 /56. fd00:1234::/56 runs to fd00:1234:0:ff:ffff:ffff:ffff:ffff, holds 4,722,366,482,869,645,213,696 addresses and splits into 256 /64 subnets, the usual size for one LAN.
Limits and tips
- Non-contiguous masks such as
255.0.255.0are rejected with a message. - Range type is worked out from the network address only. A very large block, such as 0.0.0.0/0, can span several kinds of range.
- It does not list every host in the block. For random addresses to fill test data, use the Fake IP Generator.
Frequently asked questions
Why does a /24 have 254 usable hosts, not 256?
What about /31 and /32?
What is the wildcard mask for?
Can I enter an address that is not the network address?
Does it split a block into smaller subnets?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.