home / Other / ip subnet calculator

IP Subnet Calculator

The IP Subnet Calculator is a free online IPv4 tool that takes an address and a prefix or mask and returns the network address, broadcast address, usable host range, host count, wildcard mask and address class. It also shows the binary breakdown. No sign-up needed.

Modify the values and click the Calculate button to use.

Related: Password Generator Calculator | Conversion Calculator

What a Subnet Is

An IPv4 address is 32 bits, written as four decimal octets. A subnet mask splits those 32 bits into a network portion and a host portion. Every address sharing the same network portion is on the same subnet and can reach the others directly; anything else has to go through a router.

The mask is a run of 1 bits followed by a run of 0 bits. CIDR notation just counts the 1 bits: /24 means the first 24 bits are network, leaving 8 for hosts, which is the same as the mask 255.255.255.0.

The Three Special Addresses

AddressHow it is foundUsable by a host?
Network addressIP AND mask — all host bits set to 0No
Broadcast addressAll host bits set to 1No
Host addressesEverything between themYes

This is why usable hosts is 2(32−prefix) − 2 rather than the full count. A /24 has 256 addresses but only 254 assignable hosts.

Two exceptions exist. A /31 has no network or broadcast address and provides two usable addresses, defined by RFC 3021 specifically for point-to-point links. A /32 is a single host route.

Worked Example

Take 192.168.1.130 /24:

 DecimalBinary
IP192.168.1.13011000000.10101000.00000001.10000010
Mask255.255.255.011111111.11111111.11111111.00000000
Network192.168.1.011000000.10101000.00000001.00000000
Broadcast192.168.1.25511000000.10101000.00000001.11111111

The network address is a bitwise AND of the IP and the mask; the broadcast sets every host bit to 1. Usable hosts run from 192.168.1.1 to 192.168.1.254.

CIDR Reference Table

PrefixSubnet maskTotal addressesUsable hosts
/8255.0.0.016,777,21616,777,214
/9255.128.0.08,388,6088,388,606
/10255.192.0.04,194,3044,194,302
/11255.224.0.02,097,1522,097,150
/12255.240.0.01,048,5761,048,574
/13255.248.0.0524,288524,286
/14255.252.0.0262,144262,142
/15255.254.0.0131,072131,070
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/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
/31255.255.255.25422
/32255.255.255.25511

Private Address Ranges (RFC 1918)

Three ranges are reserved for internal networks and are never routed on the public internet. This is what makes NAT possible and why millions of home networks can all use 192.168.1.0/24.

RangeCIDRAddressesTypically used by
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216Large enterprise networks
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576Medium networks, Docker defaults
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536Home and small office routers

Other reserved ranges worth recognising: 127.0.0.0/8 is loopback, 169.254.0.0/16 is link-local (the address a device self-assigns when DHCP fails), and 224.0.0.0/4 is multicast.

Address Classes

Before CIDR arrived in 1993, the first bits of an address determined a fixed split between network and host portions.

ClassFirst octetDefault maskNetworksHosts each
A1–126/812616,777,214
B128–191/1616,38465,534
C192–223/242,097,152254
D224–239Multicast
E240–255Reserved

Classful addressing wasted enormous quantities of address space — an organisation needing 300 hosts had to take a class B with 65,534. CIDR replaced it with arbitrary prefix lengths, which is why the class of an address is now historical trivia rather than an operational fact.

Wildcard Masks

A wildcard mask is the bitwise inverse of a subnet mask: the /24 mask 255.255.255.0 has the wildcard 0.0.0.255. Cisco access control lists and OSPF configuration use wildcards rather than subnet masks, so mixing them up is a classic source of misconfigured rules.

Choosing a Prefix

Hosts neededPrefixUsableTypical use
2/30 or /312Point-to-point router link
up to 6/296Small server group
up to 14/2814Small office
up to 30/2730Department VLAN
up to 62/2662Medium VLAN
up to 254/24254Standard office or home LAN

Broadcast traffic scales with subnet size, so very large flat subnets perform badly. Most network designs keep a single broadcast domain under 254 hosts even where more addresses are available.

Frequently Asked Questions

Why can't I use the network or broadcast address?

The network address identifies the subnet itself in routing tables, and the broadcast address delivers to every host at once. Neither can identify an individual machine.

What does /24 mean?

The first 24 bits are the network portion, leaving 8 bits for hosts — 256 addresses, 254 usable. It is equivalent to the mask 255.255.255.0.

Does this work for IPv6?

No. IPv6 uses 128-bit addresses and has no broadcast address, so the arithmetic differs. This calculator is IPv4 only.

Why does my router show a different network?

Almost always a different prefix. The same IP address yields a different network address under /24 than under /16, so the mask must match what the device is configured with.