Subnet Calculator

IPv4 subnet calculator with CIDR, masks, host ranges, subnet splitting, VLSM and IPv6

Also accepts 10.0.0.5/255.255.0.0 or an address with a mask after a space.
Private (RFC 1918). The usual home and office range (Wi-Fi routers use 192.168.0.x or 192.168.1.x). Historic class C (classful mask /24).
Network
192.168.1.0/24
254 usable hosts: 192.168.1.1 to 192.168.1.254
Broadcast
192.168.1.255
First host
192.168.1.1
Last host
192.168.1.254
Usable hosts
254
Total addresses
256
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Class
C
Binary viewnetwork bits highlighted
Address 11000000.10101000.00000001.00001010
Mask 11111111.11111111.11111111.00000000
Network 11000000.10101000.00000001.00000000
Broadcast 11000000.10101000.00000001.11111111
Hex C0A8010A ยท Integer 3232235786 ยท PTR 10.1.168.192.in-addr.arpa
Split 192.168.1.0/24 into subnets
4 ร— /26, 62 usable hosts each.
#SubnetUsable rangeBroadcastHosts
1192.168.1.0/26192.168.1.1 to 192.168.1.62192.168.1.6362
2192.168.1.64/26192.168.1.65 to 192.168.1.126192.168.1.12762
3192.168.1.128/26192.168.1.129 to 192.168.1.190192.168.1.19162
4192.168.1.192/26192.168.1.193 to 192.168.1.254192.168.1.25562

Runs entirely in your browser. Nothing you type or upload is sent to us or stored.

Results are for general guidance. Please check anything important before relying on it. Terms of use

How to Use

  1. Choose IPv4 or IPv6.
  2. Type an IP address with its prefix, such as 192.168.1.10/24, or type the address and pick the Prefix / subnet mask from the list. A mask after the address (10.0.0.5 255.255.0.0) also works.
  3. You'll see the network and broadcast addresses, the first and last usable host, the number of hosts, the subnet and wildcard masks, and whether the address is private, public or special. The Binary view highlights the network bits.
  4. To divide the network, use Split into subnets: into N equal subnets, into subnets with at least N hosts each, or VLSM with a name and host count for each subnet.
  5. Tap Copy details or Copy table (CSV) to paste the plan into a document or spreadsheet, or Download .csv to open it in Excel.

What a subnet calculator tells you

An IPv4 address such as 192.168.1.10/24 has two parts. The prefix length (/24) says how many of the 32 bits identify the network. The remaining bits identify the host inside it. From those two values this subnet calculator works out the whole subnet: where it starts and ends, how many devices fit, and which mask to type into a router, firewall, cloud VPC or Linux server.

Network address = IP AND mask
Broadcast address = network OR (NOT mask)
Total addresses = 2^(32 โˆ’ prefix)
Usable hosts = total โˆ’ 2 (network and broadcast are reserved)

There are two exceptions. A /31 has no network or broadcast address, so both addresses are usable on a point-to-point link (RFC 3021). A /32 is a single host.

Worked example: 172.20.45.130/20

/20 mask = 255.255.240.0 (20 ones, then 12 zeros)
Third octet : 45 AND 240 = 32
Network = 172.20.32.0
Block size = 256 โˆ’ 240 = 16 in the third octet, so the next network is 172.20.48.0
Broadcast = 172.20.47.255
Usable hosts = 2^12 โˆ’ 2 = 4,094 (172.20.32.1 to 172.20.47.254)
Wildcard mask = 0.0.15.255

Type 172.20.45.130/20 above to check it, and look at the binary view to see why: the first 20 bits are copied from the address, and the rest become 0 for the network address and 1 for the broadcast address.

Common prefixes

PrefixSubnet maskUsable hostsTypical use
/8255.0.0.016,777,214The whole 10.x.x.x private block
/16255.255.0.065,534A cloud VPC or a campus
/22255.255.252.01,022A large office floor or hostel Wi-Fi
/24255.255.255.0254A home or small-office LAN (192.168.1.0/24)
/26255.255.255.19262A department VLAN
/28255.255.255.24014A small block of public IPs from an ISP
/30255.255.255.2522A router-to-router link
/32255.255.255.2551A single host or loopback

Private, public and special addresses

RFC 1918 reserves three ranges for private networks: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Home Wi-Fi routers, office LANs and cloud VPCs use them, and NAT translates them to a public address on the internet. Internet providers use 100.64.0.0/10 for carrier-grade NAT. If your router's WAN address falls in that range, you share a public IP with other customers and can't accept incoming connections (for a CCTV recorder or a home server) without your ISP's help. The calculator also flags loopback (127.0.0.0/8), link-local (169.254.0.0/16), documentation, multicast and reserved ranges.

Splitting a network and VLSM

Splitting a /24 into 4 equal subnets borrows 2 host bits and gives four /26 networks of 62 hosts each. Equal splits always come in powers of two. When departments need different sizes, use VLSM (variable-length subnet masking). The calculator sorts the requests from largest to smallest and gives each one the smallest block that fits, which keeps every block aligned. For 100, 50, 20 and 2 hosts inside 192.168.1.0/24 you get a /25, a /26, a /27 and a /30, using 228 of the 256 addresses and leaving the rest free for later.

IPv6 basics

IPv6 addresses have 128 bits written as 8 groups of hex digits. Leading zeros in a group can be dropped, and one run of zero groups can be written as ::, so 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. The calculator shows both forms, the first and last address of a prefix, and how many /64 networks a larger prefix contains. A normal IPv6 LAN is a /64, because automatic address configuration (SLAAC) needs exactly 64 host bits.

Tips

  • AWS reserves 5 addresses in every VPC subnet (Azure also reserves 5), so a /24 there gives 251 usable IPs, not 254.
  • The wildcard mask is the inverse of the subnet mask. Cisco ACLs and OSPF network statements use it.
  • Classes A, B and C are historical. Since CIDR was introduced in 1993, any prefix length can be used with any address.

Frequently Asked Questions

254 usable hosts. A /24 has 256 addresses (2 to the power 8), but the first is the network address and the last is the broadcast address. For example, 192.168.1.0/24 has usable hosts 192.168.1.1 to 192.168.1.254.

Do a bitwise AND of the IP and the mask. For 192.168.10.77 with mask 255.255.255.192 (/26), the last octet is 77 AND 192 = 64, so the network is 192.168.10.64. The broadcast is the network plus the block size minus one: 192.168.10.127.

A wildcard mask is the subnet mask with every bit flipped, so 255.255.255.0 becomes 0.0.0.255. Subnet masks are used on interfaces and in routing. Wildcard masks are used in Cisco access lists and OSPF to say which bits may vary.

Private. 192.168.0.0/16, 10.0.0.0/8 and 172.16.0.0/12 are reserved for private networks by RFC 1918 and are not routed on the internet. Your router uses NAT to share one public IP among the private addresses at home or in the office.

Using different prefix lengths inside one network, so each subnet is just big enough. VLSM stands for variable-length subnet masking. Instead of four /26s, you might use a /25 for 100 PCs, a /26 for 50 servers, a /27 for Wi-Fi and a /30 for a router link. The VLSM option plans this automatically.

Because RFC 3021 allows /31 subnets on point-to-point links, where no network or broadcast address is needed. That leaves both addresses usable. Many routers support it to save addresses. On ordinary LANs, use /30 or larger.