Skip to content
Devtoolry

Subnet Calculator

Calculate IPv4 and IPv6 subnets online: network and broadcast address, usable host range, subnet mask, wildcard and binary. Split a CIDR block into subnets.

Runs in your browser · Nothing uploaded · No sign-up

Something not working, or missing a feature? Send feedback

About the Subnet Calculator

The Subnet Calculator works out everything about an IPv4 or IPv6 network from an address and a prefix: the network and broadcast addresses, the usable host range, the subnet mask and wildcard mask, and the binary form. It also splits a block into smaller subnets, which helps when you plan VLANs, cloud VPCs or firewall rules.

Everything runs in your browser, so your input is never uploaded to a server.

How to use the Subnet Calculator

  1. Type an address with a prefix (192.168.1.10/24), with a mask (10.0.0.5 255.255.0.0) or an IPv6 address (2001:db8::1/48).
  2. Change the mask from the list to compare host counts.
  3. Read the network, broadcast, host range, masks and address type, and copy any value.
  4. Use "Split into smaller subnets" to divide the block, for example a /24 into four /26 networks.

IPv4 CIDR cheat sheet

PrefixSubnet maskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/23255.255.254.0512510
/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
/32255.255.255.25511

/31 and /32 count every address as usable (RFC 3021 point-to-point links and single hosts).

Sources: RFC 4632: CIDR, RFC 1918: private address space, RFC 3021: /31 point-to-point links

Examples

A home network

Input

192.168.1.10/24

Result

Network 192.168.1.0 · Broadcast 192.168.1.255
Hosts 192.168.1.1 – 192.168.1.254 (254)
Mask 255.255.255.0 · Wildcard 0.0.0.255
A /20 in private space

Input

172.16.5.4/20

Result

Network 172.16.0.0 · Broadcast 172.16.15.255
Hosts 172.16.0.1 – 172.16.15.254 (4,094)
Mask 255.255.240.0
A dotted mask

Input

10.1.2.3 255.255.255.252

Result

Network 10.1.2.0/30 · 2 usable hosts (10.1.2.1 – 10.1.2.2)
Split a /24 into four

Input

192.168.10.0/24 → /26

Result

192.168.10.0/26, 192.168.10.64/26, 192.168.10.128/26, 192.168.10.192/26

Common mistakes

  • Using the network or broadcast address as a host. In a /24, .0 and .255 cannot be assigned to a device. Start at the first usable host.
  • Overlapping subnets. Two VPCs or VLANs with overlapping ranges cannot be routed to each other. Split one larger block into subnets instead of picking ranges by hand.
  • Cloud reserved addresses. Cloud providers keep extra addresses in every subnet (AWS reserves 5), so fewer hosts are usable than the plain IPv4 count.

Works well with the Subnet Calculator

Frequently asked questions

How many hosts are in a /24?

256 addresses, of which 254 are usable: the first (network address) and the last (broadcast address) are reserved. In general, a /n IPv4 network has 2^(32 − n) addresses and 2 fewer usable hosts.

Why do /31 and /32 have no broadcast address?

A /31 has only two addresses, and RFC 3021 lets point-to-point links use both. A /32 is a single host, used for loopbacks and host routes. The calculator counts 2 and 1 usable hosts for them.

What is a wildcard mask?

The inverse of the subnet mask: 0.0.0.255 for 255.255.255.0. Cisco ACLs and OSPF use wildcard masks, where 1 bits mean "any value".

Which addresses are private?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918) for IPv4, and fc00::/7 (unique local) for IPv6. 100.64.0.0/10 is carrier-grade NAT space. The calculator labels the address type.

Does IPv6 have a broadcast address?

No. IPv6 uses multicast instead, so every address in the range can be assigned. A /64 is the standard size for one LAN segment.