Eazy Toolbox
Skip to tool

IP Subnet Calculator

Enter an address and a prefix to get the network, broadcast, mask, wildcard, host range and host count — and split the block into equal subnets.

Your data never leaves your browser. This tool runs entirely on your device.

Accepts 192.168.1.0/24, 192.168.1.0 255.255.255.0, or a bare address.

Network address
192.168.1.0/24identifies the block
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255ACLs, OSPF
Broadcast address
192.168.1.255
Usable host range
192.168.1.1 – 192.168.1.254
Usable hosts
254256 addresses in total
Address type
Private192.168.0.0/16 · RFC 1918
Class (historical)
Class C
Reverse DNS zone
1.168.192.in-addr.arpa
Divide this block

How the mask splits an address

An IPv4 address is 32 bits. The prefix length says how many of those bits identify the network; everything left over identifies a host inside it. In 192.168.1.10/24 the first 24 bits — 192.168.1 — are the network, and the last 8 bits are the host part.

The subnet mask is the same statement written as an address: 24 one-bits followed by 8 zero-bits is 255.255.255.0. ANDing the address with the mask clears the host bits and leaves the network address; setting every host bit instead gives the broadcast address.

network = address AND mask · broadcast = network OR NOT mask

Why usable hosts is two fewer than it looks

A /24 contains 256 addresses but only 254 usable ones. The first, with all host bits zero, names the subnet itself; the last, with all host bits one, is the broadcast address for it. Neither can be assigned to an interface.

So the count is 2^(32 − prefix) − 2. Every bit you take from the host part halves the block: a /25 gives 126 usable hosts, a /26 gives 62, a /27 gives 30.

usable hosts = 2^(32 − prefix) − 2

The /31 and /32 exceptions

The subtraction stops making sense at the small end. A /31 would have zero usable addresses, so RFC 3021 redefines it: on a point-to-point link there is nothing to broadcast to, and both addresses are usable. That is why router-to-router links are commonly /31 rather than the older /30.

A /32 is a single address — a host route, the mask you use in a firewall rule or an access list that must match exactly one machine.

Splitting a block into subnets

Each extra prefix bit halves the block and doubles the number of subnets. Turning a /24 into /26s gives four subnets of 62 usable hosts each, at .0, .64, .128 and .192 — the increment is always 2^(32 − new prefix).

Size each subnet for the number of hosts it must hold, then round up to the next power of two and add the two reserved addresses. A VLAN with 100 devices needs a /25, not a /26.

  • /30 — 2 usable hosts, the classic point-to-point link.
  • /29 — 6 usable hosts, a small block of servers.
  • /27 — 30 usable hosts, a small office VLAN.
  • /24 — 254 usable hosts, the default LAN size.

Common prefixes

CIDRMask and usable hosts
/24255.255.255.0 — 254 hosts
/25255.255.255.128 — 126 hosts
/26255.255.255.192 — 62 hosts
/27255.255.255.224 — 30 hosts
/28255.255.255.240 — 14 hosts
/29255.255.255.248 — 6 hosts
/30255.255.255.252 — 2 hosts
/16255.255.0.0 — 65,534 hosts

Frequently asked questions

What is the difference between the network address and the first usable host?

The network address has every host bit set to zero and names the subnet itself, so it cannot be assigned to a device. The first usable host is the next address up — 192.168.1.0 and 192.168.1.1 for a /24.

What is a wildcard mask for?

It is the inverse of the subnet mask: 0.0.0.255 for a /24. Cisco access lists and OSPF network statements match on wildcard masks, where a zero bit means "must match" and a one bit means "ignore".

How many hosts fit in a /26?

Sixty-two. A /26 holds 64 addresses in total, minus the network address and the broadcast address. Four /26 subnets fit inside one /24.

Is 10.0.0.0/8 routable on the internet?

No. 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are reserved by RFC 1918 for private use, and internet routers drop traffic addressed to them. They reach the internet only through NAT.

Does the class of an address still determine the mask?

No. Classful addressing was replaced by CIDR in 1993, so the mask is whatever is configured, independently of the first octet. The class shown here is historical context, useful mainly when reading older documentation.