Free tool · IPv4

Subnet calculator
CIDR, netmask, hosts.

Enter an IPv4 address with a prefix or a netmask to get the network and broadcast address, the usable host range and the wildcard mask. It all runs in your browser.

FreeNo sign-upNothing stored

CIDR works too: 10.0.0.0/8

/0 to /32, or a mask

Try:
Network
192.168.1.0/24
Usable hosts
254
Host range
192.168.1.1 – 192.168.1.254
Netmask
255.255.255.0
Full breakdown, binary view and mask converter

Result

192.168.1.0/24 subnet

Network address
192.168.1.0
Broadcast address
192.168.1.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Usable hosts
254
Total addresses
256
Netmask
255.255.255.0
Wildcard mask
0.0.0.255
CIDR notation
192.168.1.0/24
Address type
Private network (RFC 1918) · 192.168.0.0/16
Address class
Class C
As integer / hex
3232235786 · 0xC0A8010A
Reverse DNS zone
1.168.192.in-addr.arpa
Entered address
192.168.1.10

Binary view

The first 24 bits are the network part, the remaining 8 bits (highlighted) number the hosts.

Address, netmask, network and broadcast in binary
Address11000000.10101000.00000001.00001010192.168.1.10
Netmask11111111.11111111.11111111.00000000255.255.255.0
Network11000000.10101000.00000001.00000000192.168.1.0
Broadcast11000000.10101000.00000001.11111111192.168.1.255

Netmask ⇄ prefix converter

Type a prefix (/27), a netmask (255.255.255.224) or a wildcard mask (0.0.0.31).

Prefix
/29
Netmask
255.255.255.248
Wildcard
0.0.0.7
Usable hosts
6

8 addresses in total per /29 block.

Reference

CIDR to netmask table, /8 to /32

Every prefix with its netmask, wildcard mask and size. Link to a row with its anchor, for example #cidr-24.

CIDR prefixes /8 to /32 with netmask, wildcard mask, total addresses and usable hosts
PrefixNetmaskWildcardAddressesUsable hostsTypical use
/8255.0.0.00.255.255.25516,777,21616,777,214Large private block (10.0.0.0/8)
/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,574Private block 172.16.0.0/12
/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,534Campus or VPC network
/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,094Large office or cloud subnet
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022Big LAN, Wi-Fi network
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254Typical LAN or VLAN
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462Department, small VLAN
/27255.255.255.2240.0.0.313230Small office
/28255.255.255.2400.0.0.151614Server or DMZ segment
/29255.255.255.2480.0.0.786Small static IP block
/30255.255.255.2520.0.0.342Point-to-point (classic)
/31255.255.255.2540.0.0.122Point-to-point (RFC 3021)
/32255.255.255.2550.0.0.011Single host route

How to use the subnet calculator

Type an IPv4 address and either a prefix length such as /24 or a dotted netmask such as 255.255.255.0. You can also paste CIDR notation like 10.20.30.40/22 straight into the address field. The summary next to the form updates while you type; Calculate takes you to the full breakdown with the binary view.

Every result is computed in your browser. Nothing you enter is sent anywhere, so it is safe to use with internal address plans. Share a result by copying the address bar after you press Calculate: the network is kept in the link.

What CIDR notation means

An IPv4 address is 32 bits, written as four decimal numbers from 0 to 255. Classless Inter-Domain Routing (CIDR, RFC 4632) splits those bits into a network part and a host part, and the number after the slash says how many bits belong to the network. In 192.168.1.10/24 the first 24 bits (192.168.1) identify the network and the last 8 bits number the hosts inside it.

Before CIDR, networks came in fixed classes: A (/8), B (/16) and C (/24). Classes wasted space, because an organisation needing 300 addresses had to take a whole class B of 65,536. CIDR allows any prefix length, which is why routing tables, firewall rules and cloud consoles all speak in prefixes today. The class is still shown in the result because older documentation and some exams use it.

Network, broadcast and usable hosts

A subnet of prefix n holds 2^(32 − n) addresses. The first one, with all host bits set to 0, is the network address that names the subnet in routing tables. The last one, with all host bits set to 1, is the broadcast address that reaches every host on the segment. Neither can be given to a device, so a classic subnet has 2^(32 − n) − 2 usable hosts: 254 in a /24, 62 in a /26, 6 in a /29.

Two prefixes break that rule. A /31 has only two addresses, and RFC 3021 lets routers use both on a point-to-point link because such a link needs no broadcast. Most modern router and firewall software supports it, and it halves the addresses spent on transit links compared with a /30. A /32 is a single address: it describes one host, a loopback interface, an anycast service or a firewall rule for exactly one IP.

Netmask, wildcard mask and prefix length

A netmask writes the prefix as an address: n one-bits followed by zeros. /24 is 255.255.255.0, /20 is 255.255.240.0 and /29 is 255.255.255.248. A valid netmask always has its ones on the left and its zeros on the right; a value like 255.0.255.0 is not a netmask, and the calculator says so. To convert a mask to a prefix by hand, count the one-bits: 255 counts 8, 254 counts 7, 252 counts 6, 248 counts 5, 240 counts 4, 224 counts 3, 192 counts 2 and 128 counts 1. What is a subnet mask? walks through the binary AND and has the full /0 to /32 cheat sheet.

A wildcard mask is the inverse: zeros for the network bits, ones for the host bits, so /24 becomes 0.0.0.255. Cisco access lists and OSPF network statements use it. The converter under the result turns any of the three forms into the other two.

Common subnet sizes

  • /24 subnet: mask 255.255.255.0, 256 addresses, 254 usable. The default size for a home or office LAN and a VLAN.
  • /29 subnet mask: 255.255.255.248, 8 addresses, 6 usable. A typical block of static public IPs from an ISP; one address usually goes to the provider's gateway.
  • /30: 255.255.255.252, 2 usable. The traditional size for a point-to-point link, now often replaced by a /31.
  • /16: 255.255.0.0, 65,534 usable. Common as the outer range of a cloud VPC, which is then cut into /20 or /24 subnets.
  • /22: 255.255.252.0, 1,022 usable. Large Wi-Fi or campus networks where a /24 runs out.

Private, CGNAT and other special ranges

Some ranges never appear on the public internet. RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks. 100.64.0.0/10 is shared address space for carrier-grade NAT (RFC 6598): an address from it on your router's WAN side means your provider shares one public IP between many customers. 127.0.0.0/8 is loopback, 169.254.0.0/16 is link-local (what a device assigns itself when DHCP fails), 224.0.0.0/4 is multicast, and 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are reserved for documentation.

The calculator labels each of these in the result, and private IP address ranges lists the special-purpose blocks with the RFC that defines each. To see who a public address belongs to, use the IP & ASN lookup; to see which addresses a domain points to, use the DNS lookup. For how address blocks are routed between networks, see what BGP is.

03Questions

Questions, answered.

Something else? Talk to us.

254. A /24 has 256 addresses; the first is the network address and the last is the broadcast address, which leaves 254 for devices. Its netmask is 255.255.255.0 and its wildcard mask 0.0.0.255.

255.255.255.248. A /29 holds 8 addresses, of which 6 are usable hosts, and its wildcard mask is 0.0.0.7. It is a common size for a small block of static public IP addresses.

RFC 3021 allows both addresses of a /31 to be used on point-to-point links, because a link between exactly two routers needs neither a network nor a broadcast address. The calculator follows that rule and reports 2 usable hosts.

Count the one-bits in the mask. Each 255 is 8 bits, and the last non-zero octet adds 7 for 254, 6 for 252, 5 for 248, 4 for 240, 3 for 224, 2 for 192 or 1 for 128. So 255.255.240.0 is 8 + 8 + 4 = /20. The converter on this page does it for you.

The bitwise inverse of the netmask: network bits are 0 and host bits are 1, so /24 becomes 0.0.0.255. Cisco access control lists and OSPF use wildcard masks to say which bits of an address must match.

This calculator is for IPv4. IPv6 subnetting is simpler in practice: almost every LAN is a /64, sites usually receive a /48 or /56. The IP & ASN lookup on this site accepts IPv6 addresses.

Get started

Put a WAF, CDN and unmetered DDoS protection
in front of your site.

Point your DNS at GuardX and traffic is filtered at the edge before it reaches your server. Flat pricing, no surcharge while an attack runs.