Subnet Calculator

Enter any IPv4 address and CIDR prefix to instantly calculate the network address, broadcast address, usable host range, subnet mask, wildcard mask and binary representation.

/
Enter an IPv4 address and prefix /0–/32 — e.g. 192.168.1.0/24 or any host address like 10.0.5.37/22
Quick examples
Results for  192.168.1.0/27
/27 · 30 hosts
192.168.1.0
Network Address
192.168.1.31
Broadcast Address
30
Usable Hosts
255.255.255.224
Subnet Mask
CIDR Block
192.168.1.0/27
IPv4 /27 · Class C
Input IP
192.168.1.0
Network
192.168.1.0
Broadcast
192.168.1.31
Mask
255.255.255.224
Wildcard
0.0.0.31
Type
Class C Private
New Calc
Usable Host Range
192.168.1.1
to
192.168.1.30
30 usable hosts
First Host
192.168.1.1
Last Host
192.168.1.30
Usable
30 hosts
Total IPs
32 addresses
Prefix
/27 (5 host bits)
CIDR
192.168.1.0/27
IP Lookup
Binary Representation & Full Details
Show
Network
11000000.10101000.00000001.00000000
Broadcast
11000000.10101000.00000001.00011111
Subnet Mask
11111111.11111111.11111111.11100000
Wildcard
00000000.00000000.00000000.00011111
Legend
Network bits (27)    Host bits (5)
Common CIDR Reference
PrefixSubnet MaskTotal IPsUsable HostsCommon Use
/8 255.0.0.0 16,777,216 16,777,214 Class A — large ISP / enterprise
/16 255.255.0.0 65,536 65,534 Class B — campus / data centre
/24 255.255.255.0 256 254 Class C — typical LAN
/25 255.255.255.128 128 126 Half a /24 — department split
/26 255.255.255.192 64 62 Quarter /24 — small segment
/27 255.255.255.224 32 30 Small office / VLAN
/28 255.255.255.240 16 14 Micro-segment / DMZ
/29 255.255.255.248 8 6 Server cluster / transit
/30 255.255.255.252 4 2 Point-to-point WAN link
/31 255.255.255.254 2 2 P2P link (RFC 3021)
/32 255.255.255.255 1 1 Host route / loopback
Instant calculation
No data stored
No sign-up needed

What This Tool Calculates

Enter any IPv4 address with a CIDR prefix length and this calculator instantly derives every subnet property: the network address, broadcast address, first and last usable host addresses, subnet mask in dotted-decimal notation, wildcard mask, total address count, usable host count, IP class, and whether the block is private or public. You can enter any host IP within a subnet — not just the network address — and the calculator applies the subnet mask automatically to find the correct network boundary. The binary representation panel shows network bits and host bits colour-coded so the /prefix boundary is immediately visible.

Network & Broadcast Address

The first and last addresses of any subnet, automatically derived by applying the subnet mask to the input IP.

Usable Host Range

First and last assignable host addresses, with total usable host count — accounting for /31 and /32 special cases.

Subnet & Wildcard Masks

Subnet mask in dotted-decimal and its bitwise inverse (wildcard mask) for use in Cisco ACLs and OSPF configurations.

Binary Representation

Network and broadcast addresses in binary with network bits highlighted in purple and host bits in grey.

How IPv4 Subnetting Works

Every IPv4 address is 32 bits long, written as four octets in dotted-decimal notation. CIDR notation adds a slash and a prefix length — the number of leading bits reserved for the network portion. The remaining bits identify individual hosts within that network. A /24 means 24 network bits and 8 host bits: 2⁸ = 256 total addresses, of which 254 are usable (the network address and broadcast address are reserved).

The subnet mask is derived by setting the first n bits to 1 and the remaining bits to 0. For /24 this produces 11111111.11111111.11111111.00000000 in binary, which is 255.255.255.0 in dotted-decimal. To find the network address for any host IP, apply a bitwise AND between the IP and the mask. For example, host 192.168.1.75/24 AND 255.255.255.0 = 192.168.1.0. The calculator does this automatically for whatever host address you enter, so you always see the correct network boundary.

Practical Subnetting Tips

Frequently Asked Questions

What is CIDR notation and how do I read it?

CIDR (Classless Inter-Domain Routing) notation combines an IP address and its prefix length into one string, e.g. 192.168.1.0/24. The number after the slash tells you how many of the 32 bits are fixed as the network portion. The remaining bits identify hosts within that network. A /24 has 8 host bits giving 256 total addresses; a /16 has 16 host bits giving 65,536.

You can enter the CIDR block or any host address within the subnet — the calculator derives the network address automatically by applying the subnet mask to whatever IP you provide. This is particularly useful when you have a device's assigned IP and need to determine its network boundary without manually doing the bitwise AND operation.

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

Every IPv4 subnet reserves two addresses that cannot be assigned to devices. The network address (all host bits set to 0) identifies the subnet itself — it is the first address in the block. The broadcast address (all host bits set to 1) is used to send traffic to every device on the subnet simultaneously — it is the last address.

A /24 has 256 total addresses, minus these two reservations, leaving 254 usable host addresses. The exception is /31 (RFC 3021), which eliminates these reservations entirely for point-to-point links between routers, and /32, which represents a single host route with exactly one address.

What is a wildcard mask and how is it different from a subnet mask?

The subnet mask and wildcard mask express the same network boundary in opposite conventions. In a subnet mask, 1 bits indicate the network portion (must match exactly). In a wildcard mask, 0 bits indicate positions that must match, and 1 bits are "don't care" positions that can be anything.

A /24 subnet mask is 255.255.255.0; its wildcard is 0.0.0.255. Wildcard masks appear in Cisco ACLs, OSPF network statements, and some firewall syntaxes. This calculator outputs both automatically for any prefix you enter — copy them directly into your network device configuration.

What are private IP ranges and why can't they be routed on the internet?

RFC 1918 defines three IP ranges reserved for private network use: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Internet routers are configured to drop packets destined for these ranges, since they are not globally unique — millions of private networks can all use 192.168.1.0/24 without conflict because those packets never leave the local network.

NAT (Network Address Translation) at the router boundary translates private IPs to a single public IP for outbound internet communication. This calculator flags whether any subnet you enter falls within private or public address space. Additional reserved ranges include 127.0.0.0/8 (loopback) and 169.254.0.0/16 (link-local / APIPA), which are also flagged as private.

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

These small prefixes serve distinct purposes. A /30 gives 4 total addresses and 2 usable hosts — the traditional choice for point-to-point WAN links between routers, where only two interfaces need addressing. A /31 (RFC 3021) provides exactly 2 addresses with no network or broadcast reservation, making both addresses fully routable — modern routers support this for point-to-point links, saving 2 addresses versus /30.

A /32 is a host route representing a single IP, used for loopback interfaces, virtual IPs (VIPs), and specific host entries in routing tables. After assigning addresses from these small subnets, verify connectivity with our Ping Test and confirm open ports with Port Checker.

How do I calculate how many subnets I can create from a larger block?

To subdivide a larger block, you borrow bits from the host portion. Borrowing n bits from a /24 creates 2ⁿ subnets, each with a longer prefix. Borrowing 2 bits from a /24 gives 4 subnets of /26 (62 usable hosts each); borrowing 4 bits gives 16 subnets of /28 (14 usable hosts each).

The total address count stays constant — you are reorganising how they are divided. Click any prefix in the CIDR reference table above to instantly compare how the host count and ranges change across different prefix lengths. For verifying whether a specific IP falls within a subnet you have planned, enter the host IP and prefix here — the calculator applies the mask and shows the exact network boundary.

What does "IP class" mean in the results?

Before CIDR existed, IPv4 addresses were divided into classes based on the first octet. Class A (1–127): the first octet is the network, leaving 24 host bits. Class B (128–191): the first two octets form the network, leaving 16 host bits. Class C (192–223): the first three octets form the network, leaving 8 host bits. Class D (224–239) is multicast; Class E (240–255) is reserved.

Classful addressing has been replaced by CIDR since the 1990s, but the Class designation remains a useful shorthand for understanding which RFC 1918 private range you are working in and what scale of network it was originally designed for. Modern routing ignores class entirely in favour of the explicit prefix length in CIDR notation.

Can I enter a host address instead of the network address?

Yes. Enter any host IP within a subnet — for example 10.0.5.37/22 — and the calculator applies the subnet mask automatically to find the correct network address (10.0.4.0). This is particularly useful when troubleshooting: if you have a device's assigned IP and want to confirm its network range, broadcast address, and whether another IP falls within the same subnet, paste the host IP and prefix directly.

After confirming the network range, investigate IP ownership with our ASN Lookup and geolocation with IP Geolocation. For verifying connectivity from the network address, use our Ping Test.