Subnet Calculator
This free subnet and CIDR calculator takes an IP address with a prefix or netmask and instantly shows the network address, broadcast, usable host range, host count, wildcard mask and binary breakdown. It handles IPv4 and IPv6, splits IPv4 networks into equal subnets and converts IPv4 ranges to CIDR blocks, all calculated in your browser.
Tip: you can type the whole thing in the address box, e.g. 10.0.0.0/8 or 172.16.5.4 255.255.240.0.
192.168.1.0/24
private- 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 host range
- 192.168.1.1 – 192.168.1.254
- Total addresses
- 256
- Usable hosts
- 254
- Netmask
- 255.255.255.0
- Wildcard (Cisco ACL)
- 0.0.0.255
- CIDR notation
- 192.168.1.0/24
- Class (historic)
- C
- Address type
- Private network (RFC 1918)
Binary view
| Address | 11000000.10101000.00000001.00001010 |
|---|---|
| Netmask | 11111111.11111111.11111111.00000000 |
| Wildcard | 00000000.00000000.00000000.11111111 |
| Network | 11000000.10101000.00000001.00000000 |
| Broadcast | 11000000.10101000.00000001.11111111 |
Teal bits are the network part (/24); the rest identify hosts.
Split into subnets
4 × /26 — 62 usable hosts each
| # | Subnet | Usable range | Broadcast |
|---|---|---|---|
| 1 | 192.168.1.0/26 | 192.168.1.1 – 192.168.1.62 | 192.168.1.63 |
| 2 | 192.168.1.64/26 | 192.168.1.65 – 192.168.1.126 | 192.168.1.127 |
| 3 | 192.168.1.128/26 | 192.168.1.129 – 192.168.1.190 | 192.168.1.191 |
| 4 | 192.168.1.192/26 | 192.168.1.193 – 192.168.1.254 | 192.168.1.255 |
How to calculate a subnet
- Enter an address. Type an IPv4 address such as 192.168.1.10, or a full CIDR like 10.0.0.0/8 or 172.16.5.4 255.255.240.0. Switch to the IPv6 tab for addresses like 2001:db8::1.
- Set the prefix or netmask. Enter a prefix length (/24) or a dotted netmask (255.255.255.0). For IPv6, enter a prefix from /0 to /128, typically /48, /56 or /64.
- Read the results. The network address, broadcast, first and last usable host, host count, netmask, wildcard mask, class and address type update as you type, with a colour-coded binary view.
- Split or convert. On the IPv4 tab, enter a number of subnets to split the network into equal blocks, or use the Range → CIDR tab to turn a start and end IPv4 address into the smallest list of CIDR blocks. Copy any value with one click.
CIDR cheat sheet: /8 to /32
Every prefix length with its netmask, wildcard mask and size. Usable hosts are the total minus the network and broadcast addresses, except /31 (point-to-point, RFC 3021) and /32 (a single host).
| CIDR | Netmask | Wildcard | Addresses | Usable hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /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 |
| /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 |
| /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 |
| /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 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
Subnetting basics: network, broadcast and hosts
An IPv4 address is 32 bits. The prefix length says how many of those bits, counted from the left, identify the network; the remaining bits identify a host on it. In 192.168.1.130/26 the first 26 bits are the network, which leaves 6 host bits and 26 = 64 addresses.
- Network address — all host bits 0 (
192.168.1.128). It names the subnet and is not assigned to a device. - Broadcast address — all host bits 1 (
192.168.1.191). Packets sent here reach every host on the subnet. - Usable hosts — everything in between (
.129–.190, 62 hosts). The gateway is usually the first or last one.
Splitting a network borrows host bits: each extra bit doubles the number of subnets and halves their size. A /24 split into 4 gives four /26 networks; asking for 3 also gives /26, because subnets only come in powers of two.
IPv6 prefixes in practice
IPv6 addresses are 128 bits, written as eight groups of four hex digits. Leading zeros in a group can be dropped and one run of zero groups can be replaced by ::, so 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. The calculator shows both forms, using the RFC 5952 canonical compression.
Common sizes: a /64 is one LAN segment; a /56 (256 × /64) is a typical home allocation; a /48 (65,536 × /64) is a typical business site; and point-to-point links often use a /127. Address types are detected automatically: global unicast (2000::/3), unique local (fc00::/7), link-local (fe80::/10), multicast (ff00::/8), documentation (2001:db8::/32) and more.
Related tools
Frequently Asked Questions
How do I calculate a subnet from an IP address and CIDR?↓
Convert the prefix to a netmask (a /26 is 26 one-bits: 255.255.255.192), then AND it with the IP address to get the network address. Setting all host bits to 1 gives the broadcast address, and the usable hosts are everything in between. The calculator does this instantly: enter 192.168.1.130/26 and you get network 192.168.1.128, broadcast 192.168.1.191 and hosts .129 to .190.
How many usable hosts are in a /24, /27 or /30?↓
A subnet has 2^(32 − prefix) addresses, minus 2 for the network and broadcast addresses. So a /24 has 256 addresses and 254 usable hosts, a /27 has 32 and 30 usable, and a /30 has 4 and 2 usable. A /31 is a special case with 2 usable addresses for point-to-point links (RFC 3021), and a /32 is a single host.
What is a wildcard mask?↓
A wildcard mask is the inverse of the netmask: every 0 becomes 1 and every 1 becomes 0. For 255.255.255.0 the wildcard is 0.0.0.255. Cisco access lists and OSPF network statements use wildcard masks to say which bits of an address may vary.
Which IP addresses are private?↓
The RFC 1918 private ranges are 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16. 100.64.0.0/10 is shared address space for carrier-grade NAT. In IPv6, unique local addresses (fc00::/7, in practice fd00::/8) play the role of private addresses. The calculator labels each address as private, public, reserved or special.
Why is a /64 the standard IPv6 subnet size?↓
IPv6 stateless address autoconfiguration (SLAAC) builds a device's address from a 64-bit interface identifier, so LAN subnets are /64. ISPs typically delegate a /48 or /56 to a site: a /48 contains 65,536 /64 subnets and a /56 contains 256. The calculator shows the /64 count for any prefix.
How do I convert an IP range to CIDR?↓
Open the Range → CIDR tab and enter the first and last IPv4 address. The tool returns the smallest set of CIDR blocks that covers exactly that range — for example 10.0.0.1 to 10.0.0.6 becomes 10.0.0.1/32, 10.0.0.2/31, 10.0.0.4/31 and 10.0.0.6/32 — ready to paste into a firewall rule.
Last updated: