Subnet Calculator

Enter an IP and a mask (CIDR or dotted-decimal) to get the network address, broadcast address, usable host range and host count.

IP address Subnet mask
Tip: the mask can be CIDR like /24 or dotted-decimal like 255.255.255.0.
Results
—
—
—
—
—
—

What the slash number means

In CIDR notation, 192.168.1.0/24 means the first 24 bits identify the network and the remaining 8 bits identify the host. That leaves 2⁸ = 256 addresses in the block, of which two are reserved, giving 254 usable host addresses.

CIDRMaskAddressesUsable hosts
/30255.255.255.25242 — typical for point-to-point links
/29255.255.255.24886
/28255.255.255.2401614
/24255.255.255.0256254 — the familiar home or office LAN
/16255.255.0.065,53665,534
/8255.0.0.016.7 million16.7 million − 2

The two addresses you cannot use

Two exceptions to remember: a /31 has no reserved addresses and gives two usable host addresses, which is why it is used for point-to-point links; and a /32 identifies a single host.

Reading a mask quickly

Each reduction of the prefix by one doubles the block size. A /25 is two /26s, four /27s and so on. Because the mask has to be contiguous, valid subnet masks are only ever a run of ones followed by a run of zeros — 255.255.255.192 is valid, 255.255.255.100 is not.

Why subnetting at all

The full table, already worked out

Most of the arithmetic you need is a lookup. Each step up the list halves the block:

CIDRMaskAddressesUsable hosts
/32255.255.255.25511 — a single host route
/31255.255.255.25422 — point-to-point, no reserved addresses
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/27255.255.255.2243230
/26255.255.255.1926462
/25255.255.255.128128126
/24255.255.255.0256254
/23255.255.254.0512510
/22255.255.252.01,0241,022
/20255.255.240.04,0964,094
/16255.255.0.065,53665,534
/12255.240.0.01,048,5761,048,574
/8255.0.0.016,777,21616,777,214

Two anchors are enough to rebuild the rest: a /24 holds 254 usable hosts, and moving one step in either direction doubles or halves both columns — except /31 and /32, which have no network or broadcast address to reserve.

Related tools

My IP address Base converter DNS propagation check

FAQ

What is CIDR?
CIDR (Classless Inter-Domain Routing) expresses the mask length as a "/number", e.g. /24 means the first 24 bits are network and the last 8 are host bits — equivalent to the dotted-decimal mask 255.255.255.0.
Why subtract 2 from the host count?
The network address (all host bits 0) and the broadcast address (all host bits 1) cannot be assigned to hosts, so usable hosts = 2^(host bits) − 2. The /31 (point-to-point) and /32 (single IP) cases are exceptions and do not subtract 2.
Is my IP uploaded?
No. All computation happens locally in your browser; the IP and mask you enter are never sent to any server.