Subnet Calculator (IPv4 and IPv6)

Type an address with a prefix or a mask. Get the network, broadcast, first and last usable host, host count and the mask in binary. Then split it into smaller subnets in one click. Works for IPv6 too.

How to use this tool

  1. Enter an address like 10.20.0.0/22, or an address and a mask like 192.168.1.77 255.255.255.0. For IPv6 use 2001:db8::/48.
  2. Read the result: network address, broadcast, the usable host range and how many hosts fit.
  3. To cut it up, pick a smaller prefix in the split option. A /22 into /24s gives 4 networks, each listed with its own range.

Quick mental check

Each step of the prefix halves the size. /24 has 256 addresses, /25 has 128, /26 has 64. Usable hosts are the total minus 2, one for the network address and one for broadcast. /31 is the exception, used on point to point links where both addresses are usable (RFC 3021).

IPv6 has no broadcast and you almost never count hosts. You count networks: a /48 holds 65,536 /64 subnets, and every LAN should be a /64 so SLAAC works.

Subnetting guide: masks, CIDR and IPv6

How to calculate a subnet

Enter an address with a prefix like 192.168.10.77/26. The network address is the address with all host bits zero, the broadcast with all host bits one, usable hosts are everything in between. /26 has 64 addresses, 62 usable: 192.168.10.64 to .127, hosts .65 to .126.

Subnet mask cheat sheet

/24 = 255.255.255.0, 254 hosts. /25 = .128, 126. /26 = .192, 62. /27 = .224, 30. /28 = .240, 14. /29 = .248, 6. /30 = .252, 2. /16 = 255.255.0.0, 65,534. /8 = 255.0.0.0, about 16.7 million.

CIDR notation explained

The number after the slash is how many bits are the network part. /24 means the first 24 of 32 bits are fixed, 8 are for hosts. Each step up halves the size, each step down doubles it.

How many hosts in a /24, /27 or /30?

Hosts = 2 to the power of (32 minus prefix), minus 2 for network and broadcast. /24: 256 minus 2 = 254. /27: 32 minus 2 = 30. /30: 4 minus 2 = 2, used on router links. /31 has 2 usable addresses with no broadcast (RFC 3021), /32 is a single host.

How to split a network into subnets

Pick a smaller prefix in the split option. A /24 into four /26: .0, .64, .128, .192. A /22 into four /24. Plan bigger subnets first, then fill smaller ones in the gaps, so blocks stay aligned.

IPv6 subnetting: /48, /56 and /64

An organisation often gets a /48, a home line a /56 or /64. Every LAN should be a /64. A /48 holds 65,536 /64 subnets, a /56 holds 256. You count networks in IPv6, not hosts.

Private IP ranges

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private (RFC 1918). 100.64.0.0/10 is for carrier NAT. 169.254.0.0/16 is link local, the address a device gives itself when DHCP fails.

Is this IP in my subnet?

Enter the subnet and see the host range: an IP inside that range is in the subnet. Two devices with different subnet masks on the same network can see each other one way but not the other, so check both masks match.

Subnetting for cloud VPCs

AWS, Azure and Google reserve some addresses in each subnet (AWS keeps 5). Size VPC subnets with room to grow, a /24 per subnet is common. For Kubernetes pod and service ranges use the K8s CIDR planner.

Subnet calculator for IPv4: worked example

Take 10.20.5.130/23. A /23 has 512 addresses, so networks start every 2 in the third octet: 10.20.0.0, 10.20.2.0, 10.20.4.0. Our address falls in 10.20.4.0/23. Broadcast is 10.20.5.255, usable hosts 10.20.4.1 to 10.20.5.254, 510 in total. The tool does this for you, but knowing the steps helps when you plan on paper.

How to find the network address from an IP and mask

Write the IP and the mask in binary and AND them bit by bit, where both are 1 the result is 1. In practice: find the “interesting” octet (the one where the mask is not 255 or 0), take the block size (256 minus that mask octet), and round the IP octet down to a multiple of the block size.

Wildcard mask calculator

A wildcard mask is the subnet mask flipped: 255.255.255.0 becomes 0.0.0.255, /26 becomes 0.0.0.63. Cisco ACLs and OSPF use wildcard masks. Subtract each mask octet from 255 to get it.

Subnet mask for 100, 500 or 1000 hosts

100 hosts: /25 (126 usable). 200 hosts: /24 (254). 500 hosts: /23 (510). 1000 hosts: /22 (1022). 2000 hosts: /21 (2046). Always leave room, a network that is 90 percent full on day one will be a problem in a year.

Supernetting and route summarization

Joining networks into one bigger prefix: 192.168.0.0/24 to 192.168.3.0/24 sum up to 192.168.0.0/22. It only works when the blocks are next to each other and aligned. Routers use it to keep routing tables short.

VLSM: different sized subnets in one block

Variable length subnet masking splits one block into subnets of different sizes: a /26 for staff, a /27 for printers, a /30 for the router link. Allocate the biggest first, at the start of the block, then the smaller ones after it, so nothing overlaps.

Default gateway and the first usable IP

By habit the router takes the first usable address, like .1 in a /24, but any address in the range works. All devices in the subnet must use an address in that range and the same mask, or they can not reach the gateway.

IPv6 subnet calculator: how prefixes split

Each hex digit is 4 bits. Going from /48 to /52 gives 16 subnets, /48 to /56 gives 256, /48 to /64 gives 65,536. Change the digits after the prefix to number them: 2001:db8:1234:0001::/64, …:0002::/64 and so on. Keep nibble boundaries (multiples of 4) to make addresses readable.

Subnet calculator for home networks

Most routers use 192.168.0.0/24 or 192.168.1.0/24, enough for 253 devices. Add a separate guest network or VLAN for smart home devices so a hacked plug can not reach your laptops.

Overlapping subnets and VPN problems

If home and office both use 192.168.1.0/24, a VPN can not route between them. Pick less common ranges for offices, like 10.42.0.0/16, to avoid clashes.

Frequently asked questions

Is 192.168.1.77/24 a network?

No, it is a host inside 192.168.1.0/24. The tool works out the real network for you, so you can paste any address from the range.

Why can I not use a /64 split smaller on a LAN?

You can, but SLAAC and many devices expect exactly /64. Smaller is fine for links between routers.

Planning Kubernetes pod and service ranges?

Use the Kubernetes CIDR planner, it checks overlaps between node, pod and service networks.

Just need mask to prefix?

The CIDR to subnet mask converter does only that, faster.

Related tools