DigitHelm

IP Subnet Calculator | CIDR

Calculate subnet mask, network address, broadcast address, and usable hosts for any CIDR.

What Is the IP Subnet Calculator | CIDR?

This IP subnet calculator takes any IPv4 address and CIDR prefix (or dotted-decimal subnet mask) and computes the complete set of network information: network address, broadcast address, usable host range, total addresses, wildcard mask, and binary representation.

  • CIDR and dotted-decimal input: Enter as 192.168.1.100/24 or use separate IP and mask fields, both 255.255.255.0 and /24 notation accepted.
  • Full subnet breakdown: Network address, broadcast address, first/last usable host, usable host count, total addresses, and IP class.
  • Binary display: Shows the IP address and subnet mask in binary, essential for understanding which bits are the network vs host portions.
  • Private range detection: Flags RFC 1918 private addresses (10.x, 172.16–31.x, 192.168.x) automatically.
  • Subnet splitting: Shows how to divide the current network into two or more smaller subnets.
  • Wildcard mask: The inverse of the subnet mask, used in firewall ACLs and routing protocol configurations.

Formula

Core Subnet Formulas

Network address = IP AND Subnet Mask (bitwise AND)

Broadcast addr = Network OR (NOT Mask) (set all host bits to 1)

Host range = Network + 1 to Broadcast − 1

Usable hosts = 2^(32 − prefix) − 2

Total addresses = 2^(32 − prefix)

CIDR Notation

192.168.1.0/24 → prefix = 24, mask = 255.255.255.0

/24 means 24 consecutive 1-bits followed by 8 zero bits

CIDR PrefixSubnet MaskUsable HostsTotal Addresses
/24255.255.255.0254256
/25255.255.255.128126128
/26255.255.255.1926264
/16255.255.0.065,53465,536
/8255.0.0.016,777,21416,777,216

How to Use

  1. 1
    Enter an IP address: Type any IPv4 address in dotted-decimal format, e.g. 192.168.1.100.
  2. 2
    Enter the subnet: Type either a CIDR prefix (/24) or a full subnet mask (255.255.255.0). Both formats are accepted.
  3. 3
    Try CIDR notation: For convenience, enter IP and prefix as a single value: 10.0.0.1/16. The calculator parses both fields.
  4. 4
    Click Calculate: Results show network address, broadcast, host range, usable count, binary representation, and IP class.
  5. 5
    Check the binary view: Review the binary rows to see exactly which bits represent the network portion vs host portion.
  6. 6
    Plan your subnets: Use the subnet splitting section to see how to divide the network into smaller equal-size subnets.
  7. 7
    Reset to clear: Click Reset to clear all fields and start a new calculation.

Example Calculation

Subnet calculation for 192.168.10.50/26

IP: 192.168.10.50 CIDR: /26 Mask: 255.255.255.192

Binary of IP: 11000000.10101000.00001010.00110010

Binary of Mask: 11111111.11111111.11111111.11000000

Network bits (26): 11000000.10101000.00001010.00 (first 26 bits)

Host bits (6): 110010 (last 6 bits)

Network address: 192.168.10.0 (set host bits to 0)

Broadcast address: 192.168.10.63 (set host bits to 1)

Usable range: 192.168.10.1 – 192.168.10.62

Usable hosts: 2^6 − 2 = 62 Total: 2^6 = 64

Splitting a /24 into four /26 subnets

The /24 network 192.168.10.0/24 (254 hosts) can be divided into four equal /26 subnets of 62 hosts each: 192.168.10.0/26, 192.168.10.64/26, 192.168.10.128/26, and 192.168.10.192/26. Each extra bit added to the prefix halves the network and doubles the number of subnets.

Understanding IP Subnet | CIDR

What Is Subnetting?

Subnetting is the process of dividing a larger IP network into smaller sub-networks (subnets). Each subnet has its own network address, broadcast address, and range of host addresses. The subnet mask (or CIDR prefix) defines the boundary between the network and host portions of an IP address.

A longer prefix (larger number after the slash) means more bits are devoted to the network, leaving fewer for hosts, creating a smaller but more numerous set of subnets. A /30 has 2 usable hosts (point-to-point links); a /16 has 65,534.

CIDR vs Classful Networking

Before 1993, IPv4 addresses were divided into fixed Classes: Class A (/8, up to 16 million hosts), Class B (/16, up to 65,534 hosts), and Class C (/24, up to 254 hosts). This was extremely wasteful, an organisation needing 300 hosts had to use a Class B, wasting over 65,000 addresses.

CIDR (Classless Inter-Domain Routing) replaced this in RFC 1519, allowing any prefix length from /0 to /32. A company needing 300 hosts gets a /23 (510 hosts) instead of a /16, far less waste.

Private vs Public IP Addresses

  • 10.0.0.0/8, Class A private: 10.0.0.0 to 10.255.255.255 (16.7 million addresses)
  • 172.16.0.0/12, Class B private: 172.16.0.0 to 172.31.255.255 (1 million addresses)
  • 192.168.0.0/16, Class C private: 192.168.0.0 to 192.168.255.255 (65,536 addresses)
  • Private addresses are not routable on the public internet and require NAT for external access.

Common Subnetting Uses

  • LAN segmentation: separating different departments into isolated broadcast domains reduces congestion.
  • Security zoning: DMZ, internal, and guest networks use different subnets to enforce firewall policies.
  • VLAN assignment: each VLAN is typically mapped to its own subnet for routing purposes.
  • Point-to-point links: /30 subnets (2 usable hosts) for router-to-router connections conserve address space.
  • Cloud networking: VPC and subnet design in AWS, Azure, GCP all rely on CIDR subnetting.

Frequently Asked Questions

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation expresses both an IP address and its subnet mask in one compact form: IP/prefix. The prefix number is the count of leading 1-bits in the subnet mask.

Examples: /24 = 255.255.255.0 (24 ones), /16 = 255.255.0.0 (16 ones), /8 = 255.0.0.0 (8 ones). The notation 192.168.1.0/24 describes the network starting at 192.168.1.0 with 256 total addresses.

Why are only 2^n − 2 hosts usable?

Two addresses in every subnet are reserved and cannot be assigned to devices:

  • Network address: All host bits set to 0. Identifies the subnet itself (e.g., 192.168.1.0/24).
  • Broadcast address: All host bits set to 1. Sends a packet to all hosts on the subnet (e.g., 192.168.1.255).

The remaining 2^n − 2 addresses can be assigned to devices.

What are private IP address ranges (RFC 1918)?

RFC 1918 defines three private IPv4 address ranges not routable on the public internet:

  • 10.0.0.0/8 (10.0.0.0 – 10.255.255.255)
  • 172.16.0.0/12 (172.16.0.0 – 172.31.255.255)
  • 192.168.0.0/16 (192.168.0.0 – 192.168.255.255)

Devices using private IPs reach the internet through NAT (Network Address Translation), which maps private IPs to one or more public IPs.

What is a wildcard mask?

A wildcard mask is the bitwise complement of the subnet mask. Where the subnet mask has 1, the wildcard has 0, and vice versa.

Wildcard masks are used in Cisco IOS access control lists (ACLs) and OSPF network statements. A wildcard of 0.0.0.255 (matching /24) means "match any host in this /24 network."

How do I subnet a /24 network into smaller subnets?

Each extra bit added to the prefix halves the number of hosts and doubles the number of subnets:

  • /24 → 254 hosts in 1 subnet
  • /25 → 126 hosts in 2 subnets
  • /26 → 62 hosts in 4 subnets
  • /27 → 30 hosts in 8 subnets
  • /28 → 14 hosts in 16 subnets

The new subnets each increment the first host bit: /26 subnets of 192.168.1.0/24 are .0/26, .64/26, .128/26, .192/26.

What is the difference between IPv4 and IPv6 subnetting?

IPv4 uses 32-bit addresses (4 bytes), giving ~4.3 billion possible addresses. IPv6 uses 128-bit addresses, giving an astronomically larger space (3.4 × 10³⁸ addresses).

IPv6 subnetting still uses CIDR notation (/64, /48, etc.) but the scale is completely different. A /64 IPv6 subnet alone has more addresses than the entire IPv4 address space. This calculator covers IPv4 only.

What does the binary representation tell me?

The binary view shows each octet as 8 bits. The subnet mask has all 1s for the network bits and all 0s for the host bits.

Visually aligning the IP and mask binaries makes it obvious which part of the IP address determines the network (where mask = 1) and which part can vary for individual hosts (where mask = 0). This is the fundamental operation: Network = IP AND Mask.

Related Calculators