savingsOnlineCalc
search

IP Subnet Calculator (IPv4 / CIDR)

Enter an IPv4 address and a CIDR prefix to get the network and broadcast addresses, the subnet and wildcard masks, the usable host range, and how many hosts the block holds.

Address & Prefix

/24
/0/32

Class C

192.168.1.10/24

Private
Network address
192.168.1.0
Broadcast address
192.168.1.255
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Usable hosts
254
Total addresses
256

Binary breakdown

Address11000000.10101000.00000001.00001010
Mask11111111.11111111.11111111.00000000
Network11000000.10101000.00000001.00000000

192.168.0.0/16 is a private range (RFC 1918), common on home networks.

How subnetting works

An IPv4 address is 32 bits, written as four 8-bit numbers (octets). A CIDR prefix like /24 says how many of those leading bits identify the network - the rest identify hosts inside it. A /24 fixes the first 24 bits, leaving 8 host bits, so the block holds 256 addresses (2 to the power of 8).

Two of those addresses are not assignable to devices: the first is the network address (all host bits 0) and the last is the broadcast address (all host bits 1). That is why a /24 has 256 total addresses but only 254 usable hosts. The subnet mask is just the prefix written as dotted-quad - a /24 mask is 255.255.255.0 - and the wildcard mask is its inverse, used by routers and access lists.

Worked example: 192.168.1.10/26

A /26 fixes 26 bits and leaves 6 host bits, so each block holds 64 addresses. The mask is 255.255.255.192. Because 192.168.1.10 falls in the first block, the network address is 192.168.1.0 and the broadcast address is 192.168.1.63. Usable hosts run from 192.168.1.1 to 192.168.1.62 - that is 62 devices. The next block would start at 192.168.1.64. Set the prefix above to /26 to see this calculated live.

Common prefixes at a glance

PrefixSubnet maskTotalUsable hosts
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/27255.255.255.2243230
/26255.255.255.1926462
/24255.255.255.0256254
/16255.255.0.065,53665,534

Frequently asked questions

What is the difference between the network and broadcast address?expand_more

The network address has every host bit set to 0 and names the subnet itself - it is not given to a device. The broadcast address has every host bit set to 1 and is used to reach all hosts on the subnet at once. Both sit at the edges of the block, which is why they are excluded from the usable host count.

Why does a /24 have 254 usable hosts instead of 256?expand_more

A /24 leaves 8 host bits, which gives 2 to the power of 8 = 256 total addresses. The first (network) and last (broadcast) addresses are reserved, leaving 256 - 2 = 254 addresses you can assign to devices.

What is a wildcard mask used for?expand_more

A wildcard mask is the bitwise inverse of the subnet mask. A /24 mask of 255.255.255.0 has the wildcard 0.0.0.255. Routers and firewalls (for example in OSPF and Cisco access lists) use wildcard masks to match ranges of addresses, where a 1 bit means 'this bit can be anything'.

How do private IP ranges relate to subnetting?expand_more

RFC 1918 sets aside 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 for private networks. You can subnet freely inside these ranges because they are never routed on the public internet, which is why home and office networks almost always use them.

What does /31 mean and why does it show two usable hosts?expand_more

Normally the network and broadcast addresses are reserved, so a /31 (two total addresses) would have zero usable hosts. RFC 3021 makes an exception for point-to-point links, where both addresses can be assigned to the two endpoints, giving two usable hosts.

Note: This tool covers IPv4 only and assumes classless (CIDR) addressing. Host counts use the standard rule of subtracting the network and broadcast addresses, with the RFC 3021 exception that a /31 provides two usable hosts for point-to-point links. Always confirm your design against your own network plan.