The formula calculates host addresses by raising 2 to the power of host bits (32 minus CIDR prefix), then subtracting 2 for the reserved network and broadcast addresses.
Worked Examples
Example 1: Basic Subnet Calculation
Problem: Calculate subnet details for 192.168.10.50/24
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 reserved for the network address and the last for broadcast. Examples: /24 = 2^8 - 2 = 254 hosts. /25 = 2^7 - 2 = 126 hosts. /26 = 2^6 - 2 = 62 hosts. Exception: /31 and /32 subnets. /31 (point-to-point links per RFC 3021) has 2 usable addresses. /32 represents a single host. These special cases are used in specific scenarios.
What's the difference between subnet mask and wildcard mask?
Subnet mask marks network bits with 1s and host bits with 0s (e.g., 255.255.255.0). Wildcard mask is the inverse - 0s for network, 1s for hosts (e.g., 0.0.0.255). Subnet masks are used in IP configuration. Wildcard masks are used in access control lists (ACLs) and routing protocols like OSPF. To convert: wildcard = 255.255.255.255 - subnet mask. Wildcard masks define which bits to match (0) and which to ignore (1).
How do I subnet a network into smaller segments?
To subnet, increase the CIDR number (borrow bits from host portion). A /24 network (256 addresses) can be split into: 2 /25 networks (128 addresses each), 4 /26 networks (64 each), 8 /27 networks (32 each), etc. Each additional bit doubles the number of subnets while halving hosts per subnet. Example: Split 192.168.1.0/24 into /26 subnets: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26, 192.168.1.192/26 (62 usable hosts each).
What is supernetting (CIDR aggregation)?
Supernetting combines multiple smaller networks into one larger network by decreasing the CIDR number (opposite of subnetting). This reduces routing table size through route summarization. Example: 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24, 192.168.3.0/24 can be summarized as 192.168.0.0/22 (one route instead of four). Requirements: Networks must be contiguous and the count must be a power of 2. Supernetting is essential for internet routing efficiency.
What's the difference between network ID and IP address?
An IP address identifies a specific device on a network. The network ID (network address) identifies the subnet itself - it's the first address where all host bits are 0. For 192.168.1.100/24: IP is 192.168.1.100 (specific device), Network ID is 192.168.1.0 (the subnet). Network ID cannot be assigned to a device. Routers use network IDs to determine where to forward packets. The subnet mask separates network and host portions of any IP in that range.
How do I determine if two IPs are on the same subnet?
Apply the subnet mask (AND operation) to both IP addresses. If the results match, they're on the same subnet. Example with /24: IP1: 192.168.1.50, IP2: 192.168.1.200. Apply mask 255.255.255.0: Both give 192.168.1.0 - same subnet. IP3: 192.168.2.50 gives 192.168.2.0 - different subnet. For /25: 192.168.1.50 (mask 255.255.255.128) = 192.168.1.0. 192.168.1.200 = 192.168.1.128 - different subnets!
Background & Theory
The IP Subnet Calculator - CIDR Network Calculator applies the following established principles and formulas.
Computers represent all information using binary, a base-2 number system consisting solely of the digits 0 and 1, each called a bit. Because long binary strings are unwieldy, programmers routinely use octal (base 8) and hexadecimal (base 16) as compact shorthand. Converting between bases follows a consistent algorithm: divide the source number repeatedly by the target base, collecting remainders in reverse order. Hexadecimal digits A through F represent the values 10 through 15, allowing a single character to encode four binary bits, making it the preferred notation for memory addresses, color codes, and bytecode.
Bitwise operations manipulate individual bits within integers. AND produces a 1 only when both input bits are 1, making it useful for masking. OR produces a 1 when either bit is 1 and is used for combining flags. XOR flips bits that differ, enabling simple toggle logic and efficient swap algorithms. NOT inverts every bit (one's complement), while left and right shifts multiply or divide by powers of two in constant time.
Data storage units ascend in binary multiples of 1024: 8 bits form one byte, 1024 bytes form one kibibyte (KiB), 1024 KiB form one mebibyte (MiB), and so forth. Hard-drive manufacturers historically use decimal prefixes (1 KB = 1000 bytes), creating the persistent confusion between binary and decimal interpretations of the same label. The IEC standardized the binary prefixes KiB, MiB, GiB, and TiB in 1998 to resolve this ambiguity.
Network bandwidth is measured in bits per second (bps), most commonly megabits per second (Mbps) or gigabits per second (Gbps). A 100 Mbps connection transfers 100 million bits every second, equating to roughly 12.5 megabytes per second. IP subnet masks define network boundaries; CIDR notation appends a prefix length (e.g., /24) to an address, indicating how many leading bits are fixed. A /24 subnet contains 256 addresses with 254 usable hosts.
Algorithm efficiency is described using Big-O notation, which characterises the worst-case growth of time or space relative to input size. O(1) is constant, O(log n) is logarithmic (binary search), O(n) is linear, and O(nยฒ) is quadratic. Cryptographic hash functions like SHA-256 produce a fixed 256-bit (32-byte) digest regardless of input length. File compression algorithms exploit statistical redundancy to reduce storage footprint, and compression ratio equals the original file size divided by the compressed size.
History
The history behind the IP Subnet Calculator - CIDR Network Calculator traces back through the following developments.
The conceptual foundation of modern computing traces back to Charles Babbage, whose Analytical Engine design of 1837 introduced the idea of a general-purpose mechanical computer with separate storage and processing units, including what he called the Store and the Mill. Ada Lovelace wrote what many consider the first algorithm intended for machine execution while annotating a translation of Luigi Menabrea's account of Babbage's work, also recognising the machine's potential to manipulate symbols beyond mere numbers.
George Boole published "The Laws of Thought" in 1854, formalising a two-valued algebra of logic that would later map perfectly to electrical circuits. It remained largely a mathematical curiosity until Claude Shannon's landmark 1937 master's thesis demonstrated that Boolean algebra could describe switching circuits, laying the theoretical groundwork for all digital electronics.
Shannon's 1948 paper "A Mathematical Theory of Communication" defined the bit as the fundamental unit of information and established information theory as a rigorous discipline. The same year, the transistor was invented at Bell Labs by Bardeen, Brattain, and Shockley, eventually replacing vacuum tubes and enabling miniaturisation at scale. ENIAC, completed in 1945, was one of the first general-purpose electronic computers, occupying 1800 square feet and consuming 150 kilowatts of power while performing roughly 5000 additions per second.
The ASCII standard was ratified in 1963, assigning 7-bit codes to 128 characters and enabling interoperability between computers from different manufacturers. Through the 1970s, the microprocessor consolidated an entire CPU onto a single chip; Intel's 4004 in 1971 marked the beginning of this trend. The Apple II launched in 1977 and the IBM PC in 1981 brought computing to homes and offices, triggering a mass-market software industry.
Tim Berners-Lee proposed the World Wide Web in 1989 and launched the first website in 1991 at CERN, transforming the internet from an academic and military network into a global information infrastructure. Mobile computing accelerated through the 2000s with smartphones integrating powerful processors, wireless networking, and GPS into pocket-sized devices, extending computation into every facet of daily life and cementing TCP/IP as the universal communications fabric.
Essential site storage stays on. Analytics, performance, and marketing cookies remain off until you choose. Calculator inputs stay on your device, and we do not sell your personal data.
We use essential cookies only. Analytics cookies require your consent.