Skip to content
GEEKnodes

Computing

IP Subnet Calculator: Subnet Mask, CIDR and Range Explained

Calculate the subnet mask, network, broadcast and range of an IP with its CIDR prefix. What /24 means, how a network is split and which addresses are private.

What does 192.168.1.50/24 mean? How many devices fit on a /26 network? Why can’t your PC see the printer if it’s on 192.168.0.x? You can answer all of that once you understand the subnet mask. Here we explain it without weird formulas and with a calculator.

In short

  • An IPv4 address has 32 bits: one part identifies the network and the rest the host.
  • The CIDR prefix (/24, /16…) says how many bits belong to the network.
  • Two devices only talk directly if they’re on the same network.

Calculator

Subnet mask
—
Network address
—
Broadcast
—
Host range
—
Usable hosts
—
Wildcard
—
Address type
—

What an IP address is

An IPv4 address is 4 numbers from 0 to 255 separated by dots, for example 192.168.1.50. Each number is 8 bits, so the full address has 32 bits.

32-bit IPv4 address split into 24 network bits and 8 host bits for 192.168.1.50/24.
In a /24, the first 24 bits identify the network and the last 8 the host.

Those 32 bits are split into two parts:

  • Network: the same for every device on the same network (like the street name).
  • Host: different for each device (like the house number).

Subnet mask and CIDR

The mask shows where the network part ends. It can be written in two ways that mean the same thing:

CIDRMaskUsable hostsTypical use
/8255.0.0.016,777,214Large private networks (10.x.x.x)
/16255.255.0.065,534Companies, campuses
/24255.255.255.0254Your home network
/25255.255.255.128126Splitting a /24 in two
/26255.255.255.19262Small networks
/27255.255.255.22430Guest VLAN, cameras
/28255.255.255.24014Small groups of servers
/30255.255.255.2522Links between two routers
Equivalence between the /24 CIDR prefix and the 255.255.255.0 mask, with their network and host parts.
The /24 prefix is equivalent to a 255.255.255.0 mask.

The CIDR number is the count of bits set to 1 in the mask. In a /24, the first 24 bits are network and 8 are left for hosts: 2⁸ = 256 addresses.

Why you subtract 2

Two addresses are reserved in every network:

  • The first is the network address (in a /24, the .0).
  • The last is the broadcast address, for talking to everyone at once (the .255).

That’s why a /24 has 256 addresses but 254 usable hosts. The only exceptions are /31, which is used on point-to-point links and uses both addresses, and /32, which identifies a single host.

Step-by-step example

For 192.168.1.50/26:

  1. /26 leaves 6 bits for hosts: 2⁶ = 64 addresses per subnet.
  2. Subnets start at multiples of 64: .0, .64, .128, .192.
  3. The .50 falls in the first one: network 192.168.1.0, broadcast 192.168.1.63.
  4. Usable range: 192.168.1.1 – 192.168.1.62 (62 hosts).
/26 subnet containing 192.168.1.50: network .0, usable range .1–.62 and broadcast .63.
The .50 IP belongs to the .0–.63 block; .0 and .63 are reserved.

Private and special addresses

RangeWhat it’s for
10.0.0.0/8Private
172.16.0.0/12Private (from 172.16 to 172.31)
192.168.0.0/16Private (the one almost every home router uses)
100.64.0.0/10CGNAT: used by some ISPs between your router and the Internet
169.254.0.0/16Self-assigned (APIPA): the device didn’t get an IP from the router
127.0.0.0/8Loopback: the device itself (127.0.0.1)

Private addresses don’t go out to the Internet: the router translates them to your public IP (NAT).

Common problems

  • Your PC has a 169.254.x.x address: it didn’t get an address from the router via DHCP. Check the cable or Wi-Fi, or restart the router.
  • You can’t see a new device: if your network is 192.168.1.0/24 and the device comes configured with 192.168.0.100, it’s on another network. Temporarily change your IP to 192.168.0.x or reconfigure the device.
  • Duplicate IP: two devices with the same static IP step on each other. Reserve static IPs in the router or use addresses outside the DHCP range.
  • Wrong mask: a /16 mask on a /24 network makes the device think addresses on other networks are “local”, so it doesn’t use the router to reach them.

Accessibility preferences

Quick profiles

Text and reading

Text size
Default
Line height
Default
Letter spacing
Default
Word spacing
Default

Colour

Motion and orientation

Cursor