Log in Sign up
Subnet calculator

Subnet mask calculator: network, broadcast and host range

Paste an address like 192.168.10.37/26 or 10.0.0.1 255.255.255.0. You get the network and broadcast addresses, the usable host range, the wildcard mask and the address type. For IPv4 you also get the smaller subnets the network splits into. The math runs in your browser.

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.

Subnet mask cheat sheet: /1 to /32

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

Subnet mask and CIDR prefix length

A subnet is a block of IP addresses that share the same leading bits. The subnet mask marks those bits with ones: 255.255.255.0 has 24 of them. CIDR notation writes that count after a slash, so 192.168.1.0/24 and 192.168.1.0 with mask 255.255.255.0 name the same network. You will also see the number after the slash called the prefix length.

The bits after the prefix belong to hosts. A /26 leaves 6 bits, which gives 64 addresses: the first is the network address and the last is the broadcast, so 62 are usable. IPv4 results show the mask in binary, so you can see where the network bits end.

A /31 and a /32 break that rule: a /31 point-to-point link uses both of its addresses, and a /32 is a single host. The wildcard mask is the mask with its bits flipped, 0.0.0.63 for a /26. Cisco access lists and OSPF network statements take it in place of the mask.

For an IPv6 prefix such as 2001:db8::/48 you get the network, the first and last address, the address count and the type. The Split into list works on IPv4: pick a prefix 1 to 8 bits longer and the page lists up to 256 subnets, each linked to its own calculation.

The IP address converter on this page turns an address into decimal and hex, IPv4 into binary, and IPv6 into its full and compressed forms. It also turns a number back into an IP. The range block converts a CIDR block to an IP range with an address list, and an IP range back into CIDR blocks.

When you need it

  • Allow a whole office network in the IP authorization 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
  • Get the address list of a /28 to paste into a firewall allowlist

Subnetting example: splitting 192.168.1.0/24 into four /26 networks

Take 192.168.1.0/24 and borrow 2 host bits. The prefix grows to /26, the mask becomes 255.255.255.192, and you get four networks of 64 addresses with 62 usable hosts each. 192.168.1.0/26 covers hosts .1 to .62 with broadcast .63. 192.168.1.64/26 runs from .65 to .126 with broadcast .127, 192.168.1.128/26 from .129 to .190 with broadcast .191, and 192.168.1.192/26 from .193 to .254 with broadcast .255. To repeat it here, enter 192.168.1.0/24, choose /26 in the Split into list and open any of the four links.

Private IP ranges, CGNAT and other special addresses

RFC 1918 reserves three private IPv4 ranges: 10.0.0.0/8 with 16,777,216 addresses, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) with 1,048,576, and 192.168.0.0/16 with 65,536. Providers use 100.64.0.0/10 from RFC 6598 for carrier-grade NAT. A Windows or Mac computer that gets no DHCP answer assigns itself a link-local address from 169.254.0.0/16. Loopback takes 127.0.0.0/8 and multicast takes 224.0.0.0/4. RFC 5737 sets aside 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 for documentation, and the calculator marks 0.0.0.0/8 and 240.0.0.0/4 as reserved. In IPv6 it recognizes loopback ::1, unique local fc00::/7, link-local fe80::/10, multicast ff00::/8 and documentation 2001:db8::/32. The Type field shows which of these ranges your address falls into.

Questions and answers

01What is a subnet mask and what is CIDR notation?

A subnet mask is a 32-bit number that splits an IPv4 address into a network part and a host part. 255.255.255.0 keeps the first three octets for the network and leaves the last one for hosts. CIDR notation writes the same split as a slash plus the count of network bits, so that mask becomes /24.

02What is the subnet mask for /24, /26, /28, /29 and /30?

/24 is 255.255.255.0 with 256 addresses and 254 hosts. /26 is 255.255.255.192 with 64 and 62, /27 is 255.255.255.224 with 32 and 30, /28 is 255.255.255.240 with 16 and 14, /29 is 255.255.255.248 with 8 and 6, and /30 is 255.255.255.252 with 4 and 2. A /32 is one address. A /18 holds 16,384 addresses and a /16 holds 65,536.

03How do I find the network and broadcast addresses?

Write the IP and the mask in binary and AND them bit by bit to get the network address. Set all host bits to one and you get the broadcast. For 192.168.10.37/26 that gives 192.168.10.0 and 192.168.10.63. Devices use the 62 addresses between them, which is why a regular IPv4 subnet has two fewer hosts than addresses. Point-to-point /31 links skip that rule and use both addresses.

04How do I convert a subnet mask to a CIDR prefix?

Count the one bits of the mask. 255.255.255.0 has 24 of them, so it is /24, and 255.255.255.224 has 27. To go back, write that many ones followed by zeros and read them as four octets. The subnet mask cheat sheet on this page lists every mask from /1 to /32.

05How do I split a /24 into smaller subnets?

Add bits to the prefix. One extra bit gives two /25 networks of 128 addresses, two bits give four /26 networks of 64, and three give eight /27 networks of 32. Enter the /24 in the calculator, pick the new prefix in Split into, and click any subnet to see its host range and broadcast.

06What are the private IP ranges and the CGNAT range?

RFC 1918 private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. You can use them inside any network, and ISPs do not route them on the internet. 100.64.0.0/10 is the shared range for carrier-grade NAT: if your router gets a WAN address from it, your provider has put you behind its own NAT.

07How big is an IPv6 /64?

It holds 2^64 addresses, about 18.4 quintillion. Each LAN segment gets one /64, since SLAAC needs 64 host bits. Providers hand a customer a /48, which holds 65,536 /64 networks, or a /56, which holds 256, so you plan IPv6 by counting /64 networks.

08How do I convert an IP address to decimal, hex or binary?

Multiply the first octet by 16,777,216, the second by 65,536 and the third by 256, then add the fourth. For 192.168.1.1 you get 3,232,235,777. In hex each octet becomes two digits: 0xC0A80101. In binary it is 11000000.10101000.00000001.00000001. The converter on this page does all three and turns a number back into an IP.

09How 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. Give it a CIDR such as 192.168.1.0/28 and it lists all 16 addresses.

Pricing Grab a free hour