liminfo

CIDR Subnet Calculator

Free web tool: CIDR Subnet Calculator

Network Address192.168.1.0
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Broadcast Address192.168.1.255
First Host192.168.1.1
Last Host192.168.1.254
Usable Hosts254
CIDR Notation/24

About CIDR Subnet Calculator

The CIDR Subnet Calculator takes an IPv4 address in CIDR notation (e.g., 192.168.1.0/24) and instantly computes every key subnet property: the network address, subnet mask, wildcard mask, broadcast address, first usable host, last usable host, and total usable host count. The prefix length determines the number of bits reserved for the network portion, and the remaining bits define the host space. All arithmetic is performed in pure JavaScript using 32-bit bitwise operations — no server round-trips, no delays.

Network engineers, system administrators, cloud architects, and students preparing for certifications like CCNA or CompTIA Network+ rely on subnet calculators daily. Subnetting is fundamental to IP address management (IPAM), VLAN design, firewall rule authoring, and cloud VPC/subnet configuration. This tool eliminates error-prone manual binary-to-decimal conversion and is particularly helpful when designing address schemes for dozens of subnets across multiple network tiers.

Technically, the tool parses the CIDR input, validates each IPv4 octet (0–255) and the prefix (0–32), then constructs a 32-bit integer for the IP and mask using left-shift operations. The network address is obtained with a bitwise AND between IP and mask; the broadcast address is derived by ORing the network with the inverted mask. For prefixes of /31 and /32, which are used for point-to-point links and loopback addresses, the tool correctly reports 2 or 1 total addresses with no "host" subtraction applied.

Key Features

  • Parses standard CIDR notation (e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.1.0/24)
  • Calculates network address, subnet mask, wildcard mask, and broadcast address
  • Shows first usable host and last usable host IP addresses
  • Displays total usable host count with locale-formatted number
  • Correct handling of /31 (point-to-point) and /32 (host route) edge cases
  • Real-time calculation — results update immediately as you type
  • 100% client-side JavaScript using 32-bit bitwise operations, no server required
  • Responsive card layout with clear label–value pairs for quick scanning

Frequently Asked Questions

What is CIDR notation?

CIDR stands for Classless Inter-Domain Routing. CIDR notation combines an IPv4 address and a prefix length with a slash (e.g., 192.168.1.0/24). The number after the slash indicates how many leading bits of the address belong to the network portion; the remaining bits identify individual hosts within that network.

How is the subnet mask calculated from the prefix length?

The prefix length specifies how many of the 32 IP address bits are set to 1 in the mask. For /24, the first 24 bits are 1 (255.255.255.0) and the last 8 bits are 0. The tool shifts a 32-bit all-ones value left by (32 − prefix) positions to generate the mask, then converts each 8-bit group to a decimal octet.

What is a wildcard mask and where is it used?

A wildcard mask is the bitwise inverse of the subnet mask. Where the subnet mask has 1s (fixed network bits), the wildcard has 0s, and vice versa. Wildcard masks are commonly used in Cisco ACL and OSPF configurations to specify which bits of an address must match and which are "don't care".

How many usable hosts does a /24 network have?

A /24 network has 256 total addresses (2^8). Two are reserved: the network address (all host bits = 0) and the broadcast address (all host bits = 1). That leaves 254 usable host addresses. The formula is 2^(32−prefix) − 2 for any prefix smaller than /31.

What is the difference between /30, /31, and /32?

A /30 has 4 addresses (2 usable hosts) and is the smallest subnet traditionally used for point-to-point links. A /31 (RFC 3021) has 2 addresses and is used for point-to-point links with no reserved network/broadcast addresses. A /32 represents a single host route — one specific IP address with no subnet.

How do I split a /24 into smaller subnets?

Each additional prefix bit halves the number of hosts but doubles the number of subnets. For example, splitting 192.168.1.0/24 into /25 gives two subnets (192.168.1.0/25 and 192.168.1.128/25), each with 126 usable hosts. Splitting into /26 gives four subnets with 62 usable hosts each.

What is the difference between a private and public IP range?

Private IP ranges (RFC 1918) are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These are not routable on the public Internet and are used internally in LANs, VPNs, and cloud VPCs. Public IPs are globally unique and assigned by regional Internet registries (RIRs).

Can I use this tool for IPv6 subnetting?

The current version supports IPv4 only. IPv6 uses 128-bit addresses with different subnetting conventions (e.g., /64 for most LANs). IPv6 support may be added in a future version.