IP Subnet Calculator

Type any IPv4 address with a CIDR prefix or subnet mask. You instantly get the network, broadcast, usable host range, masks and a colour-coded binary view. Then split the network or plan it with VLSM.

  • 100% free
  • Runs in your browser – nothing uploaded
  • No sign-up
Examples:
Network
–

Binary view

Network bitsHost bits

#SubnetUsable rangeBroadcastHosts

How subnetting works

An IPv4 address is 32 bits. The prefix length (the /26 in 192.168.10.37/26) says how many of those bits identify the network. The remaining bits identify hosts within it. The subnet mask is the same information written as four octets: /26 = 26 one-bits = 255.255.255.192.

  • Network address: all host bits set to 0. It identifies the subnet and can’t be assigned to a device.
  • Broadcast address: all host bits set to 1. Packets sent here reach every host in the subnet.
  • Usable hosts: 2host bits − 2. A /26 has 6 host bits, so 64 − 2 = 62 usable addresses.
  • Wildcard mask: the inverse of the subnet mask (0.0.0.63), used in Cisco ACLs and OSPF network statements.
🔌

/31 and /32 are special. A /31 has no network or broadcast address, so both addresses are usable. That makes it ideal for point-to-point router links (RFC 3021) and saves half the addresses of a /30. A /32 is a single host, used for loopbacks and host routes. This calculator handles both correctly.

Subnet cheat sheet

CIDRSubnet maskWildcardAddressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/16255.255.0.00.0.255.25565,53665,534
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

Private and special IPv4 ranges

RangePurpose
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16Private networks (RFC 1918). Not routed on the internet
100.64.0.0/10Carrier-grade NAT shared space (RFC 6598). Common with ISPs and mobile networks
169.254.0.0/16Link-local / APIPA. A device that failed to get DHCP often has one of these
127.0.0.0/8Loopback (localhost)
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24Documentation examples (TEST-NET-1/2/3)
224.0.0.0/4Multicast (e.g. 224.0.0.5 = all OSPF routers)

VLSM in practice

Variable Length Subnet Masking gives each segment a subnet sized to its needs instead of cutting everything into equal pieces. List your segments in the VLSM planner: an office LAN of 100 users, 50 guests, 20 servers, a 2-host router link. The planner allocates them largest first, so every block lands on a correct boundary without gaps. It also shows exactly how much space is left for growth.

  1. Start from the block you were assigned (for example 192.168.10.0/24).
  2. For each segment, add 2 (network + broadcast) and round up to a power of two: 100 hosts → 128 → /25.
  3. Allocate the biggest first, then the next biggest straight after it, and so on.
  4. Leave the remaining space as future expansion. Growth always comes sooner than you think.

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 has 256 addresses. Subtract the network address (.0) and the broadcast address (.255).

What is the difference between a subnet mask and a wildcard mask?

They are bit-for-bit inverses. Subnet mask 255.255.255.0 = wildcard 0.0.0.255. Subnet masks are used on interfaces. Wildcard masks are used in Cisco ACLs and routing protocol statements.

Can I enter a subnet mask instead of a CIDR prefix?

Yes. Type 10.0.0.5 255.255.255.0 or 10.0.0.5/255.255.255.0. If you accidentally enter a wildcard mask, the calculator recognises it and tells you the matching subnet mask.

Why does my address show a warning about leading zeros?

An address like 192.168.010.1 is ambiguous. Some systems read 010 as octal (8), others as decimal (10). Remove the leading zeros to avoid misconfiguration.

Is the calculation done on your server?

No. Everything is calculated in your browser, so it works offline and your addressing plan stays private. The maths is covered by our automated test suite.