CIDR and subnet calculator: ranges, merging, subtracting
An address with a mask gives the whole subnet: range, mask, wildcard, number of addresses, the next subnet, and a split into smaller ones. The same page turns IP ranges into CIDR, merges lists of networks into the shortest one, and subtracts some networks from others. IPv4 and IPv6, up to 50,000 lines.
Runs in your browser, nothing is sent
Check your connection
Links and subscriptions
Network and router
DNS and addresses
Prefix
- Network
- 192.168.1.0/24
- Address
- 192.168.1.10
- Mask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- Range
- 192.168.1.0 – 192.168.1.255
- Broadcast
- 192.168.1.255
- For devices
- 192.168.1.1 – 192.168.1.254
- Addresses
- 256
- Addresses for devices
- 254
- Next subnet
- 192.168.2.0/24
- Previous subnet
- 192.168.0.0/24
- Reverse DNS zone
- 1.168.192.in-addr.arpa
Everything is worked out in your browser: keys and addresses are not sent anywhere.
Veli shows the same from inside: Diagnostics checks your address, DNS, IPv6 and sites through the tunnel and past it. Free, no sign-up.
Download VeliReference
IPv4 masks
In /31 both addresses go to devices (RFC 3021), and /32 is one address. The table is worked out by the same code as the calculator.
| Prefix | Mask | Wildcard mask | Addresses | Addresses for devices |
|---|---|---|---|---|
| /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 |
Special ranges
These addresses aren't handed out on the internet, or they have a meaning of their own.
- 0.0.0.0/8
- “This network” RFC 791
- 10.0.0.0/8
- Private network RFC 1918
- 100.64.0.0/10
- Provider NAT (CGNAT) RFC 6598
- 127.0.0.0/8
- This device (loopback) RFC 1122
- 169.254.0.0/16
- Link-local RFC 3927
- 172.16.0.0/12
- Private network RFC 1918
- 192.0.0.0/24
- Protocol assignments RFC 6890
- 192.0.2.0/24
- For documentation RFC 5737
- 192.168.0.0/16
- Private network RFC 1918
- 198.18.0.0/15
- For network tests RFC 2544
- 198.51.100.0/24
- For documentation RFC 5737
- 203.0.113.0/24
- For documentation RFC 5737
- 224.0.0.0/4
- Multicast RFC 5771
- 240.0.0.0/4
- Reserved RFC 1112
- 255.255.255.255/32
- Broadcast RFC 919
- ::/128
- Unspecified address RFC 4291
- ::1/128
- This device (loopback) RFC 4291
- ::ffff:0:0/96
- IPv4 inside IPv6 RFC 4291
- 64:ff9b::/96
- NAT64 RFC 6052
- 100::/64
- Discard RFC 6666
- 2001:db8::/32
- For documentation RFC 3849
- 2002::/16
- 6to4 (outdated) RFC 3056
- 3fff::/20
- For documentation RFC 9637
- fc00::/7
- Private network (ULA) RFC 4193
- fe80::/10
- Link-local RFC 4291
- ff00::/8
- Multicast RFC 4291
IPv6 prefixes
One home network is a /64. How many of them fit into the prefix you were given:
- Prefix
- Networks /64
- /32
- 4 294 967 296
- /40
- 16 777 216
- /44
- 1 048 576
- /48
- 65 536
- /52
- 4 096
- /56
- 256
- /60
- 16
- /64
- 1
FAQ
What does /24 mean?
The number after the slash is how many leading bits are the network. In 192.168.1.0/24 the first 24 bits are fixed and the last 8 number the devices: 256 addresses, 254 of them for devices, because the first is the network itself and the last is the broadcast. The mask is 255.255.255.0.
How do I turn an IP range into CIDR?
Choose “Range → CIDR” and write 192.168.1.10-192.168.1.99, or 192.168.1.10-99 for the same last octet. A range that isn't a whole subnet becomes several networks: 10.0.0.1-10.0.0.10 is 10.0.0.1/32, 10.0.0.2/31, 10.0.0.4/30, 10.0.0.8/31 and 10.0.0.10/32.
How are networks merged?
Overlapping and adjacent networks become one when they form a whole block: 10.0.0.0/25 and 10.0.0.128/25 make 10.0.0.0/24. 192.168.1.0/24 and 192.168.2.0/24 are neighbours too, but no single prefix covers exactly them, so they stay two; as a range they are one line.
What is a wildcard mask?
The mask the other way round: 0 where the bit must match, 1 where any will do. /24 is 0.0.0.255. Cisco access lists and OSPF are written this way; the calculator also reads such a mask when you paste it.
Where is subtracting needed?
In AllowedIPs for WireGuard, which has no “except”: the whole internet minus the local network and the server's address. For that there is the AllowedIPs calculator on this site; here you can subtract any lists from each other.
How many addresses does an IPv6 /64 have?
2^64, about 18 quintillion: one network of one home. Providers give out /56 or /48, which are 256 or 65,536 such networks. There is no broadcast in IPv6, so every address can go to a device.