Free tool · IPv4
Subnet calculator
CIDR, netmask, hosts.
Enter an IPv4 address with a prefix or a netmask to get the network and broadcast address, the usable host range and the wildcard mask. It all runs in your browser.
FreeNo sign-upNothing stored
Result
192.168.1.0/24 subnet
- Network address
- 192.168.1.0
- Broadcast address
- 192.168.1.255
- First usable host
- 192.168.1.1
- Last usable host
- 192.168.1.254
- Usable hosts
- 254
- Total addresses
- 256
- Netmask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- CIDR notation
- 192.168.1.0/24
- Address type
- Private network (RFC 1918) · 192.168.0.0/16
- Address class
- Class C
- As integer / hex
- 3232235786 · 0xC0A8010A
- Reverse DNS zone
- 1.168.192.in-addr.arpa
- Entered address
- 192.168.1.10
Binary view
The first 24 bits are the network part, the remaining 8 bits (highlighted) number the hosts.
| Address | 11000000.10101000.00000001.00001010 | 192.168.1.10 |
|---|---|---|
| Netmask | 11111111.11111111.11111111.00000000 | 255.255.255.0 |
| Network | 11000000.10101000.00000001.00000000 | 192.168.1.0 |
| Broadcast | 11000000.10101000.00000001.11111111 | 192.168.1.255 |
Netmask ⇄ prefix converter
Type a prefix (/27), a netmask (255.255.255.224) or a wildcard mask (0.0.0.31).
- Prefix
- /29
- Netmask
- 255.255.255.248
- Wildcard
- 0.0.0.7
- Usable hosts
- 6
8 addresses in total per /29 block.
Reference
CIDR to netmask table, /8 to /32
Every prefix with its netmask, wildcard mask and size. Link to a row with its anchor, for example #cidr-24.
| Prefix | Netmask | Wildcard | Addresses | Usable hosts | Typical use |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | Large private block (10.0.0.0/8) |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 | |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 | |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 | |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 | Private block 172.16.0.0/12 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 | |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 | |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 | |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | Campus or VPC network |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | Large office or cloud subnet |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | Big LAN, Wi-Fi network |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | Typical LAN or VLAN |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | Department, small VLAN |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | Small office |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | Server or DMZ segment |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | Small static IP block |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | Point-to-point (classic) |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 | Point-to-point (RFC 3021) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | Single host route |
02Guide
How to use the subnet calculator
Type an IPv4 address and either a prefix length such as /24 or a dotted netmask such as 255.255.255.0. You can also paste CIDR notation like 10.20.30.40/22 straight into the address field. The summary next to the form updates while you type; Calculate takes you to the full breakdown with the binary view.
Every result is computed in your browser. Nothing you enter is sent anywhere, so it is safe to use with internal address plans. Share a result by copying the address bar after you press Calculate: the network is kept in the link.
What CIDR notation means
An IPv4 address is 32 bits, written as four decimal numbers from 0 to 255. Classless Inter-Domain Routing (CIDR, RFC 4632) splits those bits into a network part and a host part, and the number after the slash says how many bits belong to the network. In 192.168.1.10/24 the first 24 bits (192.168.1) identify the network and the last 8 bits number the hosts inside it.
Before CIDR, networks came in fixed classes: A (/8), B (/16) and C (/24). Classes wasted space, because an organisation needing 300 addresses had to take a whole class B of 65,536. CIDR allows any prefix length, which is why routing tables, firewall rules and cloud consoles all speak in prefixes today. The class is still shown in the result because older documentation and some exams use it.
Network, broadcast and usable hosts
A subnet of prefix n holds 2^(32 − n) addresses. The first one, with all host bits set to 0, is the network address that names the subnet in routing tables. The last one, with all host bits set to 1, is the broadcast address that reaches every host on the segment. Neither can be given to a device, so a classic subnet has 2^(32 − n) − 2 usable hosts: 254 in a /24, 62 in a /26, 6 in a /29.
Two prefixes break that rule. A /31 has only two addresses, and RFC 3021 lets routers use both on a point-to-point link because such a link needs no broadcast. Most modern router and firewall software supports it, and it halves the addresses spent on transit links compared with a /30. A /32 is a single address: it describes one host, a loopback interface, an anycast service or a firewall rule for exactly one IP.
Netmask, wildcard mask and prefix length
A netmask writes the prefix as an address: n one-bits followed by zeros. /24 is 255.255.255.0, /20 is 255.255.240.0 and /29 is 255.255.255.248. A valid netmask always has its ones on the left and its zeros on the right; a value like 255.0.255.0 is not a netmask, and the calculator says so. To convert a mask to a prefix by hand, count the one-bits: 255 counts 8, 254 counts 7, 252 counts 6, 248 counts 5, 240 counts 4, 224 counts 3, 192 counts 2 and 128 counts 1. What is a subnet mask? walks through the binary AND and has the full /0 to /32 cheat sheet.
A wildcard mask is the inverse: zeros for the network bits, ones for the host bits, so /24 becomes 0.0.0.255. Cisco access lists and OSPF network statements use it. The converter under the result turns any of the three forms into the other two.
Common subnet sizes
- /24 subnet: mask 255.255.255.0, 256 addresses, 254 usable. The default size for a home or office LAN and a VLAN.
- /29 subnet mask: 255.255.255.248, 8 addresses, 6 usable. A typical block of static public IPs from an ISP; one address usually goes to the provider's gateway.
- /30: 255.255.255.252, 2 usable. The traditional size for a point-to-point link, now often replaced by a /31.
- /16: 255.255.0.0, 65,534 usable. Common as the outer range of a cloud VPC, which is then cut into /20 or /24 subnets.
- /22: 255.255.252.0, 1,022 usable. Large Wi-Fi or campus networks where a /24 runs out.
Private, CGNAT and other special ranges
Some ranges never appear on the public internet. RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks. 100.64.0.0/10 is shared address space for carrier-grade NAT (RFC 6598): an address from it on your router's WAN side means your provider shares one public IP between many customers. 127.0.0.0/8 is loopback, 169.254.0.0/16 is link-local (what a device assigns itself when DHCP fails), 224.0.0.0/4 is multicast, and 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are reserved for documentation.
The calculator labels each of these in the result, and private IP address ranges lists the special-purpose blocks with the RFC that defines each. To see who a public address belongs to, use the IP & ASN lookup; to see which addresses a domain points to, use the DNS lookup. For how address blocks are routed between networks, see what BGP is.
04More free tools
Check the rest of the stack.
IP & ASN lookup
Which network (ASN), organisation and country an IPv4 or IPv6 address belongs to, starting with yours.DNS lookup
A, AAAA, CNAME, MX, NS, TXT, CAA and SOA records for any domain, straight from public resolvers.Bandwidth to PPS calculator
Bit rate to packets per second and back for any frame size, with line-rate overhead and a 95th percentile calculator.Tunnel MTU & MSS calculator
Stack GRE, WireGuard, VXLAN, IPIP, PPPoE or IPsec and get the tunnel MTU, both MSS values and ready-to-paste clamp rules.Get started
Put a WAF, CDN and unmetered DDoS protection
in front of your site.
Point your DNS at GuardX and traffic is filtered at the edge before it reaches your server. Flat pricing, no surcharge while an attack runs.
