The Basics
What is a subnet mask?

A subnet mask is a 32-bit number that defines which part of an IP address refers to the network and which part refers to individual hosts. It always consists of a continuous block of 1-bits followed by a continuous block of 0-bits.

Written in dotted-decimal format, common subnet masks look like:

  • 255.0.0.0 — Class A default (/8)
  • 255.255.0.0 — Class B default (/16)
  • 255.255.255.0 — Class C default (/24)

The mask is applied to an IP address using a bitwise AND operation to determine the network address of that host.

What does /24 mean in an IP address like 192.168.1.0/24?

The /24 is CIDR (Classless Inter-Domain Routing) notation. The number after the slash indicates how many bits of the 32-bit address are the network portion.

/24 means the first 24 bits are fixed (the network), leaving 8 bits for hosts. This gives:

  • Total addresses: 28 = 256
  • Usable hosts: 256 − 2 = 254
  • Equivalent subnet mask: 255.255.255.0
What is the difference between a network address and a broadcast address?

Every subnet reserves two addresses that cannot be assigned to devices:

  • Network address — the first address in the subnet (all host bits are 0). It identifies the subnet itself and is used in routing tables. For 192.168.1.0/24, the network address is 192.168.1.0.
  • Broadcast address — the last address in the subnet (all host bits are 1). Data sent to this address is delivered to every host on the subnet. For 192.168.1.0/24, the broadcast address is 192.168.1.255.

This is why usable hosts = total addresses − 2, not just total addresses.

How do I find the usable IP range of a subnet?

The usable host range is everything between the network address and the broadcast address:

  • First usable host = network address + 1
  • Last usable host = broadcast address − 1

For example, 10.0.0.0/24:

Network:    10.0.0.0
First host: 10.0.0.1
Last host:  10.0.0.254
Broadcast:  10.0.0.255

Our calculator displays the full range instantly — just enter your IP and prefix.

How many hosts fit in each common subnet size?

Here are the most commonly used subnet sizes and their usable host counts:

CIDRSubnet MaskTotalUsable Hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

Formula: Usable hosts = 2(32 − prefix) − 2

CIDR & Notation
What is CIDR notation and how does it work?

CIDR (Classless Inter-Domain Routing) is a method for representing IP networks by appending a prefix length to an address with a slash. It replaced the older classful system in 1993 to allow more efficient allocation of address space.

The prefix length indicates how many leading bits of the address are fixed. 10.0.0.0/8 means the first 8 bits (the "10" part) define the network, and the remaining 24 bits are available for hosts.

CIDR also enables route aggregation (supernetting) — combining multiple smaller networks into a single routing entry to reduce routing table size.

What is the difference between a /30 and a /31 subnet?

Both are used for point-to-point links, but they work differently:

  • /30 — 4 addresses, 2 usable hosts. The traditional choice for router-to-router links. One address is the network, one is broadcast, and two are usable.
  • /31 — 2 addresses, technically 0 usable by traditional rules. However, RFC 3021 defines /31 as valid for point-to-point links where both addresses can be assigned to devices. Supported by most modern routers.

For most purposes, /30 is the safer choice due to broader support.

What does a /32 subnet mean?

A /32 subnet contains exactly one IP address — all 32 bits are fixed. It is used to represent a single host route, most commonly in:

  • Loopback interfaces on routers (e.g., 1.1.1.1/32)
  • Firewall rules targeting a specific host
  • BGP route advertisements for individual IPs
  • Null routes to blackhole a specific address
Note: A /32 has no network or broadcast address — the single address both is the network and functions as the host address.
Private & Special Addresses
What are private IP addresses?

Private IP addresses (defined in RFC 1918) are reserved for use within private networks and are not routable on the public internet. NAT (Network Address Translation) is used to map them to public IPs for internet access.

The three private ranges are:

  • 10.0.0.0/8 — 10.0.0.0 to 10.255.255.255 (16.7 million addresses)
  • 172.16.0.0/12 — 172.16.0.0 to 172.31.255.255 (1 million addresses)
  • 192.168.0.0/16 — 192.168.0.0 to 192.168.255.255 (65,536 addresses)

Home routers typically use the 192.168.x.x range. Large enterprises often use 10.x.x.x for maximum flexibility.

What is the loopback address (127.0.0.1)?

The loopback address 127.0.0.1 (also known as "localhost") is a special address that refers to the local machine itself. The entire 127.0.0.0/8 range is reserved for loopback.

Traffic sent to any address in 127.x.x.x never leaves the machine — it is processed entirely within the operating system's network stack. This is commonly used to test network applications locally without a physical network connection.

What is the 169.254.0.0/16 range?

This range, known as APIPA (Automatic Private IP Addressing) or link-local, is automatically assigned by Windows, macOS, and Linux when a device cannot obtain an IP from a DHCP server.

If you see a device with a 169.254.x.x address, it typically means the device failed to reach a DHCP server. Check your network connection, DHCP server status, and cable/wireless configuration.

Tip: Seeing a 169.254 address is usually a sign of a DHCP failure, not a deliberate configuration.
Wildcard Masks & ACLs
What is a wildcard mask and how is it different from a subnet mask?

A wildcard mask is the bitwise inverse of a subnet mask — calculated by subtracting each octet from 255. Where a subnet mask uses 1s to indicate the network, a wildcard mask uses 0s to indicate "must match" bits.

Subnet mask:   255.255.255.0  →  /24
Wildcard mask:   0.0.0.255   (255−255, 255−255, 255−255, 255−0)

Wildcard masks are used in:

  • Cisco ACLspermit 192.168.1.0 0.0.0.255 permits all addresses in the 192.168.1.0/24 range
  • OSPF area statements — to specify which interfaces participate in an OSPF area

A wildcard of 0.0.0.0 means match exactly one specific host. A wildcard of 255.255.255.255 means match any address.

Using the Calculator
What information does the calculator output?

For any valid IP address and prefix or subnet mask, the calculator returns:

  • Network address — the subnet identifier
  • Broadcast address — the last address in the subnet
  • First usable host — the first assignable IP address
  • Last usable host — the last assignable IP address
  • Total host count — all addresses in the subnet
  • Usable host count — assignable addresses (total minus 2)
  • Subnet mask — in dotted-decimal notation
  • CIDR prefix — the /xx notation
  • Wildcard mask — inverse of the subnet mask
  • Binary representation — full binary breakdown of address and mask
Can I enter a subnet mask instead of a CIDR prefix?

Yes. The calculator accepts both formats:

  • CIDR notation: 192.168.1.0/24
  • With dotted-decimal mask: 192.168.1.0 + 255.255.255.0

The results are identical regardless of which format you use — they describe the same network. The calculator will also display the equivalent representation in the output.

What IP addresses are not valid inputs?

The calculator requires a valid IPv4 address — four octets each between 0 and 255. The following are not valid inputs:

  • Octets outside the 0–255 range (e.g., 256.1.1.1)
  • IPv6 addresses (e.g., 2001:db8::1)
  • Hostnames or domain names
  • Prefix lengths outside /0 to /32

Additionally, while technically valid IPv4, some ranges like 0.0.0.0 and 255.255.255.255 have special meanings and may produce results without usable hosts.

Still have questions?

Check out our full subnetting guide or jump straight into the calculator.

Read the guide Open calculator