Subnet Calculator

Enter an IPv4 address and CIDR prefix to instantly calculate the network range, broadcast address, usable hosts, subnet mask and more.

/
or enter subnet mask:
Enter the IP address and CIDR prefix length (0–32), or type a dotted subnet mask instead.
172.16.0.0/12
Class B
/12 prefix
🔒 Private Range
1,048,574 usable hosts
Network / CIDR
172.16.0.0/12
IPv4
Network Addr
172.16.0.0
Broadcast
172.31.255.255
Subnet Mask
255.240.0.0
Wildcard Mask
0.15.255.255
IP Class
Class B Private
Input IP
172.16.0.0
↻ Reset
Host Range & Address Count
172.16.0.0
Network
Usable Hosts
172.31.255.255
Broadcast
First Usable Host
172.16.0.1
Last Usable Host
172.31.255.254
1,048,574
Usable host addresses
Total Addresses
1,048,576
Prefix Length
/12
Binary Representation
Show ▼
IP Address
10101100.00010000.00000000.00000000
172.16.0.0
Subnet Mask
11111111.11110000.00000000.00000000
255.240.0.0
Network Address
10101100.00010000.00000000.00000000
172.16.0.0
Purple bits = network portion  ·  Green bits = host portion
Full Subnet Details
Show ▼
CIDR Notation
172.16.0.0/12
Network Address
172.16.0.0
Subnet Mask
255.240.0.0
Wildcard Mask
0.15.255.255
Broadcast Address
172.31.255.255
First Usable Host
172.16.0.1
Last Usable Host
172.31.255.254
Usable Hosts
1,048,574
Total Addresses
1,048,576
Prefix Length
/12
IP Class
Class B
Private Range
Yes (RFC 1918)
Network (decimal)
2886729728
Broadcast (decimal)
2887778303
Input IP (decimal)
2886729728
⚡ Instant calculation
✓ IPv4 CIDR & subnet mask
🔒 No sign-up needed

FAQs About Subnetting & CIDR

What is a subnet and why does subnetting matter?

A subnet (subnetwork) is a logically partitioned segment of a larger IP network. Subnetting divides one big address block into multiple smaller, purpose-specific networks. It was developed as a practical answer to the exhaustion of IPv4 addresses — rather than handing out entire Class A, B or C blocks regardless of how many devices an organisation actually needs, subnetting lets administrators carve out precisely sized networks. Beyond address conservation, subnetting contains broadcast traffic within smaller segments, strengthens security by isolating departments or device classes behind routers and firewalls, and simplifies fault isolation and capacity planning. To investigate which organisation controls any public IP block, use our ASN Lookup tool.

What does the CIDR prefix length mean?

CIDR stands for Classless Inter-Domain Routing. The prefix length (written as /N after the IP address) tells you how many of the 32 bits in an IPv4 address belong to the network portion. The remaining bits identify individual hosts within that network. A /24 prefix means the first 24 bits are the network, leaving 8 bits for hosts — giving 256 total addresses, of which 254 are usable (the first is the network address and the last is the broadcast address). A /16 gives 65,536 addresses; a /8 gives over 16 million. Shorter prefixes produce larger networks; longer prefixes produce smaller, more specific subnets. CIDR replaced the old classful system (Class A /8, B /16, C /24) with flexible prefix lengths from /0 to /32. You can verify how a domain resolves to an IP with our DNS Lookup tool, and look up its public IP details with What Is My IP.

What is the difference between the network address and broadcast address?

Every subnet reserves two addresses that cannot be assigned to hosts. The network address is the first address in the range — it identifies the subnet itself and appears in routing tables. The broadcast address is the last address — a packet sent here is delivered to every host in the subnet simultaneously. Everything in between is usable. For 192.168.1.0/24, the network address is 192.168.1.0, the broadcast is 192.168.1.255, and the 254 addresses from .1 to .254 are assignable to devices. For point-to-point /31 links (RFC 3021), both addresses are usable with no traditional broadcast. Once a network is live, use our Ping Test to verify connectivity and Port Checker to confirm that services are reachable on the correct hosts.

What is a subnet mask and how does it relate to the CIDR prefix?

A subnet mask is a 32-bit value with consecutive 1s for the network portion followed by consecutive 0s for the host portion. The subnet mask and CIDR prefix convey exactly the same information in different formats: a /24 prefix is identical to 255.255.255.0, and a /16 is 255.255.0.0. This calculator accepts either format — enter the CIDR prefix in the /N field, or type the dotted-decimal mask in the subnet mask field and the tool converts it automatically. The bitwise AND of any IP address with its subnet mask always yields the network address for that subnet.

What is a wildcard mask and when is it used?

A wildcard mask is the bitwise complement of a subnet mask. Where the subnet mask has 1s, the wildcard has 0s, and vice versa. A /24 subnet mask of 255.255.255.0 produces a wildcard mask of 0.0.0.255. Wildcard masks are used primarily in Cisco IOS access control lists (ACLs) and OSPF network statements, where a 0 bit means “must match” and a 1 bit means “any value allowed.” This lets a single ACL entry match an entire subnet or a specific pattern of addresses. After configuring ACLs, use our Port Checker to verify which ports remain open and HTTP Headers to confirm that web servers are responding correctly.

What are private IP address ranges and why do they matter?

Three IPv4 ranges are reserved for private use by RFC 1918 and are not routable on the public internet: 10.0.0.0/8 (over 16.7 million addresses), 172.16.0.0/12 (about 1 million addresses) and 192.168.0.0/16 (65,536 addresses). Home routers, corporate LANs and data centre internal networks all assign addresses from these ranges. When devices on private networks need to reach the internet, the router performs NAT (Network Address Translation) to map private addresses to a shared public IP. To see what your public-facing IP address is and which ISP it belongs to, use our What Is My IP tool. To look up the WHOIS registration of any public IP block, try our WHOIS Lookup.

How do I choose the right prefix length for my network?

Start with the maximum number of devices the subnet must support, add 20–30% headroom for growth, then choose the smallest prefix that provides enough usable addresses. A /28 supports 14 hosts, a /27 supports 30, a /26 supports 62, a /25 supports 126, a /24 supports 254, and so on. For point-to-point links between two routers, a /30 (2 usable hosts) or /31 (RFC 3021, no broadcast) is the standard choice. Variable Length Subnet Masking (VLSM) lets you use different prefix lengths for different subnets within the same address space to minimise waste. After subnetting is complete, use our DNS Lookup to verify that DNS records resolve correctly, and our SSL Checker to confirm that HTTPS certificates are valid on your hosts.

What do /30, /31 and /32 subnets mean?

These ultra-small subnets each have a specific use. A /30 provides 4 total addresses (2 usable) and is the traditional choice for point-to-point WAN links between routers. A /31, defined in RFC 3021, has only 2 addresses and drops the usual requirement for network and broadcast addresses — both are usable as host addresses, making it more efficient for point-to-point links. A /32 represents a single host and is used for loopback addresses, exact host routes in routing tables, and firewall rules that target one specific IP. To find the hostname associated with any single IP, use our Reverse DNS tool. To verify that a specific port is open on that host, use the Port Checker.

How can I find the ASN or ISP that owns an IP block?

Every public IP address belongs to exactly one Autonomous System (AS), which is a collection of IP ranges managed by a single organisation such as an ISP, cloud provider or large enterprise. Our ASN Lookup tool lets you enter any IP or ASN to see the operator name, country, and full list of IP prefixes it controls. For detailed registration information including contact data and abuse contacts, use our WHOIS Lookup. For geographic location data derived from an IP address, use our IP Geolocation tool.

How does subnetting relate to MAC addresses?

While subnetting operates at Layer 3 (the IP network layer), MAC addresses operate at Layer 2 (the data link layer). Within a single subnet, devices communicate by mapping IP addresses to MAC addresses using ARP (Address Resolution Protocol). The MAC address identifies the physical network interface of a device, while the IP address within the subnet identifies its logical position on the network. If you find an unknown MAC address on your network and need to identify the device manufacturer, use our MAC Address Lookup tool to trace it to its vendor.

More Network Tools on Convixy

Our full suite of free network utilities covers every common networking task: