Free IP Subnet Calculator

Enter an IP address and select a subnet mask to see all network properties

This online tool serves as a full‑featured subnet mask calculator, network address calculator, and CIDR calculator for IPv4 subnetting tasks. It quickly delivers essential details about any IP address and subnet mask combination: the number of usable hosts, the complete subnet range, the network and broadcast addresses, the address class, and much more. Network engineers, system administrators, and students preparing for exams like CompTIA Network+ will find it invaluable for designing subnets, troubleshooting connectivity, and learning CIDR concepts.

Subnetting Basics

In IPv4, every address has two logical parts: a network prefix (used by routers to forward packets between subnets) and a host identifier (used to reach a specific device). Subnetting is the practice of borrowing bits from the host part to create additional network bits, effectively dividing one large network into smaller, more efficient subnets. This calculator works exclusively with IPv4 addresses, though it also outputs IPv4‑mapped IPv6 addresses and 6to4 prefixes for environments that are transitioning to IPv6.

The Subnet Mask

A subnet mask is a 32‑bit number that determines which bits of an IP address belong to the network and which belong to the host. The network address is obtained by performing a bitwise logical AND between the IP address and the subnet mask. The host portion can be isolated by inverting the mask (forming the wildcard mask) and then AND‑ing with the IP.

The following example uses the address 10.0.0.5 with a mask of 255.255.255.224 (prefix /27):

FieldBinary (dotted octets)
IP00001010.00000000.00000000.00000101
Mask11111111.11111111.11111111.11100000
Net00001010.00000000.00000000.00000000 → 10.0.0.0
Host00000000.00000000.00000000.00000101 → 0.0.0.5

The resulting network prefix is 10.0.0.0, and the host part is 0.0.0.5.

CIDR Notation and the Classless Model

Before CIDR, networks followed a classful scheme (Class A = /8, B = /16, C = /24), which offered only coarse size choices. Classless Inter‑Domain Routing (CIDR) removes these fixed boundaries, allowing any prefix length from /1 to /32. This flexibility lets administrators match subnet sizes much more precisely to their needs. CIDR notation appends a slash and the prefix length to the IP address, e.g., 10.0.0.0/27.

The total number of addresses in a subnet is 2(32−prefix)2^{(32 - \text{prefix})}. Subtracting the network and broadcast addresses leaves the usable host count. The table below shows every possible prefix length along with its subnet mask and usable hosts – the calculator uses the same mapping internally.

PrefixSubnet MaskUsable Hosts
/1128.0.0.02,147,483,646
/2192.0.0.01,073,741,822
/3224.0.0.0536,870,910
/4240.0.0.0268,435,454
/5248.0.0.0134,217,726
/6252.0.0.067,108,862
/7254.0.0.033,554,430
/8255.0.0.016,777,214
/9255.128.0.08,388,606
/10255.192.0.04,194,302
/11255.224.0.02,097,150
/12255.240.0.01,048,574
/13255.248.0.0524,286
/14255.252.0.0262,142
/15255.254.0.0131,070
/16255.255.0.065,534
/17255.255.128.032,766
/18255.255.192.016,382
/19255.255.224.08,190
/20255.255.240.04,094
/21255.255.248.02,046
/22255.255.252.01,022
/23255.255.254.0510
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522
/31255.255.255.2540
/32255.255.255.2550

Instead of manually consulting such a table, you can enter any IP and prefix into this IP range calculator to instantly see the corresponding network properties.

Understanding the Calculated Properties

Once an IP address and subnet mask are entered, the subnet range calculator displays a wide set of attributes. Below is an explanation of each.

IP Type – Public or Private

Three address ranges are reserved for private networks: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Any address outside these blocks is considered public and routable on the Internet.

IP Class (Historical)

Based on the first octet:

  • Class A: 0 – 127
  • Class B: 128 – 191
  • Class C: 192 – 223
  • Class D (multicast): 224 – 239
  • Class E (reserved): 240 – 255

Network Address

The very first address of the subnet. It is derived by AND‑ing the IP with the subnet mask and cannot be assigned to any host.

Broadcast Address

The last address in the subnet. Packets sent to this address are delivered to every host on the subnet.

Usable Host Range

The addresses between the network address and the broadcast address. The total number of usable hosts equals 2(32−prefix)−22^{(32 - \text{prefix})} - 2.

Wildcard Mask

The bitwise inversion of the subnet mask. Often used in access‑control lists (ACLs) and routing protocols.

Total Number of Addresses

Calculated as 2(32−prefix)2^{(32 - \text{prefix})}. This count includes the network and broadcast addresses.

Binary Representations

Both the IP address and the subnet mask are shown in dotted 8‑bit binary form – useful for manual verification and learning.

Integer and Hexadecimal Forms

The 32‑bit IP address can be expressed as a decimal integer (base 10) and in hexadecimal (base 16). For example, 192.168.86.42 becomes 3,232,257,578 and 0xC0A8562A.

Reverse DNS Pointer (in‑addr.arpa)

For reverse DNS lookups, the IP address is reversed and appended with .in‑addr.arpa. For instance, 192.168.86.42 produces 42.86.168.192.in‑addr.arpa.

IPv4‑Mapped IPv6 Address

This dual‑stack representation uses the prefix ::ffff: followed by the IPv4 address in hexadecimal or dotted‑decimal notation (e.g., ::ffff:c0a8:562a or ::ffff:192.168.86.42).

6to4 Prefix

A transition mechanism that embeds an IPv4 address into an IPv6 address. The prefix always starts with 2002: followed by the IPv4 address in hexadecimal, forming a /48 (e.g., 2002:c0a8:562a::/48).

Worked Example: 192.168.86.42 / 24

Let’s manually compute the key properties for this typical /24 network.

IP Type – 192.168.86.42 falls within the private range 192.168.0.0/16 → private.

IP Class – The first octet (192) places it in Class C.

Network Address

  • IP binary: 11000000.10101000.01010110.00101010
  • Mask binary: 11111111.11111111.11111111.00000000
  • AND result: 11000000.10101000.01010110.00000000 → 192.168.86.0

Total Addresses

2(32−24)=28=2562^{(32-24)} = 2^{8} = 256

Broadcast Address Network address + total addresses – 1 = 192.168.86.0 + 255 = 192.168.86.255

Usable Host Range 256 – 2 = 254 addresses → first usable 192.168.86.1, last usable 192.168.86.254.

Wildcard Mask Invert mask → 00000000.00000000.00000000.11111111 → 0.0.0.255

Integer / Hex

  • Decimal: 192×2563+168×2562+86×256+42=3,232,257,578192 \times 256^{3} + 168 \times 256^{2} + 86 \times 256 + 42 = 3,232,257,578
  • Hexadecimal: 0xC0A8562A

Reverse DNS Pointer 42.86.168.192.in‑addr.arpa

IPv4‑Mapped IPv6 ::ffff:c0a8:562a or ::ffff:192.168.86.42

6to4 Prefix 2002:c0a8:562a::/48

Manually calculating all these values is tedious and error‑prone. With this subnet mask calculator, you obtain the complete set of results instantly – perfect for network design, documentation, and exam preparation.

FAQ

1. How do I calculate the network address with this tool?

Simply enter the IP address and subnet mask (or CIDR prefix). The calculator performs a bitwise AND operation and displays the network address immediately.

2. What is the formula for the number of usable hosts in a subnet?

Usable hosts = 2^(32 - prefix) - 2, because the network address and broadcast address cannot be assigned to hosts. For example, a /24 gives 2^8 - 2 = 254 usable addresses.

3. Can this calculator handle IPv6 addresses?

It is designed for IPv4 networks. However, it also shows the IPv4-mapped IPv6 address and the 6to4 prefix, which are useful in IPv4-to-IPv6 transition scenarios.

4. What is a wildcard mask and how is it derived?

A wildcard mask is the bitwise inverse of the subnet mask. For a /24 mask (255.255.255.0), the wildcard mask is 0.0.0.255. It is commonly used in access control lists (ACLs).

5. How does CIDR differ from the older classful system?

Classful addressing only allowed /8, /16, or /24 prefixes. CIDR allows any prefix length from /1 to /32, offering much finer control over subnet sizes and improving address space efficiency.

How to Use

  1. Enter an IPv4 address in the input field (e.g., 192.168.1.42).
  2. Optionally filter by network class and select a subnet mask from the dropdown (e.g., /24 or 255.255.255.0).
  3. Read all network properties instantly - network address, broadcast address, host range, wildcard mask, binary forms, and IPv6 mappings.