TTKTheTextKit

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.

Network address
192.168.1.0/24
CIDR notation of the block
Subnet mask
255.255.255.0
/24 means 24 bits of network
First usable host
192.168.1.1
Last usable host
192.168.1.254
Broadcast address
192.168.1.255
Wildcard mask
0.0.0.255
Used in access lists
Usable hosts
254
All addresses minus network and broadcast
Total addresses
256
2 to the power of 8
Address type
Private (RFC 1918)
Address class
C
The old classful range of the first byte
Binary form of the address, mask and network
Address11000000.10101000.00000001.00001010192.168.1.10
Mask11111111.11111111.11111111.00000000255.255.255.0
Network11000000.10101000.00000001.00000000192.168.1.0
Broadcast11000000.10101000.00000001.11111111192.168.1.255

Split this block into smaller subnets

4 subnets of /26, each with 64 addresses and 62 usable hosts.

SubnetFirst hostLast hostBroadcast
192.168.1.0/26192.168.1.1192.168.1.62192.168.1.63
192.168.1.64/26192.168.1.65192.168.1.126192.168.1.127
192.168.1.128/26192.168.1.129192.168.1.190192.168.1.191
192.168.1.192/26192.168.1.193192.168.1.254192.168.1.255

Find the size for a number of hosts

Smallest block
/26
255.255.255.192, 62 usable 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]

About 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.