🌐 Free Subnet Calculator

Enter an IP and a CIDR prefix or netmask to get the network, broadcast, hosts, and range.

-network

Network Address

How to Use This Calculator

Type an IPv4 address, then pick a CIDR prefix from the dropdown or type a netmask directly. The two stay in sync: changing the prefix updates the netmask field and vice versa. Results update live as you type.

1

Enter the IP address in dotted decimal form, for example 192.168.1.10. Each octet must be a number from 0 to 255.

2

Choose a CIDR prefix (0 to 32) or type a subnet mask such as 255.255.255.0. Both inputs stay synchronized automatically.

3

Read the network address, broadcast address, wildcard mask, total and usable host counts, and the first to last usable IP range.

4

Use the binary rows to see the bit boundary between network and host portions, handy when studying for network certifications.

How Subnet Math Works

Network = IP AND Subnet Mask Broadcast = Network OR (NOT Subnet Mask) Total addresses = 2 ^ (32 - prefix) Usable hosts = Total addresses - 2

A 32-bit IPv4 address is split into a network part and a host part. The subnet mask marks which bits are the network part: for a /24, the first 24 bits are ones, giving 255.255.255.0. ANDing the IP with the mask zeroes out the host bits to reveal the network address. Inverting the mask gives the wildcard; ORing it with the network address sets every host bit to one, which is the broadcast address. The first and last addresses of every subnet are reserved (network and broadcast), so usable hosts are always the total minus two. Two special cases break that rule: a /31 has 2 total addresses and, per RFC 3021, both can be used on point-to-point links between routers, while a /32 is a single host route where the network and broadcast addresses are the same as the IP itself.

Worked Example

Take 192.168.1.10/24. The mask is 255.255.255.0, binary 11111111.11111111.11111111.00000000. ANDing the IP 11000000.10101000.00000001.00001010 with the mask keeps the first 24 bits and zeroes the last 8, so the network address is 192.168.1.0. The wildcard mask is 0.0.0.255; ORing it with the network sets the last octet to all ones, giving the broadcast address 192.168.1.255. Total addresses = 2^8 = 256, usable hosts = 256 - 2 = 254, and the usable range runs from 192.168.1.1 to 192.168.1.254. For a bigger example, 10.0.0.5/8 has network 10.0.0.0, broadcast 10.255.255.255, mask 255.0.0.0, 16,777,216 total addresses, 16,777,214 usable, and a usable range of 10.0.0.1 to 10.255.255.254.

Common Subnet Sizes

Here are the subnet sizes you will meet most often. A /8 (255.0.0.0) gives 16,777,214 usable hosts and is typical for huge private networks. A /16 (255.255.0.0) gives 65,534 usable hosts, the classic size for a large office or campus. A /24 (255.255.255.0) gives 254 usable hosts and is the default size for a home or small-office LAN. A /25 (255.255.255.128) gives 126 usable hosts, /26 gives 62, /27 gives 30, /28 gives 14, /29 gives 6, and /30 gives 2 usable hosts, which is the classic size for a point-to-point WAN link. When you carve a network into smaller pieces, each split doubles the number of subnets and halves the hosts per subnet, so plan for growth before you start.

Frequently Asked Questions

What is a subnet calculator?

A subnet calculator takes an IP address and a subnet mask (or CIDR prefix like /24) and works out the network boundaries: the network address, broadcast address, usable IP range, and how many hosts fit in the subnet. Network engineers use it when planning addressing for offices, VLANs, and cloud VPCs.

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation writes an IP and its prefix length together, like 192.168.1.0/24. The number after the slash is the count of network bits in the 32-bit address. A /24 means the first 24 bits are the network and the last 8 are hosts, which is the same as the netmask 255.255.255.0.

How many usable hosts are in a /24 subnet?

A /24 has 256 total addresses, but only 254 are usable for devices. The first address is the network address and the last is the broadcast address, and neither can be assigned to a host. In general, usable hosts = 2^(32 - prefix) - 2. Try it in the calculator above.

What is a /31 subnet used for?

A /31 subnet has only 2 addresses and is used for point-to-point links between two routers, per RFC 3021. Traditional subnetting would say 0 addresses are usable (network and broadcast are consumed), but RFC 3021 lets both addresses be used as host addresses on point-to-point links, giving 2 usable addresses. A /32 is a single host route.

What is the wildcard mask?

The wildcard mask is the bitwise inverse of the subnet mask: every 1 in the subnet mask becomes 0 and vice versa. For 255.255.255.0 the wildcard is 0.0.0.255. It is used in access control lists (ACLs) on Cisco and similar gear, where a 0 bit means "this bit must match" and a 1 bit means "do not care".