X Xerobit

Subnet Calculator

Free subnet calculator and CIDR calculator for IPv4 networks. Enter an IP address with a CIDR prefix (192.168.1.0/24) or a dotted subnet mask (10.0.0.0 255.255.0.0) to instantly get the network address, broadcast address, usable host range, wildcard mask, and binary visualization. Detects private, loopback, CGNAT, and link-local ranges automatically.

Subnet calculator — quick reference

Here is a worked example using 192.168.1.0/24 — the most common home and small-office subnet:

FieldValue
Network address192.168.1.0
Subnet mask255.255.255.0
CIDR notation/24
Wildcard mask0.0.0.255
Broadcast address192.168.1.255
First usable host192.168.1.1
Last usable host192.168.1.254
Total addresses256
Usable hosts254

The network address (192.168.1.0) and broadcast address (192.168.1.255) are reserved — you cannot assign them to a device. That leaves 254 usable IP addresses for hosts.

How to use this subnet calculator

  1. Enter your IP address — type any IPv4 address, e.g., 10.0.0.1 or 172.16.5.0.
  2. Enter the prefix or mask — use CIDR notation (/24) or a dotted subnet mask (255.255.255.0). Both formats are accepted.
  3. Read the results — the calculator instantly shows network address, broadcast, first/last usable host, wildcard mask, total addresses, and usable hosts.
  4. Check the binary view — the binary visualization shows exactly which bits are network bits (fixed) and which are host bits (variable), making CIDR notation concrete.
  5. Note the IP class — the subnet calculator automatically identifies whether the address is private (RFC 1918), loopback, CGNAT, link-local, or public.

CIDR notation explained

CIDR (Classless Inter-Domain Routing) writes a network as address/prefix. The prefix is the count of leading 1-bits in the subnet mask, which determines how many bits identify the network versus the host.

The formula for usable hosts is 2h − 2, where h is the number of host bits. The −2 excludes the network address and broadcast address.

Common subnet masks — cheat sheet

CIDRSubnet maskWildcard maskUsable hostsCommon use
/32255.255.255.2550.0.0.01Single host / route
/31255.255.255.2540.0.0.12P2P link (RFC 3021)
/30255.255.255.2520.0.0.32Router-to-router link
/29255.255.255.2480.0.0.76Micro-segment
/28255.255.255.2400.0.0.1514Cloud VPC subnet
/27255.255.255.2240.0.0.3130Small department
/26255.255.255.1920.0.0.6362Medium VLAN
/25255.255.255.1280.0.0.127126Half a /24
/24255.255.255.00.0.0.255254Home / small office
/23255.255.254.00.0.1.255510Medium network
/22255.255.252.00.0.3.2551,022Campus segment
/20255.255.240.00.0.15.2554,094Large building
/16255.255.0.00.0.255.25565,534Enterprise / class B
/8255.0.0.00.255.255.25516,777,214ISP / class A
/00.0.0.0255.255.255.255allDefault route

Private IP ranges (RFC 1918)

These ranges are not routed on the public internet. They can be reused freely inside any private network:

Other reserved ranges: 100.64.0.0/10 (CGNAT — RFC 6598), 169.254.0.0/16 (link-local / APIPA), 127.0.0.0/8 (loopback — localhost).

Network, broadcast, and usable host range

Exception: /31 (RFC 3021) has no network or broadcast address — both addresses are usable for point-to-point links. /32 is a host route identifying exactly one address.

Wildcard mask

A wildcard mask is the bitwise inverse of the subnet mask. Cisco ACLs, OSPF area statements, and some firewall rules use wildcard masks rather than subnet masks. For /24 (mask 255.255.255.0), the wildcard is 0.0.0.255. A 0-bit means "must match exactly"; a 1-bit means "any value is accepted."

FAQ

What is a subnet calculator used for?

A subnet calculator takes an IP address and subnet mask (or CIDR prefix) and calculates the network boundaries: network address, broadcast address, first and last usable hosts, and total host count. Network engineers use it when planning IP address allocation, creating VLANs, configuring firewalls, or provisioning cloud subnets.

What is the difference between a subnet mask and CIDR notation?

They represent the same information in different formats. 255.255.255.0 (dotted decimal) and /24 (CIDR) both mean 24 network bits. CIDR notation is more compact; dotted-decimal masks are required by older network equipment and some config files.

How many usable hosts does a /24 subnet have?

A /24 subnet has 256 total addresses (28). Two are reserved — the network address (x.x.x.0) and the broadcast address (x.x.x.255). That leaves 254 usable hosts.

What is the difference between a /24 and a /16 subnet?

A /24 has 8 host bits → 254 usable hosts. A /16 has 16 host bits → 65,534 usable hosts. Every time you decrease the prefix by 1, the number of hosts doubles. A /16 is 256× larger than a /24.

Does this subnet calculator support IPv6?

Not yet. IPv6 uses 128-bit addresses and the same CIDR prefix logic, but the address space is vastly larger. IPv6 support is on the roadmap.

What is a wildcard mask and when do I need it?

A wildcard mask is the inverse of the subnet mask (255.255.255.255 minus the mask). You need it when writing Cisco IOS ACL entries and OSPF network statements. For a /24, the wildcard is 0.0.0.255. This subnet calculator shows the wildcard mask alongside the subnet mask in every result.

Related tools

Related articles

Part of Dev Productivity

This subnet calculator is part of the Dev Productivity toolset on Xerobit. Other useful tools: Timestamp Converter, HTTP Status Codes, Regex Tester.


Written by Mian Ali Khalid. Last updated 2026-05-12.