IPv4/IPv6 Subnet Calculator & CIDR Utility

CIDR subnet math, binary bit visualization, and IPv4/IPv6 range breakdown.

The Subnet Calculator handles CIDR notation arithmetic for IPv4 and IPv6 addresses. It returns the network address, broadcast address, usable host range, subnet mask, wildcard mask, binary representation with split bit coloring, and address class detection.

Subnet Calculator

How to Use

Work through these steps in order. Use this tool for educational and ethical purposes only.

1Select Subnet Calculator from the tool navigation.
2Enter an IP address with CIDR notation (e.g., 192.168.1.50/26).
3Click Calculate. Results appear instantly with no API call.
4Review the Network Address, Broadcast Address, and Usable Host Range.
5Check the Total Hosts and Usable Hosts count. For IPv4 subnets, usable is always two less than total.
6Study the Binary Visualization panel where network bits and host bits are highlighted in different colors.
7Review the Address Class (A, B, C, D, or E) and whether the address falls in a private RFC 1918 range.
8Use the Neighbor Subnets panel to see the previous and next adjacent subnets at the same prefix length.

What Is Subnetting?

The Problem Subnetting Solves

IP addresses are finite. In the early internet, every organization received a full Class A, B, or C block regardless of actual need. A company needing 300 hosts received a Class B with over 65,000 addresses, a massive waste that accelerated IPv4 exhaustion.

Subnetting divides a single IP block into smaller, logically separate segments. Each subnet operates as its own broadcast domain. Devices on one subnet cannot directly broadcast to devices on another; a router must forward traffic between them.

CIDR vs. Classful Networks

Classful networking assigned fixed prefix lengths based on leading bits:

  • Class A: /8 prefix, 16,777,214 hosts
  • Class B: /16 prefix, 65,534 hosts
  • Class C: /24 prefix, 254 hosts

Classless Inter-Domain Routing (CIDR), introduced in 1993, replaced this with variable-length subnet masking (VLSM). A /23 prefix spans two Class C blocks and delivers 510 usable addresses, a practical fit for a mid-sized office floor or cloud subnet tier.

CIDR notation appends the prefix length after a slash: 10.0.0.0/8, 172.16.0.0/12, 192.168.1.0/24. The prefix length defines how many leading bits are the Network ID; the rest form the Host ID.

Why the Subnet Mask Matters

The subnet mask is a 32-bit value where all network bits are 1 and all host bits are 0. For a /23:

Netmask: 255.255.254.0

Binary:  11111111.11111111.11111110.00000000

A router ANDs the destination IP with this mask to determine which subnet a packet belongs to. Getting the mask wrong by even one bit routes traffic to the wrong network.

Broadcast Domains and Traffic Segmentation

Every subnet reserves two addresses: the network address (all host bits = 0) and the broadcast address (all host bits = 1). Neither can be assigned to a host. For a /23 block starting at 192.167.0.0:

  • Network address: 192.167.0.0
  • Broadcast address: 192.167.1.255
  • Usable hosts: 192.167.0.1 through 192.167.1.254, exactly 510 addresses

Proper segmentation limits broadcast traffic, enforces security zone boundaries, and keeps routing tables manageable.

Common Subnetting Mistakes

Misusing /31 and /32 Prefixes

/32 is a host route identifying exactly one IP address with no network or broadcast. Use it to advertise a loopback or specific host in a routing table. Assigning a /32 as a network segment is a common misconfiguration since it has zero usable hosts.

/31 subnets, defined in RFC 3021, are valid for point-to-point router links only. They contain exactly two addresses with no broadcast overhead. Using a /31 for anything other than a router-to-router link is a mistake, and older equipment may reject /31 assignments outright.

Overlapping Networks

Overlapping subnets occur when two ranges share IP addresses. Assigning 10.0.1.0/24 to a production VLAN and 10.0.0.0/22 to a VPN pool creates an overlap since the /22 already contains 10.0.1.0/24. Traffic destined for production hosts may route into the VPN tunnel instead.

Always run a subnet calculator before allocating address space. If the usable range of a new subnet falls inside an existing one, you have a conflict.

Broadcast Address Confusion

Assigning the broadcast address to a host is one of the most common manual IP configuration errors. The broadcast address sends a single packet to all hosts on the segment simultaneously. A workstation configured with it will receive all broadcast traffic and may disrupt the entire subnet.

The tool outputs the broadcast address explicitly. Cross-check it against your DHCP pool. Your scope must end at or before the second-to-last address in the subnet.

Forgetting Reserved Address Overhead

A /24 has 256 total addresses but only 254 usable hosts. A /30 has 4 total addresses and only 2 usable. At small prefix lengths, this overhead is significant. Always read the Total Hosts field from the calculator rather than the raw power-of-two value.

Misidentifying Public vs. Private Ranges

The tool’s Network Context banner flags this immediately. A subnet like 192.167.1.0/23 is publicly routable. Internal infrastructure should use RFC 1918 space: 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16.

Subnets in Real Environments

Cloud VPCs (AWS, Azure, GCP)

Every major cloud provider structures its virtual networks around CIDR blocks. In AWS, a VPC accepts a primary CIDR between /16 and /28. AWS reserves the first four and last address in every subnet, five addresses total, so account for this when sizing. A standard pattern uses a /16 VPC divided into /24 subnets, one per Availability Zone per tier. A three-tier, three-AZ deployment needs nine /24 subnets, each with 251 usable host addresses after reservations.

Corporate LAN Design

Enterprise networks use hierarchical subnetting aligned to physical or logical boundaries: building, floor, department, or security zone. A typical allocation might look like this:

Segment

CIDR

Usable Hosts

Core Infrastructure

10.0.0.0/24

254

Server VLAN

10.0.1.0/24

254

User Workstations, Floor 1

10.0.10.0/23

510

User Workstations, Floor 2

10.0.12.0/23

510

Guest Wi-Fi

10.0.50.0/24

254

Management OOB

10.0.100.0/28

14

Point-to-Point WAN Links

10.0.200.0/30

2 each

Running each subnet through the calculator before deployment validates the mask, confirms the broadcast address, and documents the usable range for IPAM systems and firewall rule configs.

VPN Tunnels and Split Tunneling

Split-tunnel VPNs send only traffic destined for corporate subnets through the tunnel. If the mask on the VPN client does not match the gateway, the client either fails to reach corporate resources or tunnels all internet traffic unexpectedly.

For site-to-site VPNs, both endpoints must agree on the exact network address and prefix length. A mismatch of even one bit, 255.255.254.0 vs. 255.255.255.0, causes asymmetric routing or dead routes.

DFIR and OSINT Use Cases

In incident response, correlating IP addresses from logs to subnet ownership is standard. If an attacker moves between 192.168.1.45 and 192.168.2.200, knowing whether those addresses share a subnet tells you whether the movement required compromising a router or could have happened at Layer 2.

In OSINT, identifying whether a target IP falls inside a cloud provider’s published CIDR block helps attribute infrastructure. Paste any IP in CIDR notation to see the full network context and binary breakdown.

Technical Details

All calculations run locally using PHP bitwise operations. No API call is made, so results are instant regardless of network conditions.

For IPv4, the tool computes: network address (IP AND mask), broadcast address (network OR inverted mask), first usable host (network + 1), last usable host (broadcast – 1), total host count (2^host_bits), and usable count (total – 2).

The binary visualization renders all 32 bits of the IP address and subnet mask in parallel rows. Network bits are colored separately from host bits, which makes prefix length intuitive for training and audit documentation.

IPv6 prefix calculation uses PHP’s GMP extension for correct 128-bit arithmetic. Address class detection covers Classes A through E plus RFC 1918 private ranges.

Typical use cases: network design, firewall ACL planning, subnetting training, and IP address management checks.

Pros & Cons

ProsCons
✓ All calculations are local, so there are no API keys, rate limits, or connectivity requirements✗ Does not produce a full VLSM allocation table for complex network designs
✓ Binary visualization with split bit coloring makes CIDR concepts easier to teach and document✗ IPv6 output lacks the depth of IPv4, since concepts like broadcast do not apply directly
✓ Handles both IPv4 and IPv6 with correct prefix length arithmetic✗ IP range export to CSV is not available from the interface

Related Network Intelligence Tools

Frequently Asked Questions

CIDR notation expresses a network as an address followed by a slash and prefix length, for example 192.168.1.0/24. The prefix length (24 here) indicates how many of the 32 bits identify the network. The remaining bits identify hosts. A /24 gives 254 usable addresses; a /16 gives 65,534.

The network address is the first address in a subnet, all host bits set to zero. It identifies the subnet itself and cannot be assigned to a host. The broadcast address is the last address, all host bits set to one. Traffic sent to it reaches every host on the subnet. Both are reserved, which is why a /24 has 254 usable hosts instead of 256.

A /23 provides 510 usable host addresses. Total address space is 2^(32-23) = 512. Subtract 2 for the network and broadcast addresses and 510 remain. The usable range spans two consecutive /24 blocks, for example 192.167.0.1 through 192.167.1.254.

A /30 has 4 addresses: 1 network, 2 usable hosts, 1 broadcast. It is the traditional choice for point-to-point router links. A /31, defined in RFC 3021, has only 2 addresses with no broadcast, both usable for point-to-point links, saving two addresses per link. Use /30 if device compatibility is uncertain since /31 is not universally supported.

Perform a bitwise AND between the host IP and the subnet mask. For host 192.167.1.45 with mask 255.255.254.0: AND each octet, 192 & 255 = 192, 167 & 255 = 167, 1 & 254 = 0, 45 & 0 = 0, giving a network address of 192.167.0.0. Alternatively, enter the host IP in CIDR notation (e.g., 192.167.1.45/23) and read the Network Address field directly.

Ready to Collaborate?

For Business Inquiries, Sponsorship's & Partnerships

(Response Within 24 hours)

Scroll to Top