Subnet Calculator
Calculate network address, broadcast address, usable host range, wildcard mask, and IP class from any IP and subnet mask. Includes CIDR cheat sheet and IPv4 class reference.
Works OfflineDark ModeNo Ads
Enter IP Address & Subnet Mask
How to Use
- Enter your value in the input field
- Click the Calculate/Convert button
- Copy the result to your clipboard
Frequently Asked Questions
- What is a subnet mask?
- A subnet mask is a 32-bit number that divides an IP address into network and host portions. It uses contiguous 1-bits for the network part and 0-bits for the host part. For example, 255.255.255.0 (/24) means the first 24 bits identify the network and the last 8 bits identify hosts, allowing 254 usable addresses.
- What is CIDR notation?
- CIDR (Classless Inter-Domain Routing) notation represents a subnet mask as a slash followed by the number of network bits. For example, /24 means 24 bits for the network (equivalent to 255.255.255.0). CIDR replaced classful addressing, allowing more flexible allocation of IP address space.
- How do I calculate the number of usable hosts in a subnet?
- Usable hosts = 2^(32 - CIDR) - 2. Subtract 2 because the first address is the network address and the last is the broadcast address. For /24: 2^8 - 2 = 254 usable hosts. For /30: 2^2 - 2 = 2 usable hosts (common for point-to-point links). Exception: /31 has 2 usable hosts (RFC 3021) and /32 has 1.
- What is the difference between network address and broadcast address?
- The network address is the first address in a subnet (all host bits set to 0) and identifies the subnet itself. The broadcast address is the last address (all host bits set to 1) and is used to send packets to all hosts in the subnet. Neither can be assigned to a host device.
- What is a wildcard mask?
- A wildcard mask is the inverse of a subnet mask, commonly used in Cisco ACLs and OSPF configurations. Calculate it by subtracting each octet of the subnet mask from 255. For subnet mask 255.255.255.0, the wildcard mask is 0.0.0.255. A 0-bit means "must match" and a 1-bit means "don't care."
- What are the IPv4 address classes?
- IPv4 addresses are divided into 5 classes: Class A (0.0.0.0-127.255.255.255, /8 default), Class B (128.0.0.0-191.255.255.255, /16 default), Class C (192.0.0.0-223.255.255.255, /24 default), Class D (224-239, multicast), and Class E (240-255, experimental). Modern networks use CIDR instead of classful addressing.