CIDR calculator for IPv4 and IPv6
Enter an address with a prefix, such as 192.168.1.0/24 or 2001:db8::/48, to get the subnet mask, the network and broadcast address, and the usable address range.
Result
- CIDR notation
- 192.168.8.0/22
- Subnet mask (netmask)
- 255.255.252.0
- Prefix mask
- —
- Wildcard mask
- 0.0.3.255
- Network address
- 192.168.8.0
- Network address (expanded)
- —
- First usable host
- 192.168.8.1
- Last usable host
- 192.168.11.254
- Broadcast address
- 192.168.11.255
- First address
- —
- Last address
- —
- Total addresses
- 1,024
- Usable hosts
- 1,022
- /64 subnets
- —
- Address range
- 192.168.8.0 – 192.168.11.255
- Address type
- Private-use (RFC 1918)
- Class (historical)
- C
- Address (compressed)
- —
- Address (expanded)
- —
- Address in hex
- 0xC0A80A25
- Address as integer
- 3232238117
- PTR record
- 37.10.168.192.in-addr.arpa
- PTR record
- —
- Reverse DNS zone
- —
Split a network into subnets
Pick a subnet size to list the subnets it produces. The one that contains your address is highlighted.
| # | Subnet | Usable hosts | Broadcast |
|---|
What CIDR is and how it is calculated
CIDR (Classless Inter-Domain Routing) is the address/prefix notation used for IP networks since 1993 and specified today in RFC 4632. It replaced the old class A, B and C networks, which came only in sizes of 16,777,216, 65,536 or 256 addresses. With CIDR a prefix can be any length: /0 to /32 for IPv4 and /0 to /128 for IPv6.
An IPv4 address has 32 bits. The prefix says how many of them, counting from the left, identify the network. The remaining bits identify a host inside that network.
Step by step: 192.168.10.37/22
- The mask has 22 one bits followed by zeros:
255.255.252.0. - Network address = IP AND mask. The host bits become 0, so
192.168.10.37becomes192.168.8.0. - The wildcard is the inverted mask,
0.0.3.255. Broadcast address = network address OR wildcard:192.168.11.255. - With 10 host bits the network has 210 = 1,024 addresses. Take away the network and broadcast addresses and 1,022 usable hosts remain.
The first usable host is the network address plus one (192.168.8.1) and the last is the broadcast address minus one (192.168.11.254).
How IPv6 prefixes work
An IPv6 address has 128 bits, written as eight groups of four hex digits. Each hex digit holds 4 bits, so a prefix that is a multiple of 4 ends exactly on a digit. That keeps addresses and reverse DNS zones readable, which is why most IPv6 plans use prefixes like /48, /56 and /64.
Step by step: 2001:db8:abcd:1234::1/56
- Expand the address:
2001:0db8:abcd:1234:0000:0000:0000:0001. - A /56 keeps the first 56 bits, which are the first 14 hex digits:
2001:0db8:abcd:12. - Fill the rest with 0 for the first address,
2001:db8:abcd:1200::, and with f for the last,2001:db8:abcd:12ff:ffff:ffff:ffff:ffff. - There are 8 bits between /56 and the /64 boundary, so this prefix holds 28 = 256 subnets of /64.
IPv6 has no broadcast address, so the last address is an ordinary one. The reverse DNS zone for this /56 is 2.1.d.c.b.a.8.b.d.0.1.0.0.2.ip6.arpa.
IPv4 CIDR chart: subnet masks and host counts
Each bit added to the prefix halves the network. The chart lists the subnet mask, wildcard mask and number of addresses for every prefix from /32 to /0.
| Prefix | Subnet mask | Wildcard | Addresses | Usable hosts |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 |
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 |
In a /31 both addresses are usable on point-to-point links (RFC 3021). A /32 is a single address.
IPv6 prefix sizes
Common IPv6 prefix lengths, how many addresses and /64 subnets they hold, and where you usually meet them.
| Prefix | Addresses | /64 subnets | Typical use |
|---|---|---|---|
| /128 | 1 | — | Single address: loopback, host route |
| /127 | 2 | — | Point-to-point link between routers (RFC 6164) |
| /124 | 16 | — | |
| /120 | 256 | — | |
| /116 | 4,096 | — | |
| /112 | 65,536 | — | |
| /108 | 1,048,576 | — | |
| /104 | 16,777,216 | — | |
| /100 | 268,435,456 | — | |
| /96 | 4,294,967,296 | — | Holds an IPv4-sized space, as NAT64 prefixes do (RFC 6052) |
| /92 | 236 | — | |
| /88 | 240 | — | |
| /84 | 244 | — | |
| /80 | 248 | — | |
| /76 | 252 | — | |
| /72 | 256 | — | |
| /68 | 260 | — | |
| /64 | 264 | 1 | One LAN or VLAN; needed for SLAAC |
| /60 | 268 | 16 | Smaller delegation some ISPs give customers |
| /56 | 272 | 256 | Common delegation to a home or small business |
| /52 | 276 | 4,096 | |
| /48 | 280 | 65,536 | Common assignment to a site or organization |
| /44 | 284 | 1,048,576 | |
| /40 | 288 | 16,777,216 | |
| /36 | 292 | 268,435,456 | |
| /32 | 296 | 4,294,967,296 | Common initial allocation to an ISP or LIR |
| /28 | 2100 | 236 | |
| /24 | 2104 | 240 | |
| /20 | 2108 | 244 | |
| /16 | 2112 | 248 | |
| /12 | 2116 | 252 | Blocks IANA allocated to the regional registries |
| /8 | 2120 | 256 | |
| /4 | 2124 | 260 | |
| /3 | 2125 | 261 | All global unicast space, 2000::/3 |
| /0 | 2128 | 264 | The whole address space; ::/0 is the default route |
Private and special-purpose address blocks
IANA reserves these blocks for specific uses, and most are not routed on the public internet. The calculator labels them automatically.
IPv4
| Block | Use | Defined in |
|---|---|---|
| 0.0.0.0/8 | This network | RFC 791 |
| 0.0.0.0/32 | This host on this network | RFC 1122 |
| 10.0.0.0/8 | Private-use | RFC 1918 |
| 100.64.0.0/10 | Shared address space (carrier-grade NAT) | RFC 6598 |
| 127.0.0.0/8 | Loopback | RFC 1122 |
| 169.254.0.0/16 | Link-local | RFC 3927 |
| 172.16.0.0/12 | Private-use | RFC 1918 |
| 192.0.0.0/24 | IETF protocol assignments | RFC 6890 |
| 192.0.0.0/29 | IPv4 service continuity prefix | RFC 7335 |
| 192.0.0.8/32 | IPv4 dummy address | RFC 7600 |
| 192.0.0.9/32 | Port Control Protocol anycast | RFC 7723 |
| 192.0.0.10/32 | TURN anycast | RFC 8155 |
| 192.0.0.170/32 | NAT64/DNS64 discovery | RFC 8880 |
| 192.0.0.171/32 | NAT64/DNS64 discovery | RFC 8880 |
| 192.0.2.0/24 | Documentation (TEST-NET-1) | RFC 5737 |
| 192.31.196.0/24 | AS112-v4 | RFC 7535 |
| 192.52.193.0/24 | AMT | RFC 7450 |
| 192.88.99.0/24 | Deprecated 6to4 relay anycast | RFC 7526 |
| 192.88.99.2/32 | 6a44 relay anycast | RFC 6751 |
| 192.168.0.0/16 | Private-use | RFC 1918 |
| 192.175.48.0/24 | AS112 direct delegation | RFC 7534 |
| 198.18.0.0/15 | Benchmarking | RFC 2544 |
| 198.51.100.0/24 | Documentation (TEST-NET-2) | RFC 5737 |
| 203.0.113.0/24 | Documentation (TEST-NET-3) | RFC 5737 |
| 224.0.0.0/4 | Multicast | RFC 5771 |
| 240.0.0.0/4 | Reserved for future use | RFC 1112 |
| 255.255.255.255/32 | Limited broadcast | RFC 919 |
IPv6
| Block | Use | Defined in |
|---|---|---|
| ::/128 | Unspecified address | RFC 4291 |
| ::1/128 | Loopback | RFC 4291 |
| ::ffff:0:0/96 | IPv4-mapped | RFC 4291 |
| 64:ff9b::/96 | IPv4/IPv6 translation (NAT64) | RFC 6052 |
| 64:ff9b:1::/48 | Local-use IPv4/IPv6 translation | RFC 8215 |
| 100::/64 | Discard-only | RFC 6666 |
| 100:0:0:1::/64 | Dummy IPv6 prefix | RFC 9780 |
| 2000::/3 | Global unicast | RFC 4291 |
| 2001::/23 | IETF protocol assignments | RFC 2928 |
| 2001::/32 | Teredo | RFC 4380 |
| 2001:1::1/128 | Port Control Protocol anycast | RFC 7723 |
| 2001:1::2/128 | TURN anycast | RFC 8155 |
| 2001:1::3/128 | DNS-SD Service Registration Protocol anycast | RFC 9665 |
| 2001:2::/48 | Benchmarking | RFC 5180 |
| 2001:3::/32 | AMT | RFC 7450 |
| 2001:4:112::/48 | AS112-v6 | RFC 7535 |
| 2001:10::/28 | Deprecated, formerly ORCHID | RFC 4843 |
| 2001:20::/28 | ORCHIDv2 | RFC 7343 |
| 2001:30::/28 | Drone Remote ID entity tags (DETs) | RFC 9374 |
| 2001:db8::/32 | Documentation | RFC 3849 |
| 2002::/16 | 6to4 | RFC 3056 |
| 2620:4f:8000::/48 | AS112 direct delegation | RFC 7534 |
| 3fff::/20 | Documentation | RFC 9637 |
| 5f00::/16 | Segment Routing (SRv6) SIDs | RFC 9602 |
| fc00::/7 | Unique local (ULA) | RFC 4193 |
| fe80::/10 | Link-local | RFC 4291 |
| fec0::/10 | Site-local, deprecated | RFC 3879 |
| ff00::/8 | Multicast | RFC 4291 |
Frequently asked questions
What does /24 mean in an IP address?
It means the first 24 bits of the address identify the network. The matching subnet mask is 255.255.255.0, and the network has 256 addresses, 254 of which can be assigned to hosts.
How many hosts fit in a subnet?
For IPv4, 2 to the power of (32 minus the prefix), minus two: the network address and the broadcast address. A /26 has 64 addresses and 62 hosts, and a /30 has 4 addresses and 2 hosts.
What is the difference between a subnet mask and a wildcard mask?
A wildcard mask is the subnet mask inverted: every 1 bit becomes 0 and every 0 bit becomes 1. The mask 255.255.255.0 has the wildcard 0.0.0.255. Wildcard masks are used in Cisco ACLs and OSPF configuration.
Why does a /31 have two usable hosts?
RFC 3021 allows both addresses of a /31 to be used on point-to-point links, where no broadcast address is needed. This saves addresses on links between routers. The IPv6 equivalent is a /127 (RFC 6164).
Which IP addresses are private?
In IPv4: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918). The IPv6 counterpart is unique local addresses in fc00::/7; in practice fd00::/8 with a random 40-bit global ID (RFC 4193). None of these are routed on the public internet.
Why is /64 the standard IPv6 subnet size?
IPv6 hosts use the last 64 bits of the address as their interface identifier, and stateless address autoconfiguration (SLAAC) needs a /64 to work. That is why a LAN gets a /64 even though it holds 2⁶⁴ addresses, and why providers delegate larger prefixes such as a /56 or a /48 to customers.
Does IPv6 have a broadcast address?
No. IPv6 replaces broadcast with multicast, such as ff02::1 for all nodes on a link, so the last address of a prefix is an ordinary address. The first one, with an all-zero interface identifier, is the Subnet-Router anycast address (RFC 4291), so it is normally not assigned to a host.
How is an IPv6 address shortened?
RFC 5952 sets the rules: drop leading zeros in each group, replace the longest run of two or more all-zero groups with "::" (once), and write hex digits in lowercase. So 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. The calculator accepts any valid form and shows both the short and the expanded one.
Can I enter a subnet mask instead of a prefix?
Yes, for IPv4: 192.168.1.0/255.255.255.0 or 192.168.1.0 255.255.255.0. The calculator converts the mask to a prefix and checks that its 1 bits are contiguous. Cisco-style wildcard masks such as 0.0.0.255 work too. IPv6 always uses a prefix length.
Is anything I type sent anywhere?
No. The calculator runs entirely in your browser. After the page loads it makes no network requests and sets no cookies. You can confirm this in the Network tab of your browser's developer tools.