Home/Calculator Tools/Subnet Calculator
🔌

Subnet Calculator

FREE

Network, broadcast, host range and wildcard mask from an IP and CIDR

Free · No sign-up required
Loading...

What the subnet calculator does

Enter an IPv4 address and a prefix length (CIDR notation such as /24) or a subnet mask, and the calculator returns everything you need to configure or document the network: the network address, broadcast address, subnet mask in dotted and binary form, the first and last usable host addresses, the number of usable hosts, and the wildcard mask used in access lists. Calculations are bitwise operations performed in your browser.

How subnetting works

An IPv4 address is 32 bits. The prefix length says how many of those bits, from the left, identify the network; the rest identify the host within it. A /24 uses 24 bits for the network and leaves 8 for hosts — 256 addresses, of which the first (all host bits zero) is the network address and the last (all ones) is the broadcast address, leaving 254 usable.

Address 192.168.1.130 = 11000000.10101000.00000001.10000010 Mask /26 255.255.255.192 = 11111111.11111111.11111111.11000000 Network = address AND mask = 192.168.1.128 Broadcast = network OR NOT mask = 192.168.1.191 First host = 192.168.1.129 Last host = 192.168.1.190 Usable hosts = 2^(32−26) − 2 = 62

Prefix length reference

CIDRSubnet maskAddressesUsable hostsTypical use
/8255.0.0.016,777,21616,777,21410.0.0.0/8 private range
/16255.255.0.065,53665,534172.16.0.0/12 blocks, campus networks
/20255.255.240.04,0964,094Cloud VPC subnets
/22255.255.252.01,0241,022Large office LAN
/24255.255.255.0256254The default home / small office LAN
/25255.255.255.128128126Splitting a /24 in two
/26255.255.255.1926462Department VLAN
/27255.255.255.2243230Small VLAN, DMZ
/28255.255.255.2401614Management network
/29255.255.255.24886ISP hand-off to a customer
/30255.255.255.25242Point-to-point links
/31255.255.255.25422 (RFC 3021)Point-to-point, no broadcast
/32255.255.255.25511A single host route / loopback

Private and special ranges

  • 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 — private addresses (RFC 1918), not routed on the internet; used behind NAT.
  • 100.64.0.0/10 — carrier-grade NAT shared space.
  • 127.0.0.0/8 — loopback; 127.0.0.1 is localhost.
  • 169.254.0.0/16 — link-local, self-assigned when DHCP fails.
  • 224.0.0.0/4 — multicast. 240.0.0.0/4 — reserved.

Splitting a network

Each extra prefix bit halves the block. To carve a /24 into four equal subnets, use /26: 192.168.1.0/26, .64/26, .128/26 and .192/26. Subnets of different sizes (variable-length subnet masking) are fine as long as they do not overlap and each starts on a boundary that is a multiple of its size — a /27 must start at .0, .32, .64 and so on. The calculator's network address output confirms whether an address you have chosen is a valid boundary: if the network address differs from what you typed, it is not.

Wildcard masks

Cisco access lists and OSPF configuration use the inverse of the subnet mask: a wildcard of 0.0.0.255 matches any host in a /24. The calculator shows it alongside the mask so you can copy it directly into an ACL.

Frequently asked questions

Why are two addresses unusable?

The all-zeros host address identifies the network itself and the all-ones address is the broadcast. /31 links (RFC 3021) are the exception: both addresses are usable because point-to-point links need no broadcast.

What is the difference between a subnet mask and CIDR?

They express the same thing. /24 and 255.255.255.0 are identical; CIDR is just shorter. The calculator accepts either.

How many hosts do I need to plan for?

Count devices, add gateways, printers and future growth, then choose the smallest prefix that gives at least that many usable hosts — and remember DHCP pools usually reserve some addresses.

Can I use this for IPv6?

No, this calculator is IPv4 only. IPv6 subnetting is simpler in practice: sites receive a /48 and each LAN gets a /64.

My router shows a /24 but I want to isolate IoT devices.

Split the /24 into two /25s or four /26s, put IoT on its own subnet and VLAN, and add firewall rules between them. The calculator gives the ranges.

Is the address I enter sent anywhere?

No. The calculation is bitwise arithmetic done in your browser.

More tools in this category

🏠
Mortgage Calculator
Calculate monthly mortgage payments and amortization
🏦
Loan Calculator
Calculate monthly loan payments and total interest
🚗
Auto Loan Calculator
Calculate monthly car loan payments with down payment
📈
Compound Interest Calculator
Calculate compound interest and investment growth
📊
Investment Calculator
Project the future value of a lump sum plus regular contributions
🏖
Retirement Calculator
Estimate your savings at retirement age and how much is growth