DNSLab

Subnet Calculator

CIDR → network, broadcast, mask, host range.

IPv4 Subnet Calculator

IP address
192.168.1.1
CIDR notation
192.168.1.0/24
Network address
192.168.1.0
Usable host range
192.168.1.1 – 192.168.1.254
Broadcast address
192.168.1.255
Total addresses
256
Usable hosts
254
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Binary subnet mask
11111111.11111111.11111111.00000000
IP class
C
IP type
Private (RFC 1918)

IPv6 Subnet Calculator

Full address
2001:0db8:85a3:0000:0000:8a2e:0370:7334
CIDR notation
2001:db8:85a3::/64
Network address
2001:db8:85a3::
First address
2001:db8:85a3::
Last address
2001:db8:85a3:0:ffff:ffff:ffff:ffff
Total addresses
2^64 (18446744073709551616)
IP type
Documentation (RFC 3849)

CIDR / netmask reference (IPv4)

PrefixNetmaskUsable hosts
/00.0.0.04,294,967,294
/1128.0.0.02,147,483,646
/2192.0.0.01,073,741,822
/3224.0.0.0536,870,910
/4240.0.0.0268,435,454
/5248.0.0.0134,217,726
/6252.0.0.067,108,862
/7254.0.0.033,554,430
/8 · A255.0.0.016,777,214
/9255.128.0.08,388,606
/10255.192.0.04,194,302
/11255.224.0.02,097,150
/12255.240.0.01,048,574
/13255.248.0.0524,286
/14255.252.0.0262,142
/15255.254.0.0131,070
/16 · B255.255.0.065,534
/17255.255.128.032,766
/18255.255.192.016,382
/19255.255.224.08,190
/20255.255.240.04,094
/21255.255.248.02,046
/22255.255.252.01,022
/23255.255.254.0510
/24 · C255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522
/31255.255.255.2540
/32255.255.255.2550

Quick answer

Subnet Calculator takes an IP address in CIDR notation (like 192.168.1.0/24) and returns the network address, broadcast address, subnet mask, and the range of usable host IPs. It's the quick way to see how many hosts a subnet holds and where its boundaries fall.

This subnet calculator turns a CIDR block like 192.168.10.0/26 into the numbers you actually need to configure a network: the network address, the broadcast address, the subnet mask, the wildcard mask, and the first and last usable host addresses. It also reports how many hosts the block can hold. Instead of doing binary math by hand every time you carve up an address space, you paste one CIDR and read the answer. It is handy when planning VLANs, writing firewall rules, sizing DHCP scopes, or double-checking a range before you commit it to a router config.

How it works

A CIDR block is an IP address plus a prefix length, such as /26. The prefix says how many leading bits are fixed as the network portion; the rest identify hosts. The calculator converts the mask (/26 = 255.255.255.192) to binary, ANDs it with your address to find the network address, then sets the host bits to all ones for the broadcast. Usable hosts are everything between those two, so a /26 gives 64 total addresses and 62 usable ones.

How to read the results

The network address is the first address in the block and names the subnet itself; it is not assigned to a device. The broadcast address is the last and reaches every host at once. The usable range sits between them, and that is what you hand out to servers, gateways, and DHCP. The wildcard mask (the inverse of the subnet mask) is what many access lists and OSPF configs expect, so it is shown alongside the standard mask.

Why it matters

Getting a subnet wrong causes quiet, confusing failures: a host with a mismatched mask can reach some neighbors but not others, and overlapping ranges break routing without an obvious error. Sizing also matters, because a /24 wastes addresses on a link that needs four IPs while a /30 leaves no room to grow. Checking the block first means your gateway, DHCP pool, and firewall rules all agree on where the network starts and ends.

Frequently asked questions

Why does a /24 have 254 usable hosts, not 256?
A /24 contains 256 addresses, but two are reserved. The first is the network address that identifies the subnet, and the last is the broadcast address used to reach all hosts at once. Neither can be assigned to a device, leaving 254 usable. The same rule applies to every prefix: usable hosts equal total addresses minus two, down to /30.
What is the difference between a subnet mask and a wildcard mask?
They are inverses of each other. A subnet mask like 255.255.255.0 marks network bits with ones, and interfaces use it to decide what is local. A wildcard mask flips that to 0.0.0.255, marking the bits that are allowed to vary. Cisco access lists, OSPF, and EIGRP configs expect the wildcard form, which is why the calculator shows both.
What do /31 and /32 mean, and are they usable?
A /32 is a single host address, common for loopbacks and precise firewall or routing rules. A /31 is a two-address block with no separate network or broadcast address; per RFC 3021 both addresses are usable, which suits point-to-point links between two routers. Standard host-counting rules do not apply to these two prefixes, so treat them as special cases.
Subnet Calculator · DNSLab