Subnet Calculator

Calculate network address, broadcast address, usable host range, and subnet mask from IP address and CIDR notation.

Input Mode:

/

Network: 192.168.1.0/24

IP Address192.168.1.0
Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Usable Hosts254
Subnet Mask255.255.255.0
Subnet Mask (Hex)FF.FF.FF.00
Wildcard Mask0.0.0.255
CIDR Notation/24
IP ClassC

Binary Representation

IP Address

11000000.10101000.00000001.00000000

Subnet Mask

11111111.11111111.11111111.00000000

Network Addr

11000000.10101000.00000001.00000000

Broadcast

11000000.10101000.00000001.11111111

CIDR Reference Table
CIDRSubnet MaskUsable HostsTotal IPs
/32255.255.255.25511
/31255.255.255.25422
/30255.255.255.25224
/29255.255.255.24868
/28255.255.255.2401416
/27255.255.255.2243032
/26255.255.255.1926264
/25255.255.255.128126128
/24255.255.255.0254256
/23255.255.254.0510512
/22255.255.252.01,0221,024
/21255.255.248.02,0462,048
/20255.255.240.04,0944,096
/19255.255.224.08,1908,192
/18255.255.192.016,38216,384
/17255.255.128.032,76632,768
/16255.255.0.065,53465,536
/15255.254.0.0131,070131,072
/14255.252.0.0262,142262,144
/13255.248.0.0524,286524,288
/12255.240.0.01,048,5741,048,576
/8255.0.0.016,777,21416,777,216
/4240.0.0.0268,435,454268,435,456
/00.0.0.04,294,967,2944,294,967,296

How to Use the Subnet Calculator

  1. Choose Input Mode: Select "IP + CIDR" to enter a CIDR prefix like /24, or "IP + Subnet Mask" to enter a dotted decimal mask like 255.255.255.0. Both methods produce identical results.
  2. Enter the IP address. This can be a host IP or the network address. The calculator will find the correct network address automatically by ANDing the IP with the subnet mask.
  3. Enter the prefix length or subnet mask. Common values: /24 (254 hosts), /16 (65,534 hosts), /8 (16.7M hosts). The /30 prefix (2 usable hosts) is popular for point-to-point links.
  4. Read the results: Network address (first IP in range), broadcast address (last IP), first and last usable host IPs, the total usable host count, subnet mask in dotted decimal and hex, wildcard mask, and IP class.
  5. Use the binary panel to see exactly which bits belong to the network portion and which are host bits. The CIDR table at the bottom shows all common prefixes as a reference.

Subnet Calculation Formulas

Subnet Mask   = all 1s for network bits, all 0s for host bits
Wildcard Mask = bitwise NOT of subnet mask (255.255.255.255 - mask)

Network Addr  = IP AND Subnet Mask (bitwise AND)
Broadcast Addr = Network Addr OR Wildcard Mask (bitwise OR)

First Usable Host = Network Addr + 1
Last Usable Host  = Broadcast Addr - 1
Usable Hosts      = 2^(32 - prefix) - 2
Total IPs         = 2^(32 - prefix)

Example: 192.168.1.45/24
  Mask:      255.255.255.0   = 11111111.11111111.11111111.00000000
  Network:   192.168.1.0     (AND of IP and mask)
  Broadcast: 192.168.1.255   (network OR wildcard)
  Wildcard:  0.0.0.255       (bitwise NOT of mask)
  Hosts:     2^8 - 2 = 254

Note: /31 and /32 subnets are special cases. A /31 has 2 IPs and is used for point-to-point links (RFC 3021) with no traditional network/broadcast. A /32 is a host route representing a single IP address.

Frequently Asked Questions

A subnet mask is a 32-bit number that divides an IP address into a network portion and a host portion. Bits set to 1 identify the network; bits set to 0 identify the host. The subnet mask 255.255.255.0 (/24) means the first 24 bits are the network and the last 8 bits are host addresses, allowing 254 usable hosts on that network.

Related Calculators