belun.app Blog

IP Subnet Calculator — CIDR, Netmask, and Host Range

Network (CIDR)
Subnet mask
Wildcard mask
Network address
Broadcast address
Usable host range
Usable hosts
Total addresses
Host bits
Class
Address scope
Decimal
Hexadecimal
Address in binary
Mask in binary
CIDR to subnet mask reference
Prefix Subnet mask Addresses Usable hosts
/8 255.0.0.0 16,777,216 16,777,214
/16 255.255.0.0 65,536 65,534
/20 255.255.240.0 4,096 4,094
/22 255.255.252.0 1,024 1,022
/23 255.255.254.0 512 510
/24 255.255.255.0 256 254
/25 255.255.255.128 128 126
/26 255.255.255.192 64 62
/27 255.255.255.224 32 30
/28 255.255.255.240 16 14
/29 255.255.255.248 8 6
/30 255.255.255.252 4 2
/31 255.255.255.254 2 2
/32 255.255.255.255 1 1

Enter an IPv4 address and a prefix length to get the network and broadcast addresses, the usable host range, the subnet and wildcard masks, and how many hosts the block holds. It also names the block — private, loopback, CGNAT, multicast — so you can tell at a glance whether an address is routable on the internet. Everything is computed in your browser.

How it works

  1. 1
    Enter an IPv4 address Type or paste an address such as 192.168.1.10. You can include the prefix inline — pasting 10.0.0.0/8 sets the selector for you.
  2. 2
    Pick the prefix length Choose anything from /0 to /32; each option shows its dotted mask, so /26 reads 255.255.255.192. Results update as you change it.
  3. 3
    Read the results Network and broadcast addresses, the first and last usable host, host counts, wildcard mask, and the binary view are all shown at once. Copy all copies the whole block as plain text for a ticket or runbook.

Your data stays private

All processing happens entirely in your browser. No files, text, or data are ever sent to our servers. You can disconnect from the internet and this tool will still work.

Frequently asked questions

How many usable hosts are in a /24?
254. A /24 holds 256 addresses, and two of them are reserved: the first is the network address and the last is the broadcast address. The same subtraction applies to every prefix up to /30, which is why a /30 gives you only two usable addresses out of four.
What is the difference between a subnet mask and a wildcard mask?
They are bitwise inverses. A /24 has the mask 255.255.255.0 and the wildcard 0.0.0.255. Masks are used on interfaces; wildcard masks appear in Cisco access lists and OSPF network statements, where a 0 bit means 'must match' and a 1 bit means 'ignore'.
Why does a /31 show two usable hosts?
RFC 3021 allows /31 prefixes on point-to-point links. There is no broadcast address to reserve on a link with exactly two endpoints, so both addresses are assignable. Older equipment that predates the RFC may still reject a /31, in which case use a /30.
How do I work out the network address by hand?
Bitwise-AND the address with the mask. For 192.168.1.10 and /24, the last octet's bits are all masked off, so 10 becomes 0 and the network is 192.168.1.0. The binary view on this page lines both values up so you can see which bits survive.
Which address ranges are private?
10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 per RFC 1918. This calculator also flags 100.64.0.0/10 (carrier-grade NAT), 127.0.0.0/8 (loopback), 169.254.0.0/16 (link-local), and the RFC 5737 documentation ranges, since those are the ones people mistake for routable space.
Does it support IPv6?
Not yet — this calculator is IPv4 only. IPv6 uses 128-bit addresses and has no broadcast address or usable-host subtraction, so the maths and the output fields are different enough to need a separate tool.

From the blog

Subnetting Without the Headache: CIDR, Masks, and Host Counts How CIDR prefixes map to masks, why a /24 gives 254 hosts, and the subnetting shortcuts that hold up under pressure. Read the post →

Related tools