Subnet calculator
Type an address with a prefix, a mask or a wildcard. You get the network, broadcast, host range and the binary behind them, plus subnet splitting, a VLSM planner and IPv6 prefixes. Everything is worked out in your browser; nothing you type is sent anywhere.
Accepts 192.168.1.77/24, 192.168.1.77 255.255.255.0, 192.168.1.77 0.0.0.255, a bare address, or an IPv6 prefix like 2001:db8::/48.
Result
- Network address
- 192.168.1.0/24
- Broadcast address
- 192.168.1.255
- Subnet mask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- First usable host
- 192.168.1.1
- Last usable host
- 192.168.1.254
- Total addresses
- 256
- Usable hosts
- 254
- Class (historical)
- Class C
- Address type
- Private (RFC 1918)
- 192.168.1.77 is not the first address of its block. It belongs to the network 192.168.1.0/24.
Binary view
Address11000000.10101000.00000001.01001101
Mask11111111.11111111.11111111.00000000
Cyan bits are the network part, grey bits are the host part.
CIDR, mask and host count converter
Enter any one of them and get the others.
- Prefix
- /26
- Subnet mask
- 255.255.255.192
- Wildcard mask
- 0.0.0.63
- Total addresses
- 64
- Usable hosts
- 62
Split into subnets
Splits the network from the box above into equal subnets (IPv4).
4 subnets of /26, 64 addresses each.
| # | Subnet | First usable host | Last usable host | Broadcast address | Usable hosts |
|---|---|---|---|---|---|
| 1 | 192.168.1.0/26 | 192.168.1.1 | 192.168.1.62 | 192.168.1.63 | 62 |
| 2 | 192.168.1.64/26 | 192.168.1.65 | 192.168.1.126 | 192.168.1.127 | 62 |
| 3 | 192.168.1.128/26 | 192.168.1.129 | 192.168.1.190 | 192.168.1.191 | 62 |
| 4 | 192.168.1.192/26 | 192.168.1.193 | 192.168.1.254 | 192.168.1.255 | 62 |
VLSM: subnets of different sizes
Give the number of hosts each subnet needs. The largest is placed first, so every block lines up on its boundary.
Uses 228 of 256 addresses. 28 left, starting at 192.168.1.228.
| Hosts needed | Subnet | Subnet mask | First usable host | Last usable host | Broadcast address | Usable hosts |
|---|---|---|---|---|---|---|
| 100 | 192.168.1.0/25 | 255.255.255.128 | 192.168.1.1 | 192.168.1.126 | 192.168.1.127 | 126 |
| 50 | 192.168.1.128/26 | 255.255.255.192 | 192.168.1.129 | 192.168.1.190 | 192.168.1.191 | 62 |
| 20 | 192.168.1.192/27 | 255.255.255.224 | 192.168.1.193 | 192.168.1.222 | 192.168.1.223 | 30 |
| 2 | 192.168.1.224/30 | 255.255.255.252 | 192.168.1.225 | 192.168.1.226 | 192.168.1.227 | 2 |
How the numbers are worked out
- •A prefix like /24 says how many leading bits name the network. The rest name hosts, so a /24 has 2^8 = 256 addresses. The mask is the same prefix written as four numbers, and the wildcard is the mask turned inside out (used by router access lists).
- •Normally the first address is the network and the last is the broadcast, so usable hosts are the total minus 2. Two exceptions are handled: a /31 has two usable addresses for point-to-point links (RFC 3021), and a /32 is a single address.
- •If you type a host address such as 192.168.1.77/24, the tool shows the network it belongs to (192.168.1.0/24) and says so.
- •VLSM gives each subnet the smallest power-of-two block that holds the hosts you asked for plus its network and broadcast address, and places the biggest first so each block sits on its boundary. Splitting into equal subnets rounds the count up to a power of two.
- •Address types come from the IANA special-purpose address lists. IPv4 classes A to E are shown only as history: routing has used CIDR instead since the 1990s. IPv6 uses BigInt maths, and text follows RFC 5952 (lower case, longest run of zeros shortened to ::).
Questions
- How many usable hosts does a /24 have?
- 254. A /24 holds 256 addresses; the network address and the broadcast address are not given to hosts. A /31 is the exception with 2 usable addresses, and a /32 is a single address.
- What is the difference between a subnet mask and a wildcard mask?
- They are the same bits flipped. 255.255.255.0 is the mask for a /24 and 0.0.0.255 is its wildcard. Routers use masks for interface addresses and wildcards in access lists and OSPF network statements. This tool accepts either one.
- Does the "public" label mean the address is in use?
- No. It only means the address is not in one of the IANA special-purpose ranges such as private, loopback, link-local, shared (100.64.0.0/10), documentation or multicast. It does not say whether the address is assigned to anyone or routed on the internet.
- Is my input sent to a server?
- No. The page does the arithmetic in your browser with no network request for your data, so it also works offline once loaded.