SahlCalc سهل
Gulf Hubs:

Saudi Arabia: Labour: HRSD · Tax and zakat: ZATCA

IP Subnet Calculator

Enter an IPv4 address with its prefix length to see the network it belongs to, the broadcast address, the usable host range, the subnet mask and the wildcard mask.

e.g. 192.168.1.10 or 10.0.0.5/22

/

0–32, e.g. 24 for 255.255.255.0. Ignored if the address ends in /prefix.

Network

192.168.1.0/24

Usable hosts

254

Subnet mask

255.255.255.0

Host range

192.168.1.1 – 192.168.1.254

Address type

Private (RFC 1918)

Subnet details (10)
ItemValue
Address192.168.1.10
Network address192.168.1.0
Broadcast address192.168.1.255
First host192.168.1.1
Last host192.168.1.254
Usable hosts254
Total addresses256
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
Mask in binary11111111.11111111.11111111.00000000

Formula with your numbers

  • Network 192.168.1.10 AND 255.255.255.0 = 192.168.1.0
  • Hosts 2^(32 − 24) − 2 = 254

Quick answer: 192.168.1.10/24 is in network 192.168.1.0 with mask 255.255.255.0; hosts run from 192.168.1.1 to 192.168.1.254 (254 usable) and the broadcast is 192.168.1.255.

How it's calculated

A prefix /n means the first n of the 32 bits are the network part. The subnet mask has those n bits set (/24 = 255.255.255.0) and the wildcard mask is its inverse (0.0.0.255).

Network address = address AND mask. Broadcast address = network OR wildcard. The addresses in between are hosts, so usable hosts = 2^(32 − n) − 2. Two exceptions: a /31 point-to-point link uses both of its addresses (RFC 3021), and a /32 is a single host.

The address type follows the reserved ranges: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private (RFC 1918), 127.0.0.0/8 is loopback, 169.254.0.0/16 link-local and 100.64.0.0/10 is shared address space used for carrier-grade NAT.

Worked examples

  • 192.168.1.10/24: network 192.168.1.0, broadcast 192.168.1.255, 254 hosts
  • 10.0.5.77/22: network 10.0.4.0, hosts 10.0.4.1 – 10.0.7.254, 1,022 hosts
  • 172.16.0.1/30: network 172.16.0.0, hosts .1 – .2, broadcast 172.16.0.3

Common prefixes

PrefixMaskUsable hosts
/8255.0.0.016,777,214
/16255.255.0.065,534
/22255.255.252.01,022
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522

Frequently asked questions

Why are two addresses not usable?

In a normal subnet the first address names the network and the last is the broadcast address, so neither can be given to a device.

What is a wildcard mask?

The inverse of the subnet mask (255 − each octet). Router access lists and OSPF use it to match a range of addresses.

Does it work for IPv6?

No, this calculator is for IPv4. IPv6 subnets are normally /64, which holds 2^64 addresses, so host counting works differently.

How many hosts does a /24 hold?

254. There are 256 addresses, but the first is the network and the last is broadcast. A /25 gives you 126, a /26 62 and a /27 30.

How do I pick a prefix for a number of devices?

Take the number of devices, add 2, and round up to the next power of two. 50 devices need 64 addresses, so a /26 with 62 usable.

What is CIDR notation?

The address followed by a slash and the prefix length, like 192.168.1.0/24. It replaced the old class A, B and C networks and lets subnets be any size.