Skip to content
← Tools

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

Host counts by prefix

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

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

IPv6 host counts by prefix

Prefix Usable Total
/48 Site allocation, large enterprise 280 - 2 280
/56 Site sub-allocation 272 - 2 272
/64 Standard subnet (SLAAC, the usual VLAN size) 264 - 2 264
/96 Point-to-point or compatibility range 4,294,967,294 4,294,967,296
/112 Reserved range 65,534 65,536
/127 Point-to-point link (RFC 6164) 2 2
/128 Single host (RFC 6164) 1 1

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.

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.