Subnet Calculator

Compute network address, broadcast, netmask, wildcard, usable hosts and IP class from any IPv4 CIDR. IPv6 prefix analysis included.

or enter separately

How it works

A subnet calculator turns a single IP address and a prefix length into the full picture of the network it belongs to. On the IPv4 tab, either paste a complete CIDR block such as 192.168.1.10/24 or type the address and pick a prefix from the dropdown — the two inputs stay in sync. Click Calculate and the tool masks the address down to its network address and derives everything else from there.

The output table reads top to bottom as the anatomy of the block:

  • Network address — the first address, identifying the subnet itself. It is never assigned to a host.
  • Broadcast address — the last address, reaching every host on the subnet at once. Also never assigned to a host.
  • Subnet mask and wildcard mask — the mask marks the network bits (e.g. 255.255.255.0); the wildcard is its inverse (0.0.0.255) and is what ACLs and OSPF configs on Cisco-style gear actually expect.
  • First / last usable host — the assignable range for devices, in between the network and broadcast addresses.
  • Usable hosts — total addresses minus the two reserved ones, so a /24 gives 254, not 256.
  • IP class and scope — the legacy A–E class of the address, plus whether it is public, RFC 1918 private, loopback, or link-local.

Two prefixes are special-cased because the “minus two” rule does not apply: a /31 reports 2 usable hosts for point-to-point links (RFC 3021), and a /32 reports 1, representing a single host route. Use the results to size a subnet before you deploy it, sanity-check that a firewall rule covers the range you think it does, or confirm which addresses a DHCP scope may hand out. Copy the full table with the Copy button. The IPv6 tab takes a prefix like 2001:db8::/48, expands the shorthand to full notation, and reports host bits, total addresses (2128−prefix), and how many /64 subnets the block contains.

IPv4 CIDR prefix reference

Every common prefix, its dotted-decimal mask, total addresses, and usable hosts. Usable hosts are total minus the network and broadcast addresses, except where noted.

CIDRSubnet maskTotal addressesUsable hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 (point-to-point, RFC 3021)
/32255.255.255.25511 (host route)
/23255.255.254.0512510
/22255.255.252.01,0241,022
/21255.255.248.02,0482,046
/20255.255.240.04,0964,094
/16255.255.0.065,53665,534
/8255.0.0.016,777,21616,777,214

IPv4 vs IPv6. IPv4 addresses are 32 bits (about 4.3 billion total), which is why private ranges and the two reserved addresses per subnet matter. IPv6 addresses are 128 bits, so a single /64 already holds 264 addresses — there is no broadcast address and no reason to conserve host space. The near-universal convention is to give every LAN a full /64 and subnet only on the network side of the prefix.

Frequently asked questions

Why does a /24 have 254 usable hosts and 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. Neither can be assigned to a device, leaving 254 usable host addresses. The same “minus two” rule applies to every ordinary IPv4 subnet.

What is the difference between a subnet mask and a wildcard mask?

A subnet mask marks the network bits with ones (255.255.255.0), while a wildcard mask is its bit-for-bit inverse and marks the host bits with ones (0.0.0.255). Wildcard masks are what Cisco access control lists and OSPF network statements expect, so this tool shows both.

Which address ranges are private?

RFC 1918 reserves three private ranges: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These are not routed on the public internet and are safe to reuse internally behind NAT. The tool also flags loopback (127.0.0.0/8) and link-local (169.254.0.0/16) addresses.

Can I use a /31 for a link between two routers?

Yes. RFC 3021 allows a /31 on point-to-point links, using both addresses as usable hosts instead of reserving one for network and one for broadcast. It saves addresses on serial and transit links where only two endpoints exist, and this calculator reports 2 usable hosts for a /31 accordingly.

Why doesn't IPv6 show usable hosts or a broadcast address?

IPv6 abandons broadcast entirely in favour of multicast, so there is no broadcast address to reserve. A standard /64 holds 264 addresses — far more than any LAN needs — so the tool reports total addresses and /64 subnet counts rather than a usable-host figure.

This calculator runs entirely in your browser. Nothing you type is sent to a server, logged, or stored — the math happens locally in JavaScript. Results follow standard IPv4/IPv6 rules; always confirm host counts against your platform, since some equipment treats reserved addresses differently.

Related tools