IP Address Lookup & Subnet Calculator

Calculate subnet details, validate IPv4 addresses, view binary representations, and determine private vs public ranges. All processing happens in your browser.

Enter an IP address and CIDR prefix above to calculate subnet details.

Common CIDR prefixes with their subnet masks, wildcard masks, and available host counts.

CIDR Subnet Mask Wildcard Mask Total Addresses Usable Hosts

Built-In Features

Complete Subnet Analysis

Get network address, broadcast address, subnet mask, wildcard mask, host range, and total usable hosts from any IP and CIDR prefix in a single calculation.

Binary IP Representation

View the full 32-bit binary breakdown of any IPv4 address, split by octet for easy reading. Understand exactly how each address maps to its binary form.

Private & Public Detection

Instantly determine whether an IP address falls within a private range (RFC 1918) or is a publicly routable address. Identifies the IP class (A, B, C, D, E) as well.

CIDR Reference Table

Quick-access table of all common CIDR prefixes from /8 to /32 with their subnet masks, wildcard masks, total addresses, and usable host counts.

Quick Start Guide

  1. Enter an IPv4 address in the IP Address field (for example, 192.168.1.0 or 10.0.0.1).
  2. Select the CIDR prefix length from the dropdown menu. Common choices include /24 for a standard LAN, /16 for a larger network, or /32 for a single host.
  3. Click "Calculate" or press Enter to generate the full subnet analysis including network address, broadcast address, mask details, and host range.
  4. Review the binary representation of your IP address shown below the results, and check whether the address is private or public.
  5. Switch to the "IP Validator" tab to check if any IPv4 address is syntactically valid.
  6. Use the "CIDR Reference" tab for a quick lookup of subnet masks and host counts for all common prefix lengths.
  7. Click the "Copy" button next to any result to copy it to your clipboard for use in configurations or documentation.
Pro Tip

Private IP ranges (10.x.x.x, 172.16-31.x.x, 192.168.x.x) are not routable on the public internet. If a lookup returns a private address, the request is coming from behind a NAT or proxy — you are seeing the internal network address, not the user's public IP.

Common Mistake

Relying on IP geolocation for precise user location. IP-based geolocation is accurate to the city level at best, and often only to the region or country level. VPNs, corporate proxies, and mobile carriers can place users in entirely different cities or countries.

Common Scenarios

Network Administrator

A network admin troubleshoots connectivity by looking up IP addresses from firewall logs. Identifying whether traffic originates from internal private ranges or external public IPs determines the correct troubleshooting path and escalation procedure.

Cloud Infrastructure Engineer

A cloud engineer designing AWS VPC networks uses CIDR calculations to size subnets correctly across availability zones. Under-sizing means running out of IP addresses; over-sizing wastes address space needed for future growth.

Security Operations Analyst

A SOC analyst investigates IDS alerts by looking up source IPs to determine if they belong to known cloud providers, residential ISPs, or Tor exit nodes. This context drives the severity assessment and incident response playbook selection.

Understanding IP Addressing and Subnetting

Internet Protocol version 4 (IPv4) addresses form the foundation of network communication across the internet and private networks. Every device connected to a network requires a unique IP address to send and receive data. An IPv4 address consists of 32 binary bits, typically represented as four decimal octets separated by dots, such as 192.168.1.100. Each octet ranges from 0 to 255, giving a total address space of roughly 4.3 billion unique addresses. While this seemed vast when the protocol was designed in the early 1980s, the explosive growth of connected devices has made efficient address allocation critical.

Subnetting is the practice of dividing a larger network into smaller, logically distinct segments called subnets. This is accomplished by borrowing bits from the host portion of an IP address and using them to create additional network identifiers. Subnetting serves several important purposes: it reduces broadcast traffic by confining broadcasts to smaller domains, improves security by isolating network segments from one another, makes network management more organized, and conserves IP addresses by allocating only the number of addresses each subnet actually needs rather than wasting entire classful blocks.

The subnet mask is a 32-bit value that accompanies every IP address. It uses consecutive 1-bits to mark the network portion and consecutive 0-bits for the host portion. For instance, the subnet mask 255.255.255.0 in binary is 24 ones followed by 8 zeros, indicating that the first three octets identify the network while the last octet identifies individual hosts. The wildcard mask is simply the bitwise inverse of the subnet mask and is used in router access control lists and routing protocol configurations to specify address ranges.

CIDR (Classless Inter-Domain Routing) replaced the original classful addressing system in 1993 to allow more flexible allocation of IP address space. Instead of being limited to fixed Class A, B, or C boundaries, CIDR lets administrators define subnets of any size using a prefix length. The notation 10.0.0.0/16 means the first 16 bits are the network prefix, leaving 16 bits for host addresses. This flexibility dramatically reduced address waste and slowed the exhaustion of the IPv4 address pool. CIDR also enables route aggregation, where multiple smaller networks can be advertised as a single routing entry, reducing the size of internet routing tables.

Every subnet has two reserved addresses that cannot be assigned to hosts. The network address is the first address in the range, formed by setting all host bits to zero. It identifies the subnet itself in routing tables. The broadcast address is the last address, formed by setting all host bits to one. Any packet sent to the broadcast address is delivered to all hosts on that subnet. The usable host range sits between these two addresses. For a /24 subnet, this means 256 total addresses minus the network and broadcast addresses equals 254 usable hosts.

Private IP address ranges are defined by RFC 1918 and are reserved for use within local networks. These three ranges are 10.0.0.0/8 (over 16 million addresses), 172.16.0.0/12 (about 1 million addresses), and 192.168.0.0/16 (65,536 addresses). Devices with private addresses communicate with the public internet through Network Address Translation (NAT), where a router maps private addresses to one or more public addresses. This design has been instrumental in extending the life of IPv4 by allowing millions of devices behind a single public address.

Understanding subnetting is a core skill for network administrators, systems engineers, cloud architects, and anyone working with IT infrastructure. Whether you are designing a corporate network, configuring firewall rules, setting up virtual private clouds in AWS or Azure, or troubleshooting connectivity issues, the ability to quickly calculate subnet boundaries, host ranges, and mask values is essential. This calculator handles all the binary arithmetic for you, providing instant and accurate results for any IPv4 address and CIDR prefix combination.

Frequently Asked Questions

What is a subnet mask and why is it important?

A subnet mask is a 32-bit number that divides an IP address into a network portion and a host portion. It determines which part of an address identifies the network and which part identifies a specific device. The mask consists of consecutive 1-bits for the network section followed by consecutive 0-bits for the host section. For example, 255.255.255.0 means the first 24 bits are the network and the remaining 8 bits are for hosts. Subnet masks are essential for routing traffic correctly between networks, segmenting large networks into smaller subnets, and controlling broadcast domains.

What is CIDR notation and how does it work?

CIDR (Classless Inter-Domain Routing) notation is a compact way to express an IP address together with its subnet mask. It appends a slash and a number to the IP address, such as 192.168.1.0/24. The number after the slash indicates how many of the 32 bits in the address belong to the network prefix. A /24 means the first 24 bits define the network, leaving 8 bits for host addresses (254 usable hosts). CIDR replaced the older classful system and allows networks to be divided at any bit boundary, not just at 8-bit octet boundaries, enabling much more efficient address allocation.

How do I calculate the number of usable hosts in a subnet?

The formula is 2^(32 - prefix length) - 2. The exponent represents the number of host bits, and the subtraction of 2 accounts for the network address (first address, all host bits zero) and the broadcast address (last address, all host bits one). For a /24 network, that is 2^8 - 2 = 254 usable hosts. For a /16 network, it is 2^16 - 2 = 65,534 usable hosts. Two special cases exist: a /31 subnet provides 2 usable addresses (used for point-to-point links per RFC 3021), and a /32 represents a single host address.

What is the difference between a network address and a broadcast address?

The network address is the first address in a subnet where all host bits are set to zero. It identifies the subnet itself and is used in routing tables to direct traffic to the correct network segment. The broadcast address is the last address in a subnet where all host bits are set to one. Packets sent to the broadcast address are delivered to every device on that subnet simultaneously. Neither address can be assigned to an individual host, which is why the usable host range falls strictly between these two addresses.

What are private IP address ranges?

Private IP ranges are defined by RFC 1918 and are reserved for internal network use. They are not routable on the public internet. The three ranges are: 10.0.0.0 to 10.255.255.255 (10.0.0.0/8, approximately 16.7 million addresses), 172.16.0.0 to 172.31.255.255 (172.16.0.0/12, approximately 1 million addresses), and 192.168.0.0 to 192.168.255.255 (192.168.0.0/16, 65,536 addresses). Devices using these addresses connect to the internet through NAT (Network Address Translation), which maps private addresses to public ones at the network boundary.

What is a wildcard mask and how is it used?

A wildcard mask is the bitwise inverse of a subnet mask. Where the subnet mask has a 1-bit, the wildcard mask has a 0-bit, and vice versa. For example, the subnet mask 255.255.255.0 has a wildcard mask of 0.0.0.255. Wildcard masks are primarily used in Cisco router access control lists (ACLs) and OSPF routing configurations. A 0-bit in the wildcard mask means the corresponding bit in the IP address must match exactly, while a 1-bit means that position can be any value. This makes wildcard masks powerful tools for defining flexible address matching rules.

What are IP address classes and are they still relevant?

IP address classes were the original system for dividing the IPv4 address space into fixed-size blocks. Class A (1.0.0.0 to 126.255.255.255) supports over 16 million hosts per network. Class B (128.0.0.0 to 191.255.255.255) supports about 65,000 hosts. Class C (192.0.0.0 to 223.255.255.255) supports 254 hosts. Class D (224.0.0.0 to 239.255.255.255) is reserved for multicast, and Class E (240.0.0.0 to 255.255.255.255) for experimental use. While classful addressing was replaced by CIDR in 1993 for routing purposes, the class labels remain useful as reference points for understanding address structure and default subnet boundaries.

Subnet Mask Quick Reference

CIDR (Classless Inter-Domain Routing) notation expresses a subnet mask as a prefix length appended to an IP address. The prefix length indicates how many leading bits define the network portion. This table covers the most commonly used subnet sizes from /8 through /30.

CIDR Subnet Mask Total IPs Usable Hosts Common Use
/8 255.0.0.0 16,777,216 16,777,214 Class A networks (10.0.0.0/8 private)
/12 255.240.0.0 1,048,576 1,048,574 Docker default network (172.16.0.0/12)
/16 255.255.0.0 65,536 65,534 AWS VPC default, large corporate networks
/20 255.255.240.0 4,096 4,094 AWS default subnet, medium deployments
/22 255.255.252.0 1,024 1,022 Multi-floor office buildings
/24 255.255.255.0 256 254 Most common LAN, home routers, small offices
/25 255.255.255.128 128 126 Split a /24 into two segments
/26 255.255.255.192 64 62 Small department, VLAN segmentation
/28 255.255.255.240 16 14 Small server cluster, DMZ
/30 255.255.255.252 4 2 Point-to-point router links
/32 255.255.255.255 1 1 Single host route, loopback, firewall rules

How to calculate usable hosts: The formula is 2^(32 - prefix) - 2. The two subtracted addresses are the network address (all host bits zero) and the broadcast address (all host bits one). For /31 and /32 subnets, RFC 3021 allows special handling: /31 provides 2 usable addresses for point-to-point links with no broadcast, and /32 represents a single specific host.

Related Tools

Sources & References