VMHeaven

Free tool · runs in your browser

Subnet calculator for IPv4 and IPv6

Free subnet and CIDR calculator for IPv4 and IPv6: network and broadcast address, netmask, wildcard, usable host range, host count and subnet splits.

Address and prefix

/24
Examples:

192.168.1.0/24 — IPv4

Private (RFC 1918)
Network address
192.168.1.0
CIDR notation
192.168.1.0/24
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Broadcast address
192.168.1.255
Usable host range
192.168.1.1 – 192.168.1.254
Usable hosts
254
Total addresses
256
Address type
Private (RFC 1918)
Historic class
C
Reverse DNS name
10.1.168.192.in-addr.arpa
Address as hex
0xC0A8010A
Address as integer
3232235786

In binary · network bits in bold

Address
11000000.10101000.00000001.00001010
Subnet mask
11111111.11111111.11111111.00000000
Network
11000000.10101000.00000001.00000000

Split into smaller subnets

/26

192.168.1.0/24 holds 4 subnets of /26, each with 64 addresses.

#SubnetRange
1192.168.1.0/26192.168.1.0 – 192.168.1.63
2192.168.1.64/26192.168.1.64 – 192.168.1.127
3192.168.1.128/26192.168.1.128 – 192.168.1.191
4192.168.1.192/26192.168.1.192 – 192.168.1.255

How to read the result

Type an address with its prefix — 192.168.1.10/24, 10.0.0.1 255.0.0.0 or 2001:db8::/48 — and the calculator splits it into the network it belongs to. The minus and plus buttons make the network larger or smaller one bit at a time.

  • Network address is the first address of the block, with every host bit set to 0. Routes and firewall rules name a network by it: 192.168.1.0/24.
  • Broadcast address is the last address, with every host bit set to 1. Like the network address it cannot be given to a host — except in a /31 and a /32, which have neither.
  • Usable host range is everything between the two: the addresses you can assign to servers, routers and containers.
  • Subnet mask and wildcard mask say the same thing as the prefix length, in the two notations older tools expect. A UFW firewall rule takes the prefix (ufw allow from 10.0.0.0/24); a Cisco access list takes the wildcard.
  • Address type says whether the address is public or comes from a private, shared or reserved range — useful before you open a port to it or expect it to be reachable.

Below the details, Split into smaller subnets lists the blocks a network divides into — a /24 into four /26, a /48 into 65,536 /64 prefixes — for planning VLANs, container networks or the tunnel network of a WireGuard server.

IPv4 CIDR cheat sheet

Every prefix length from /8 to /32 with its netmask, wildcard and size.

PrefixSubnet maskWildcardAddressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/9255.128.0.00.127.255.2558,388,6088,388,606
/10255.192.0.00.63.255.2554,194,3044,194,302
/11255.224.0.00.31.255.2552,097,1522,097,150
/12255.240.0.00.15.255.2551,048,5761,048,574
/13255.248.0.00.7.255.255524,288524,286
/14255.252.0.00.3.255.255262,144262,142
/15255.254.0.00.1.255.255131,072131,070
/16255.255.0.00.0.255.25565,53665,534
/17255.255.128.00.0.127.25532,76832,766
/18255.255.192.00.0.63.25516,38416,382
/19255.255.224.00.0.31.2558,1928,190
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

Private and reserved IPv4 ranges

These blocks never appear as a public address on the internet. A server’s public interface has an address outside all of them; inside a LAN, a VPN or a container host you choose from the first three.

RangeUsed for
10.0.0.0/8Private networks (RFC 1918) — large LANs, VPNs, cloud VPCs
172.16.0.0/12Private networks (RFC 1918) — Docker's default bridge networks come from here
192.168.0.0/16Private networks (RFC 1918) — most home and office routers
100.64.0.0/10Carrier-grade NAT (RFC 6598): addresses an ISP gives its routers, shared by many customers
127.0.0.0/8Loopback — the machine itself
169.254.0.0/16Link-local — what a host gives itself when DHCP fails
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24Documentation and examples

IPv6 prefixes in practice

IPv6 is calculated the same way, only with 128 bits instead of 32, which is why the calculator shows the size of a large prefix as a power of two. Three sizes come up again and again: a /64 is one network segment, because stateless autoconfiguration needs 64 bits for the interface identifier; a /56 holds 256 of those, and a /48 holds 65,536. Addresses starting with fd are unique local addresses, IPv6’s counterpart to the private IPv4 ranges, and fe80::/10 is link-local: every interface has one, and it never leaves the local link.

There is no broadcast address in IPv6 — multicast replaced it — so every address of a prefix is usable, and the calculator shows the first and the last address instead of a host range.

Frequently asked

How do I calculate the number of hosts in a subnet?

Subtract the prefix length from 32 to get the number of host bits and raise 2 to that power: a /24 has 2^8 = 256 addresses. The first is the network address and the last the broadcast address, which leaves 254 usable hosts. A /31 is the exception — RFC 3021 lets both of its addresses be used on a point-to-point link — and a /32 is a single host.

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) writes a network as an address, a slash and the number of leading bits that identify the network, as in 192.168.1.0/24. It replaced the fixed class A, B and C networks in 1993 and is how routers, firewalls and server panels express address ranges today.

What is the difference between a subnet mask and a wildcard mask?

A subnet mask has a 1 for every network bit — 255.255.255.0 for a /24. A wildcard mask is its inverse, with a 1 for every bit that may vary — 0.0.0.255. Cisco-style access lists use the wildcard form; Linux, Windows and most firewalls take the prefix length or the subnet mask.

How many addresses are in an IPv6 /64, and why is it the usual subnet size?

A /64 holds 2^64 addresses, about 18.4 quintillion. Stateless address autoconfiguration (SLAAC) needs exactly 64 bits for the interface identifier, so an IPv6 LAN segment is a /64 almost by definition. Larger blocks such as a /56 or /48 exist so that one site can have 256 or 65,536 of those segments.

Is anything I enter sent to a server?

No. The calculator runs entirely in your browser. The address you enter is kept in the part of the page address after the # so that you can share the result, and browsers never send that part to the server.

Related guides

More free tools

All tools