Skip to content

IPv4 and IPv6 Subnet Calculator

Enter any IPv4 or IPv6 address in CIDR notation to get the network address, the broadcast or last address in the range, the netmask and how many hosts you can actually use. IPv4 point-to-point and host routes follow RFC 3021, IPv6 point-to-point and host routes follow RFC 6164.

Address family

Prefix from 0 to 32. A host address is accepted too and is snapped down to its containing network.

Usable hosts

254

Network

192.168.1.0/24

Broadcast

192.168.1.255

First host

192.168.1.1

Last host

192.168.1.254

Netmask

255.255.255.0

Wildcard mask

0.0.0.255

Total addresses

256

Splitting this network

1 x /24, 4 x /26, 16 x /28

IPv6 host counts by prefix

Prefix Usable Total Typical use
/48 1208925819614629174706174 1208925819614629174706176 Site allocation, large enterprise
/56 4722366482869645213694 4722366482869645213696 Site sub-allocation
/64 18446744073709551614 18446744073709551616 Standard subnet (SLAAC, the usual VLAN size)
/96 4294967294 4294967296 Point-to-point or compatibility range
/112 65534 65536 Reserved range
/127 2 2 Point-to-point link (RFC 6164)
/128 1 1 Single host (RFC 6164)

IPv6 has no wildcard mask in the sense IPv4 has, because access lists are written in prefix notation rather than against an inverted bitmask. There is no broadcast address either: the highest address of the range is the last usable address and is not excluded, which is why /64 and /127 show different arithmetic than their IPv4 counterparts.

Host counts by prefix

Prefix Usable hosts Total addresses Typical use
/16 65,534 65,536 Transitive routing between sites
/17 32,766 32,768 Transitive routing between sites
/18 16,382 16,384 Transitive routing between sites
/19 8,190 8,192 Transitive routing between sites
/20 4,094 4,096 Transitive routing between sites
/21 2,046 2,048 Department or building segment
/22 1,022 1,024 Department or building segment
/23 510 512 Office or floor LAN
/24 254 256 Office or floor LAN
/25 126 128 Server or IoT segment
/26 62 64 Server or IoT segment
/27 30 32 Point-to-point link
/28 14 16 Point-to-point link
/29 6 8 Point-to-point link
/30 2 4 Point-to-point link

Prefix lengths 0 to 15 are omitted; they exist but no home or small office network uses them.

Frequently Asked Questions

How many usable hosts does a subnet really have?

Two addresses in every IPv4 subnet are reserved: the network address (all host bits zero) and the broadcast address (all host bits one). So a /24 has 256 addresses but 254 usable hosts. The two exceptions are /31, which RFC 3021 defines as a point-to-point link with 2 usable addresses, and /32, a single host route with 1.

What is the difference between netmask and wildcard mask?

The netmask marks which bits of an address are network bits and is used in routing and ACLs. The wildcard mask is the bitwise inverse and is what Cisco and MikroTik RouterOS expect in access lists, where a 0 means 'must match' and a 1 means 'ignore'. A wildcard of 0.0.0.255 is the /24 equivalent.

Why do subnets need to be aligned to their prefix?

A /24 cannot start at 192.168.1.100. The prefix fixes how many leading bits identify the network, so the host bits must all be zero in the network address. 192.168.1.0/24 and 192.168.2.0/24 are valid; 192.168.1.100/24 is not a network, it is a host inside 192.168.1.0/24.

How many hosts does a /24 leave for VLANs and gateways?

254 usable addresses, of which the router interface consumes one. Splitting a /24 into /26s gives four networks of 62 usable hosts each, which is a common pattern for separating management, IoT, guests and servers on one uplink.

How many usable addresses does an IPv6 subnet have?

An IPv6 /64 has 18446744073709551614 usable addresses, because 2^64 is the total and the subnet-router anycast address plus the all-nodes address take two off the top. That number looks absurd next to an IPv4 /24 because IPv6 hands out a whole /64 to a single customer network and expects SLAAC or DHCPv6 to subdivide it internally.

Why does IPv6 have no broadcast address?

IPv6 replaced broadcast with multicast, so there is no reserved all-host bits address. The highest address of the range is simply the last usable address and it is not excluded. That is why the calculator shows the last address for IPv6 instead of a broadcast address, and it is also why no wildcard mask appears: IPv6 access lists are written in prefix notation rather than against an inverted bitmask.

Is a /127 or /128 IPv6 subnet usable?

Yes. RFC 6164 applies the same reasoning to IPv6 that RFC 3021 applies to IPv4: a /127 is a point-to-point link with 2 usable addresses and a /128 is a single host with 1. Treating them like a normal subnet and subtracting two would leave zero addresses, which is why the calculator special-cases both.