Log in Sign up
Subnet calculator

Subnet calculator: network, mask, broadcast and hosts

Paste an address like 192.168.10.37/26 or 10.0.0.1 255.255.255.0. The calculator shows the network it belongs to, the usable host range and how to split the network further.

IP address converter

Enter an IPv4 address, IPv6 address or number to get it in decimal, hex and binary, and for IPv6 in full and compressed form.

IP range to CIDR and address list

Enter a range like 10.0.0.5 - 10.0.0.77 or a subnet like 192.168.1.0/28. You get the CIDR blocks that cover the range and every address as a list.

IPv4 subnet mask table

PrefixMaskWildcardAddressesHosts
/1128.0.0.0127.255.255.2552 147 483 6482 147 483 646
/2192.0.0.063.255.255.2551 073 741 8241 073 741 822
/3224.0.0.031.255.255.255536 870 912536 870 910
/4240.0.0.015.255.255.255268 435 456268 435 454
/5248.0.0.07.255.255.255134 217 728134 217 726
/6252.0.0.03.255.255.25567 108 86467 108 862
/7254.0.0.01.255.255.25533 554 43233 554 430
/8255.0.0.00.255.255.25516 777 21616 777 214
/9255.128.0.00.127.255.2558 388 6088 388 606
/10255.192.0.00.63.255.2554 194 3044 194 302
/11255.224.0.00.31.255.2552 097 1522 097 150
/12255.240.0.00.15.255.2551 048 5761 048 574
/13255.248.0.00.7.255.255524 288524 286
/14255.252.0.00.3.255.255262 144262 142
/15255.254.0.00.1.255.255131 072131 070
/16255.255.0.00.0.255.25565 53665 534
/17255.255.128.00.0.127.25532 76832 766
/18255.255.192.00.0.63.25516 38416 382
/19255.255.224.00.0.31.2558 1928 190
/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
An address block split into smaller CIDR subnets

How the calculator counts

The prefix length says how many leading bits of the address belong to the network. A /26 leaves 6 bits for hosts, which gives 64 addresses: the first is the network address and the last is the broadcast, so 62 are usable.

Networks /31 and /32 are exceptions: a /31 link uses both addresses, and a /32 is a single host. The wildcard mask is the inverted mask that routers and firewalls use in access lists.

When you need it

  • Allow a whole office network in the IP authorisation of your proxies
  • Check that two ranges from a provider do not overlap
  • Plan subnets for servers, VPN and guest Wi-Fi
  • Turn a mask like 255.255.255.224 into a prefix and back

Questions and answers

01Why are there two fewer hosts than addresses?

In a regular IPv4 network the first address names the network and the last one is the broadcast. Only the addresses between them go to devices.

02How do I turn a mask into a prefix?

Count the one bits of the mask. 255.255.255.0 has 24 of them, so it is /24. The table below lists every mask from /1 to /32.

03How big is an IPv6 /64?

It holds 2^64 addresses. Providers give one /64 per network and a /48 or /56 per customer, so IPv6 planning counts networks, not hosts.

04How do I convert an IP address to a number?

Multiply the first octet by 16,777,216, the second by 65,536, the third by 256, keep the fourth as is and add them up. For 192.168.1.1 you get 3,232,235,777. The converter on this page does it for you and works both ways.

05How do I convert an IP range to CIDR?

Split the range into blocks sized as powers of two, each starting at an address divisible by its size. For 10.0.0.5 to 10.0.0.77 you get eight blocks, from 10.0.0.5/32 to 10.0.0.76/31. The IP range to CIDR block on this page does it for you.

Pricing Grab a free hour