IP Subnet Calculator
- Updated
- Formula shown
- Free, no sign-up
Results
192.168.1.10/24: network 192.168.1.0/24, 254 usable hosts
| Decimal | Binary | |
|---|---|---|
| Address | 192.168.1.10 | 11000000.10101000.00000001 | 00001010 |
| Subnet mask | 255.255.255.0 | 11111111.11111111.11111111 | 00000000 |
| Network | 192.168.1.0 | 11000000.10101000.00000001 | 00000000 |
| Broadcast | 192.168.1.255 | 11000000.10101000.00000001 | 11111111 |
How to use the IP subnet calculator
- Choose IPv4 subnet details, splitting a network, or IPv6.
- Type the address. For IPv4, give the prefix length (such as 24) or the mask (such as 255.255.255.0), or type both together as CIDR, like 10.0.0.0/8.
- To split a network, enter how many subnets you need. The calculator rounds up to the next power of 2 and lists every subnet.
- For IPv6, enter the address in any valid form and the prefix length, usually 64 for a LAN or 48 or 56 for a site.
Subnet formulas
network = address AND mask broadcast = network OR (NOT mask)
usable hosts = 2^(32 − prefix) − 2 (2 for /31, 1 for /32)
An IPv4 address is a 32-bit number. The prefix length says how many of the leading bits name the network; the remaining bits number the hosts inside it. A bitwise AND with the mask clears the host bits and gives the network address, and setting all the host bits to 1 gives the broadcast address. Those two are normally reserved, so a subnet with h host bits has 2h − 2 usable addresses. There are two exceptions: RFC 3021 lets both addresses of a /31 be used on point-to-point links, and a /32 names a single host. The wildcard mask, used by Cisco ACLs and OSPF, is the mask with every bit flipped.
Worked example: 192.168.10.77/26
A /26 mask is 255.255.255.192: 26 ones, then 6 zeros. In binary the address is 11000000.10101000.00001010.01 | 001101, where the bar marks the end of the
network bits. Clearing the 6 host bits gives the network 192.168.10.64, and setting them gives the broadcast
192.168.10.127. Hosts run from 192.168.10.65 to 192.168.10.126: 2⁶ − 2 = 62 usable addresses. The
wildcard mask is 0.0.0.63.
Splitting 10.0.0.0/24 into 4 equal subnets borrows 2 bits, giving four /26 networks: 10.0.0.0, 10.0.0.64, 10.0.0.128, 10.0.0.192, each with 62 usable hosts.
CIDR and subnet mask table
| Prefix | Subnet mask | Wildcard | Addresses | Usable hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /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 (RFC 3021) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
Special IPv4 address ranges
The calculator labels each address using the IANA special-purpose registry. Everything else is public, globally routable address space.
| Range | Use | Defined in |
|---|---|---|
| 255.255.255.255/32 | Limited broadcast | RFC 919 |
| 0.0.0.0/8 | "This network" (not a usable destination) | RFC 791 |
| 10.0.0.0/8 | Private | 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 | RFC 1918 |
| 192.0.0.0/24 | IETF protocol assignments | RFC 6890 |
| 192.0.2.0/24 | Documentation (TEST-NET-1) | RFC 5737 |
| 192.88.99.0/24 | Former 6to4 relay anycast (deprecated) | RFC 7526 |
| 192.168.0.0/16 | Private | RFC 1918 |
| 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 |
IPv6 prefixes
IPv6 addresses are 128 bits, written as eight groups of four hex digits. RFC 5952 sets one canonical short form: lowercase, no leading zeros, and the longest run of zero groups replaced by ::. For example 2001:0db8:abcd:0012:0000:0000:0000:0001 is written 2001:db8:abcd:12::1. Its /64 network is 2001:db8:abcd:12::/64, running to 2001:db8:abcd:12:ffff:ffff:ffff:ffff: 18,446,744,073,709,551,616 addresses. Because the numbers are this large, the calculator works with exact 128-bit integers rather than floating point.
Tips
- Plan for growth. A /24 gives 254 hosts; if a segment might pass 100 devices, don't size it at /25.
- Private ranges for internal networks. Use 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 (RFC 1918). 100.64.0.0/10 is reserved for carrier-grade NAT, not for home or office LANs.
- Documentation examples. Use 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 and 2001:db8::/32 in guides, so examples never point at a real network.
Planning how fast data moves across the network? The bandwidth calculator works out download times, and the binary calculator and hex calculator help with the bit arithmetic.
Sources
- RFC 4632 (CIDR), RFC 3021 (31-bit prefixes on point-to-point links), RFC 1918 (private addresses), RFC 6598 (shared address space), RFC 6890 and the IANA IPv4 and IPv6 Special-Purpose Address Registries.
- RFC 4291 (IPv6 addressing architecture), RFC 5952 (IPv6 text representation), RFC 4193 (unique local addresses), RFC 3849 (IPv6 documentation prefix).
Frequently asked questions
How many usable hosts are in a /24?
254. A /24 has 2⁸ = 256 addresses; the first (the network address) and the last (the broadcast address) are reserved, leaving 254. For example, 192.168.1.0/24 has hosts 192.168.1.1 to 192.168.1.254 and broadcast 192.168.1.255.
How do I find the network address?
Do a bitwise AND of the address and the subnet mask, which clears the host bits. 192.168.10.77 with mask 255.255.255.192 (/26) gives 192.168.10.64; setting the 6 host bits instead gives the broadcast address 192.168.10.127.
Why does a /31 have two usable addresses?
RFC 3021 allows 31-bit prefixes on point-to-point links, where a broadcast address is not needed, so both addresses can be assigned to the two ends of the link. A /32 is a single address, used for host routes and loopback interfaces.
What is a wildcard mask?
The subnet mask with every bit inverted: 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF use it to say which bits of an address must match (0) and which may vary (1).
How many addresses are in an IPv6 /64?
2⁶⁴ = 18,446,744,073,709,551,616. A /64 is the standard size for one IPv6 LAN, and a /48, often assigned to a site, holds 65,536 of them. The calculator works with exact 128-bit integers for these counts.