Subnet Calculator
Type an IPv4 address with a prefix such as 192.168.1.10/24, or with a mask such as 255.255.255.0, and see the network address, broadcast address, first and last usable host, subnet and wildcard masks, number of hosts and the binary form. You can also split a block into smaller subnets or find the smallest block for a number of hosts. Everything runs in your browser.
| Address | 11000000.10101000.00000001.00001010 | 192.168.1.10 |
|---|---|---|
| Mask | 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 |
Split this block into smaller subnets
4 subnets of /26, each with 64 addresses and 62 usable hosts.
| Subnet | First host | Last host | Broadcast |
|---|---|---|---|
| 192.168.1.0/26 | 192.168.1.1 | 192.168.1.62 | 192.168.1.63 |
| 192.168.1.64/26 | 192.168.1.65 | 192.168.1.126 | 192.168.1.127 |
| 192.168.1.128/26 | 192.168.1.129 | 192.168.1.190 | 192.168.1.191 |
| 192.168.1.192/26 | 192.168.1.193 | 192.168.1.254 | 192.168.1.255 |
Find the size for a number of hosts
The network address is the address with all host bits set to 0, and the broadcast address has them all set to 1. Usable hosts are the addresses between them, so a block has 2 fewer than its total, except a /31 (both addresses are hosts on a point-to-point link, RFC 3021) and a /32 (one address). This tool handles IPv4 only. The address type uses the private and special ranges in RFC 1918 and RFC 6890. Everything is worked out in your browser and nothing is uploaded.
Related Tools
[5 suggestions]Number Base Converter
Convert whole numbers between binary, octal, decimal, hex and any base from 2 to 36, with two's complement.
Developer & WebChmod Calculator
Work out Unix file permissions: tick boxes, or type octal, an ls -l string or a symbolic change, and get the chmod command.
Developer & WebURL Parser and Query Editor
Split a URL into scheme, host, path, query parameters and fragment, then edit the parameters and rebuild the link.
Developer & WebHTTP Status Code Lookup
Search every HTTP status code by number or by words, with its name, what it means, when a server sends it and the standard that defines it.
Developer & WebRegex Tester
Test regular expressions against a string, highlight matches, and inspect capture groups.
Developer & WebAbout the Subnet Calculator
An IPv4 address is 32 bits, and the prefix length says how many of the leading bits name the network. The rest name the host. A /24 keeps 24 bits for the network and leaves 8 for hosts, so it has 256 addresses. The network address is the block with every host bit set to 0, and the broadcast address has them all set to 1. The addresses between them are the usable hosts, so a block has 2 fewer usable hosts than addresses. A /31 is the exception: RFC 3021 lets both of its addresses be hosts on a point-to-point link. A /32 is a single address. The subnet mask is the prefix written as four numbers, with ones for the network bits, and the wildcard mask is its opposite, which access lists on some routers use. You can type the block with a prefix or with a mask, and a mask that is not a run of ones followed by zeros is refused. The address type comes from the private ranges in RFC 1918 and the special ranges in RFC 6890. The class (A to E) is the old classful range of the first byte and is shown only for reference, because modern networks use prefixes. The tool covers IPv4 only. The conversion between prefix length and mask was checked for every length from 0 to 32. Nothing is uploaded.
What does /24 mean in an IP address?▾
It is the prefix length: the first 24 bits of the address identify the network and the last 8 identify the host. In mask form that is 255.255.255.0. A /24 holds 256 addresses, of which 254 are usable by hosts.
How do I calculate the number of usable hosts?▾
Take 2 to the power of (32 minus the prefix), then subtract 2 for the network and broadcast addresses. A /26 has 2 to the power of 6, which is 64 addresses, so 62 usable hosts. A /31 and a /32 are special cases with 2 and 1 usable addresses.
What is the difference between a subnet mask and a wildcard mask?▾
The wildcard mask is the subnet mask with every bit flipped. For 255.255.255.0 it is 0.0.0.255. A subnet mask marks the network bits with ones. A wildcard mask marks the bits that may vary, and some router access lists use it.
How do I split a network into smaller subnets?▾
Raise the prefix length. Each extra bit doubles the number of subnets and halves their size, so a /24 split to /26 gives 4 subnets of 64 addresses. Enter the new prefix in the split section and the tool lists them with their host ranges.
Does it work for IPv6, and is my data uploaded?▾
It works for IPv4 only. IPv6 addresses are 128 bits and are usually divided on /64 boundaries, which needs a different layout. The calculation runs in your browser and nothing you type is sent anywhere.