Subnet calculator

Network address, netmask, usable host range and size of any IPv4 or IPv6 subnet, as you type.

Try:

192.168.1.0/24

Show all 12
Network
192.168.1.0
Prefix length
/24
Netmask
255.255.255.0
Wildcard mask
0.0.0.255
First usable
192.168.1.1
Last usable
192.168.1.254
Broadcast
192.168.1.255
Addresses
256
Usable hosts
254
Type
Private (RFC 1918)
Reverse DNS zone
1.168.192.in-addr.arpa

In binary: the first 24 bits are the network, the rest are hosts.

Address11000000.10101000.00000001.00000000
Netmask11111111.11111111.11111111.00000000
Network11000000.10101000.00000001.00000000

What is a subnet?

A subnet is a block of consecutive IP addresses that belong together, such as the devices on one home or office network. Its size is set by the prefix length: in 192.168.1.0/24, the first 24 of the address's 32 bits identify the network and the remaining 8 bits number the devices on it, giving 256 addresses.

The same split can be written as a netmask: /24 is 255.255.255.0, with one bits for the network part and zero bits for the host part. The wildcard mask is the opposite (0.0.0.255) and is used in router access lists.

Usable hosts

In IPv4, the first address of a subnet is the network address and the last is the broadcast address, so neither can be given to a device: a /24 has 256 addresses but 254 usable hosts. Two exceptions: a /31 has two usable addresses for point-to-point links (RFC 3021), and a /32 is a single host. IPv6 has no broadcast address, so every address in the range is usable.

Private address ranges

These IPv4 ranges are reserved for private networks (RFC 1918) and are never routed on the internet. Your router gives devices addresses from one of them and translates to your public IP address (NAT).

RangeCIDRAddresses
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536

Mobile and some home internet providers also use 100.64.0.0/10 for carrier-grade NAT, which is why your router's outside address can differ from the public address websites see.

IPv4 subnet reference

PrefixNetmaskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/9255.128.0.08,388,6088,388,606
/10255.192.0.04,194,3044,194,302
/11255.224.0.02,097,1522,097,150
/12255.240.0.01,048,5761,048,574
/13255.248.0.0524,288524,286
/14255.252.0.0262,144262,142
/15255.254.0.0131,072131,070
/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

IPv6 subnets

IPv6 addresses are 128 bits long, so subnets are much larger. A single network segment is normally a /64, leaving 64 bits for devices. Internet providers typically give homes a /56 or /48, which holds 256 or 65,536 such /64 networks.