IP subnet calculator

Type an IPv4 address with a prefix such as 192.168.10.37/26, or pick the mask. You get the network, the usable addresses, the broadcast address and the same numbers in binary.

In binary

Address 11000000101010000000101000100101
Mask 11111111111111111111111111000000

Highlighted bits are the network part; the rest number the hosts.

Network 192.168.10.0/26 64 addresses, 62 usable hosts.
Network address
192.168.10.0
First usable host
192.168.10.1
Last usable host
192.168.10.62
Broadcast address
192.168.10.63
Subnet mask
255.255.255.192
Wildcard mask
0.0.0.63
Addresses
64
Usable hosts
62
Address type
Private (RFC 1918)

Need public IPv4 addresses for your servers? Several providers now charge for each address: see what they ask per month. From €3.02 a month today, among 1,927 servers.

Split into smaller subnets

4 subnets of 16 addresses each.

SubnetUsable hostsBroadcast
192.168.10.0/28192.168.10.1 – 192.168.10.14192.168.10.15
192.168.10.16/28192.168.10.17 – 192.168.10.30192.168.10.31
192.168.10.32/28192.168.10.33 – 192.168.10.46192.168.10.47
192.168.10.48/28192.168.10.49 – 192.168.10.62192.168.10.63

Works in your browser: nothing you type is sent anywhere.

How it is calculated

An IPv4 address is a 32-bit number. The prefix says how many of those bits, counted from the left, name the network; the remaining bits number the hosts inside it. The subnet mask is the same thing written as an address: ones for the network bits, zeros for the host bits.

addresses = 2^(32 − prefix)
usable hosts = addresses − 2
network = address AND mask
broadcast = network OR (NOT mask)
wildcard = NOT mask

Two addresses of every block are taken: the first names the network and the last is its broadcast address. A /31 is the exception used for links between two routers, where both addresses are hosts, and a /32 is one single address, as a cloud provider assigns a floating or failover IP.

Example

192.168.10.37/26: the mask is 255.255.255.192, so the last octet keeps its top two bits. 37 AND 192 = 0, which gives the network 192.168.10.0, the broadcast 192.168.10.63 and 62 usable hosts from .1 to .62.

Prefixes from /16 to /32

PrefixMaskAddressesUsable
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511

Questions

What is a /24 subnet?

A /24 is a block of 256 addresses whose first three octets are fixed, such as 192.168.1.0 to 192.168.1.255. Its mask is 255.255.255.0 and it has 254 usable hosts, because the first address names the network and the last is the broadcast.

How many hosts are in a /29?

A /29 has 8 addresses and 6 usable hosts. It is a common size for a small block of public IPv4 addresses on a dedicated server: one address for the gateway leaves 5 for your services.

What is a wildcard mask?

The subnet mask turned inside out: zeros where the mask has ones and ones where it has zeros. For a /24 it is 0.0.0.255. Cisco access lists and OSPF use it to say which bits of an address may vary.

What is the subnet mask for a /27?

255.255.255.224. A /27 holds 32 addresses with 30 usable hosts, so a /24 splits into eight /27 networks starting at .0, .32, .64 and so on.