nicetool.dev logo

Subnet Calculator

Enter an address like 192.168.1.10/24, 10.0.0.1 255.255.0.0 or an IPv6 prefix. A bare IPv4 address is treated as /24.

Examples:
Address192.168.1.10
CIDR block192.168.1.0/24
Netmask255.255.255.0
Wildcard mask0.0.0.255
Network192.168.1.0
Broadcast192.168.1.255
Usable hosts192.168.1.1 - 192.168.1.254
Addresses256
Usable254
ClassC
TypePrivate (RFC 1918)
Address (binary)11000000.10101000.00000001.00001010
Mask (binary)11111111.11111111.11111111.00000000
Network (binary)11000000.10101000.00000001.00000000
Hex0xC0A8010A
Integer3232235786

Split into subnets

#SubnetHost rangeBroadcastUsable
1192.168.1.0/25192.168.1.1 - 192.168.1.126192.168.1.127126
2192.168.1.128/25192.168.1.129 - 192.168.1.254192.168.1.255126

IPv4 CIDR cheat sheet

PrefixNetmaskAddressesUsable
/8255.0.0.016,777,21616,777,214
/12255.240.0.01,048,5761,048,574
/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

What is a subnet and CIDR notation?

A subnet is a block of IP addresses that share the same leading bits. CIDR notation writes the block as an address plus the number of fixed bits, so 192.168.1.0/24 means the first 24 bits identify the network and the last 8 bits number up to 256 addresses. The first address is the network itself and the last is the broadcast address, which leaves 254 usable hosts. Network engineers, cloud architects (AWS VPC, Azure, GCP) and anyone writing firewall rules use these numbers every day.

Features

  • • IPv4 with CIDR prefix or dotted netmask, plus IPv6 prefixes
  • • Network, broadcast, usable host range, wildcard mask and address class
  • • Detects private, CGNAT, loopback, link-local, multicast and documentation ranges
  • • Binary, hex and integer views of the address and mask
  • • Split a block into smaller subnets and a /8 to /32 cheat sheet

Calculated locally

All subnet math runs in your browser. Internal IP ranges you type are never sent to a server or logged.

IPv4 + IPv6, 100% client-side.

How to use the Subnet Calculator

  1. 1

    Enter an IPv4 address with a prefix (192.168.1.10/24) or a netmask (192.168.1.10 255.255.255.0), or an IPv6 address such as 2001:db8::1/64.

  2. 2

    Read the results: network address, broadcast, usable host range, number of addresses, netmask, wildcard mask, class and the address type (private, public, CGNAT, loopback and so on).

  3. 3

    Check the binary view to see exactly which bits belong to the network and which to the hosts.

  4. 4

    For IPv4, use "Split into subnets" to divide the block into smaller networks, or look up any prefix in the CIDR cheat sheet at the bottom.

Practical examples

Planning a cloud VPC

A VPC of 10.0.0.0/16 can be split into /24 subnets: 256 networks of 254 usable hosts, for example one per availability zone and tier. Note that AWS reserves 5 addresses in each subnet.

Writing firewall rules

Security groups and iptables rules expect CIDR notation. Check that 172.16.0.0/12 really covers 172.31.255.255 before you allow or block it.

Cisco ACLs and OSPF

Cisco access lists and OSPF network statements use wildcard masks, the inverse of the netmask. For a /26 network the wildcard is 0.0.0.63.

Home and office networks

Find out whether two devices are on the same subnet, how many devices a 192.168.1.0/24 router network can hold, or why an address from 100.64.0.0/10 means your ISP uses carrier-grade NAT.

Frequently asked questions

Why are there 2 fewer usable hosts than addresses?+

In a normal IPv4 subnet the first address identifies the network and the last one is the broadcast address, so neither can be assigned to a device. /31 point-to-point links and /32 single hosts are the exceptions (RFC 3021).

What is a wildcard mask?+

The bitwise inverse of the netmask: 255.255.255.0 becomes 0.0.0.255. A 0 bit means "must match" and a 1 bit means "any value". It is used in Cisco ACLs and OSPF.

Which ranges are private?+

RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks. They are not routed on the internet and need NAT to reach it. For IPv6, fc00::/7 (unique local) plays a similar role.

Why is a /64 the standard IPv6 subnet?+

IPv6 autoconfiguration (SLAAC) expects 64 bits for the interface identifier, so LANs use /64 networks even though each one holds about 18 quintillion addresses.