IP Subnet Calculator

INTERNET · IPv4 & CIDR SUBNETTING

Enter IPv4 address & subnet mask

Calculated on this device
Enter 4 dot-separated octets from 0 to 255, such as 192.168.1.42.
Enter a CIDR prefix from 0 to 32, such as 24 or /24.

NETWORK CIDR & USABLE RANGE

192.168.1.0/24

Usable hosts: 192.168.1.1 – 192.168.1.254 (254 usable / 256 total).

Formula Network = IP & Mask; Broadcast = Network | (~Mask)

Subnet Mask255.255.255.0/24 prefix
Wildcard Mask0.0.0.255Bitwise NOT of mask
Broadcast Address192.168.1.255Last address in block
IP Class & ScopeClass CPrivate (RFC 1918: 192.168.0.0/16)
PropertyDotted / ValueBinary Representation
IPv4 Address192.168.1.4211000000.10101000.00000001.00101010
Subnet Mask255.255.255.0 (/24)11111111.11111111.11111111.00000000
Network Address192.168.1.011000000.10101000.00000001.00000000
Usable Host Range192.168.1.1 – 192.168.1.254254 usable hosts
Broadcast Address192.168.1.255256 total addresses

HOW IT WORKS

IPv4 bitwise CIDR & subnetting math

IPv4 addresses are 32-bit unsigned integers. Applying a contiguous subnet mask via bitwise AND isolates the network prefix, while bitwise OR with the wildcard mask yields the broadcast address.

01

Derive Mask & Wildcard

A CIDR prefix /p sets the top p bits to 1 and the remaining 32 − p host bits to 0. The wildcard mask is the bitwise inverse.

Wildcard = ~Mask (unsigned 32-bit)
02

Compute Network & Broadcast

Bitwise AND of the IP and mask clears all host bits to find the network address; setting host bits to 1 produces the broadcast address.

Network = IP & Mask · Broadcast = Network | Wildcard
03

Count Usable Hosts

Standard subnets reserve network and broadcast addresses (2^(32−p) − 2). Point-to-point /31 links (RFC 3021) allow 2 usable hosts, and /32 represents 1 host route.

Usable = Total − 2 (for /0–/30)

NETWORKING REFERENCE GUIDE

CIDR prefixes, private ranges, and special /31 & /32 routes

CIDR notation vs. dotted subnet masks

CIDR notation (such as /24) counts the contiguous leading 1-bits in the 32-bit mask, while a dotted mask (such as 255.255.255.0) writes those same 32 bits as four octets. Use the mode tabs above to enter whichever format your router, firewall, or cloud VPC displays.

RFC 1918 private vs. public IPv4 blocks

The calculator automatically flags private ranges defined in RFC 1918 (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16) as well as special-purpose blocks like loopback (127.0.0.0/8), link-local (169.254.0.0/16), and CGNAT (100.64.0.0/10).

Related internet & utility tools

Securing servers or admin consoles on your new subnet? Generate strong credentials with our Password Generator. For binary or percentage math, check the Percent Calculator and Scientific Calculator.

Frequently asked questions

Why does a /24 subnet have 254 usable hosts instead of 256?

In standard IPv4 subnetting, the first address (.0) is reserved as the network identifier and the last address (.255) is reserved as the broadcast address, leaving 254 assignable host addresses.

How are /31 subnets handled?

Under RFC 3021, /31 subnets are used for point-to-point router links where both addresses are usable without a separate broadcast address.

What is a wildcard mask used for?

A wildcard mask is the bitwise inverse of the subnet mask (for example, 0.0.0.255 for a /24) and is commonly used in router ACLs and OSPF network statements.

Why is 255.0.255.0 rejected as a subnet mask?

Valid CIDR subnet masks must consist of contiguous 1-bits followed by contiguous 0-bits. Non-contiguous masks like 255.0.255.0 violate CIDR rules.

Your IPv4 addresses and subnet masks are calculated locally in this browser and are never sent to a server.