🌐 IP Subnet Mask & CIDR Calculator

A subnet mask calculator for IPv4: CIDR prefix, network and broadcast address, usable host range, wildcard mask and host count from any address.

Free No Signup Required Browser-Based
Usable Host IP Range
192.168.1.1 – 192.168.1.254
254 usable assignable hosts (256 total addresses)
Subnet Mask
255.255.255.0
Network ID Address
192.168.1.0
Broadcast Address
192.168.1.255
Wildcard Mask
0.0.0.255

What IP Subnet Mask & CIDR Calculator Does

A subnet mask splits a 32-bit IPv4 address into a network portion and a host portion. Everything to the left of the boundary identifies the network; everything to the right identifies a host inside it. CIDR notation writes that boundary as a prefix length — /24 means the first 24 bits are network.

Classless Inter-Domain Routing replaced the original class A/B/C system in 1993 precisely because fixed boundaries at 8, 16 and 24 bits wasted enormous amounts of address space. A network needing 300 hosts had to take a class B with 65,534, and the address exhaustion that followed is why CIDR exists.

This calculator derives the network address, broadcast address, usable host range, wildcard mask and total host count from any address and prefix length, in both dotted-decimal and CIDR form.

How to Use IP Subnet Mask & CIDR Calculator

  1. Enter the IP address (e.g. 192.168.1.50)
  2. Select CIDR prefix (/1 to /32)
  3. Review usable host range, subnet mask, wildcard mask, and network address

Formula Used by IP Subnet Mask & CIDR Calculator

Usable host count

usable_hosts = 2^(32 − prefix) − 2

prefix
CIDR prefix length, the number of network bits
− 2
The all-zeros host part is the network address and the all-ones host part is the broadcast address; neither can be assigned to a host

Worked example

The network 192.168.10.0/26.

  1. Host bits: 32 − 26 = 6
  2. Total addresses: 2^6 = 64
  3. Subtract network and broadcast: 64 − 2 = 62
  4. Block size is 64, so this subnet spans 192.168.10.0 – 192.168.10.63

Result: 62 usable hosts, .1 through .62, with .0 the network and .63 the broadcast address.

Network address

network = IP AND mask

AND
Bitwise AND applied octet by octet

Worked example

Host 192.168.10.77 with mask 255.255.255.192 (/26).

  1. Fourth octet of the address: 77 = 01001101
  2. Fourth octet of the mask: 192 = 11000000
  3. Bitwise AND: 01000000 = 64
  4. The first three octets are unchanged because their mask bits are all ones

Result: Network 192.168.10.64/26 — host range .65 to .126, broadcast .127.

CIDR Prefix Reference

The block size column is the fastest way to find a subnet boundary by hand: subnets start at multiples of the block size.

CIDRSubnet maskBlock sizeTotal addressesUsable hosts
/24255.255.255.0256256254
/25255.255.255.128128128126
/26255.255.255.192646462
/27255.255.255.224323230
/28255.255.255.240161614
/29255.255.255.248886
/30255.255.255.252442
/31255.255.255.254222 (point-to-point, RFC 3021)
/32255.255.255.255111 (single host)

Private Address Ranges (RFC 1918)

Addresses reserved for internal use and never routed on the public internet.

RangeCIDRAddressesOld class equivalent
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216One class A
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576Sixteen class Bs
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536256 class Cs

Source: RFC 1918 — Address Allocation for Private Internets

How to Read Your Result

Why /31 is an exception

The minus-two rule would leave a /31 with zero usable addresses, which made point-to-point links waste a /30 for decades. RFC 3021 redefined /31 so both addresses are assignable, since a link with exactly two endpoints has no need for a broadcast address.

The block-size shortcut

Subnets always begin at a multiple of their block size. For a /26 the block size is 64, so valid networks in 192.168.10.0/24 are .0, .64, .128 and .192 — and nothing else. This lets you locate any host's network in your head without doing binary arithmetic.

Wildcard masks are not subnet masks

A wildcard mask is the bitwise inverse: /26 has subnet mask 255.255.255.192 and wildcard 0.0.0.63. Cisco ACLs and OSPF use wildcards, where a 0 bit means "must match". Confusing the two silently matches the wrong range rather than erroring.

Limitations & Accuracy Notes

  • This calculator covers IPv4 only. IPv6 uses 128-bit addresses with no broadcast address and no minus-two rule — a /64 is the standard subnet size regardless of how many hosts it holds.
  • The usable host count is the arithmetic maximum. Real deployments lose addresses to gateways, DHCP reservations, virtual IPs and management interfaces.
  • Subnetting maths says nothing about whether a design is sound. Broadcast domain size, VLAN boundaries and routing policy all constrain how large a subnet should actually be.

Frequently Asked Questions

What is CIDR notation in networking?
Classless Inter-Domain Routing (CIDR) specifies an IP address and its associated routing prefix (e.g. 192.168.1.0/24 means the first 24 bits are the network prefix).
How do you calculate usable host addresses in a subnet?
Usable Hosts = 2^(32 - CIDR) - 2 (subtracting 2 for the dedicated network ID and broadcast addresses).
How many usable hosts are in a subnet?
Two fewer than the total addresses, because the first is the network address and the last is the broadcast address. A /24 holds 256 addresses and 254 usable hosts; a /26 holds 64 and 62.
What does the number after the slash mean?
CIDR notation — how many leading bits are fixed as the network portion. A /24 fixes 24 bits, leaving 8 for hosts, which is 2^8 = 256 addresses. Every bit you add halves the subnet size.
Why does a /31 have 2 usable hosts rather than 0?
Because RFC 3021 carves out a special case for point-to-point links, where there is no need for a broadcast address. Both addresses in a /31 are usable. A /30, the older way of doing the same thing, gives 2 usable out of 4.
Which address ranges are private?
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, defined in RFC 1918. They are not routable on the public internet, which is why they can be reused inside every network independently.
What is the difference between a subnet mask and a wildcard mask?
A wildcard mask is the bitwise inverse — a /24 subnet mask of 255.255.255.0 corresponds to a wildcard of 0.0.0.255. Cisco access control lists use wildcards, and mixing the two up is a classic source of rules that match nothing or everything.
Is anything sent to a server?
No. Subnet arithmetic is bitwise maths done in your browser.

References & Further Reading

By OnlineToolHubs Team • September 2026