CalcComet

IP Subnet Calculator

Enter an IP address and prefix length to instantly see the network range, subnet mask, and how many hosts it supports.

IP Address
192.168.1.0
Subnet Mask?
255.255.255.0
Wildcard Mask?
0.0.0.255
Network Address
192.168.1.0
Broadcast Address
192.168.1.255
First Host
192.168.1.1
Last Host
192.168.1.254
Total Hosts
256
Usable Hosts
254
Binary representation
11000000
10101000
00000001
00000000
Network Host
IP Address
...
Prefix Length
CIDR: 192.168.1.0/24  ·  Mask: 255.255.255.0

How Subnetting Works

Every IPv4 address is 32 bits long — four numbers from 0 to 255, separated by dots. Subnetting splits those 32 bits into two parts: the network portion and the host portion.

The prefix length (the number after the slash, like /24) tells you how many bits belong to the network. The remaining bits identify individual devices on that network.

For example, 192.168.1.0/24 means the first 24 bits identify the network and the last 8 bits are for hosts. Eight bits gives you 256 combinations (0–255), minus two reserved addresses, for 254 usable hosts.

The network address (e.g. 192.168.1.0) is the first address in the range — it identifies the subnet itself, not a device. The broadcast address (e.g. 192.168.1.255) is the last address — traffic sent here reaches every device on the subnet. Neither can be assigned to a device.

What Is CIDR Notation?

CIDR stands for Classless Inter-Domain Routing (CIDR). It's the modern way to express network sizes — a slash followed by a number, like /24 or /16.

Before CIDR, the internet used a rigid Class A / B / C system where network sizes were fixed. CIDR replaced that with flexible prefix lengths, letting ISPs and network engineers allocate exactly as much address space as they need — no more, no less.

The smaller the prefix number, the larger the network. A /8 contains 16 million addresses. A /30 contains just four (two usable). Most home routers sit on a /24 network.

Subnet Mask and Wildcard Mask

The subnet mask expresses the same information as the CIDR prefix, just in dotted-decimal form. A /24 prefix equals a subnet mask of 255.255.255.0 — the first 24 bits are all ones, the last 8 bits are zeros.

The wildcard mask is the bitwise inverse of the subnet mask. Where the subnet mask has a 1, the wildcard has a 0, and vice versa. A /24 wildcard mask is 0.0.0.255. Wildcard masks show up in router and firewall configs to define which bits of an address to match.

Special Cases: /31 and /32

A /32 is a host route — it refers to exactly one IP address. You'll see these in routing tables and on loopback interfaces. There's no network or broadcast address; the single IP is the host.

A /31 is a point-to-point link between two devices (defined in RFC 3021). Both addresses are usable — no broadcast needed when there are only two endpoints. These are common on router-to-router links to conserve IP space.

Practical Tips

  • /24 (255.255.255.0) — the go-to for home and small office networks. Gives you 254 usable addresses.
  • /16 (255.255.0.0) — common in larger enterprises. Supports up to 65,534 hosts.
  • /28 or /29 — used by cloud providers (AWS, GCP, Azure) for small subnets within a VPC. A /29 gives you just six usable addresses — enough for a few servers with minimal waste.
  • Avoid /31 and /32 for general use — they're for specific routing purposes, not regular device assignment.
  • When planning a network, always account for the two reserved addresses (network + broadcast). If you need 30 hosts, use a /27 (30 usable) rather than a /28 (14 usable).