IP Subnet Calculator

Calculate subnet information from IP address and CIDR notation. Get network address, subnet mask, broadcast address, usable IP range, and number of hosts for IPv4 networks.

Enter IPv4 address (e.g., 192.168.1.0)

Number of network bits (1-32)

Subnet Mask = First CIDR bits set to 1. Network Address = IP AND Mask. Broadcast = Network OR (NOT Mask). Usable Hosts = 2^(32-CIDR) - 2. First Usable = Network + 1. Last Usable = Broadcast - 1
192.168.1.0/24: Network = 192.168.1.0, Mask = 255.255.255.0, Broadcast = 192.168.1.255, Usable = 192.168.1.1 to 192.168.1.254 (254 hosts), Class C Private

What is an IP subnet and why do we need subnetting?

Subnet divides a large network into smaller sub-networks. Benefits: Better organization (separate departments, floors, buildings), improved security (isolate sensitive systems), reduced broadcast traffic (fewer devices per subnet = better performance), efficient IP use (allocate IPs based on actual needs). Example: Company has 192.168.1.0/24 (256 IPs). Create 4 subnets: IT dept /26 (64 IPs), Sales /26, HR /27 (32 IPs), Guest /27. Subnet mask determines network and host portions. Default classes: Class A /8, Class B /16, Class C /24. CIDR notation replaces classes (192.168.1.0/24 = 256 addresses).

How do you calculate subnet mask from CIDR notation?

CIDR /X means X bits are network portion, remaining are host. Total 32 bits in IPv4. /24: First 24 bits = network (11111111.11111111.11111111.00000000 = 255.255.255.0). /26: First 26 bits = network (255.255.255.192). Formula: Hosts = 2^(32-CIDR) - 2. Subtract 2 for network address and broadcast. Example: /24 = 2^(32-24) - 2 = 254 usable hosts. /26 = 2^6 - 2 = 62 hosts. /30 = 2 hosts (point-to-point links). /32 = 1 IP (single host). Common: /24 = 254 hosts, /25 = 126, /26 = 62, /27 = 30, /28 = 14, /29 = 6, /30 = 2.

What are network address, broadcast address, and usable range?

Network address: First IP in subnet, identifies the network (all host bits = 0). Cannot assign to devices. Example: 192.168.1.0/24 → network = 192.168.1.0. Broadcast address: Last IP, sends to all devices in subnet (all host bits = 1). Cannot assign. Example: 192.168.1.255. Usable range: IPs between network and broadcast. Example: 192.168.1.1 to 192.168.1.254 (254 IPs). Gateway: Typically first usable IP (192.168.1.1). DHCP range: Reserve some IPs for static (servers, printers). Example: Static 1-50, DHCP 51-254. Calculate: Network AND subnet mask. Broadcast OR inverted mask.

How do you subnet a network into smaller subnets?

Steps: Determine requirements (number of subnets needed, hosts per subnet). Calculate bits: Subnets = 2^borrowed_bits. Borrow from host portion. Example: Need 4 subnets from 192.168.1.0/24. Borrow 2 bits (2^2=4). New mask /26 (255.255.255.192). Each subnet has 62 hosts. Subnets: 192.168.1.0/26 (0-63), 192.168.1.64/26 (64-127), 192.168.1.128/26 (128-191), 192.168.1.192/26 (192-255). Usable: .1-.62, .65-.126, .129-.190, .193-.254. Variable-length (VLSM): Different subnet sizes. Largest first, then subdivide. Example: Need 100, 50, 20 hosts → use /25, /26, /27.

What is the difference between IPv4 and IPv6 subnetting?

IPv4: 32 bits (4.3 billion addresses), running out globally. Format: 192.168.1.1. Subnetting common due to scarcity. Private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. NAT translates private to public. IPv6: 128 bits (340 undecillion addresses), virtually unlimited. Format: 2001:0db8:85a3::8a2e:0370:7334. Subnetting: Standard /64 for LANs (18 quintillion hosts!). ISP gives /48 or /56. No NAT needed (every device gets public IP). Simpler: Always /64 subnets, no complex calculations. Adoption: Gradual transition, dual-stack networks run both. IPv6 solves address exhaustion but IPv4 still dominant.