Skip to content

IP addressing made simple

Subnet Calculator

Calculate network details for any IPv4 or IPv6 address and CIDR prefix. Get the network address, subnet mask, usable hosts, and broadcast instantly.

  • Instant results
  • Visual representation
  • Learn with examples
  • Free to use
Diagram of 192.168.1.0/24: network 192.168.1.0, usable range 192.168.1.1 to 192.168.1.254, broadcast 192.168.1.255, with 24 network bits and 8 host bits.
Try an example
CIDR Prefix

CIDR prefix

Both addresses are usable

00000000000000000000000000000000
/31
/8/16/24/32
Network bitsHost bits

Drag the line, or use the arrow keys. The result updates as it moves.

Results

Network details for 0.0.0.0/31

Network Address

0.0.0.0

Broadcast Address

0.0.0.1

Subnet Mask

255.255.255.254

Total Addresses

2

Usable Hosts

2

First Host

0.0.0.0

Last Host

0.0.0.1

Wildcard Mask

0.0.0.1

Binary Representation

IP Address
00000000.00000000.00000000.00000000
Subnet Mask
11111111.11111111.11111111.11111110
Network Address
00000000.00000000.00000000.00000000
Broadcast Address
00000000.00000000.00000000.00000001

Visual Representation

31 network bits
1 host bits
132

RFC 3021 uses both addresses as hosts. The network and broadcast labels still mark the two ends.

Common CIDR Prefixes

Quick reference table of common IPv4 CIDR prefixes.

Common IPv4 prefixes from /24 to /32
CIDRSubnet MaskTotal AddressesUsable Hosts
/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
View complete CIDR reference →

Frequently Asked Questions

Common questions about subnetting and IP addressing.

View all FAQs →

A subnet is a contiguous block of IP addresses that share the same network prefix. The prefix length says how many leading bits are the network. The remaining bits distinguish hosts inside that block.

CIDR notation writes an address and a prefix length, as in 192.168.1.0/24. The /24 means the first 24 bits are the network. That prefix is the subnet mask 255.255.255.0.

For a conventional IPv4 prefix from /0 through /30, usable hosts are 2 to the power of the host bits, minus 2. The network address and the broadcast are the two addresses that are not hosts. A /24 has 8 host bits, so 256 total addresses and 254 usable hosts.

A /30 has 4 addresses and 2 usable hosts under the usual network-and-broadcast rule. A /31 also has 2 addresses, and RFC 3021 uses both of them as hosts on a point-to-point link. Subtracting 2 from a /31 would hide those hosts.

Host counts for /31 follow RFC 3021. Prefix rules follow RFC 4632. The method is written up on the methodology page.