IP Subnet Calculator: CIDR, Subnet Mask, Wildcard Mask, Host Range

Enter an IP with CIDR, dotted subnet mask, wildcard mask, or required hosts to calculate network address, broadcast, usable range, wildcard mask, and address count. Everything runs locally in your browser.

Calculator inputs

Accepts IPv4 or IPv6 CIDR, IPv4 plus subnet mask, IPv4 plus wildcard mask, and host-count shorthand like 10.40.50.60 #52.

Separate IPv4 controls

Use whichever mask format you already have. Changing the prefix updates the subnet mask.

Enter required hosts to find the smallest IPv4 subnet, or enter required subnets with a parent prefix to find the child prefix.

The table shows the first generated child subnets when a split would produce many rows.

Results

Per-row copy buttons are available after calculation.
Results will appear here.

Advertisement

Worked examples

Accuracy notes: This calculator uses CIDR prefix math, RFC1918 private IPv4 ranges, RFC3021 /31 point-to-point handling, the common IPv6 /64 LAN convention, and the rule that IPv6 has no broadcast address. Runs locally in your browser. Last reviewed: June 30, 2026.

Understanding IP Subnets

Subnetting divides an address space into predictable networks. This calculator translates CIDR notation, subnet masks, wildcard masks, and planning requirements into network address, broadcast address, usable host range, address counts, and split subnet tables.

What is CIDR?

CIDR notation writes a network as IP/prefix, such as 192.168.1.10/24 for IPv4 or 2001:db8::/48 for IPv6. The prefix length tells you how many bits belong to the network portion. A larger prefix (like /28) means a smaller subnet with fewer available addresses, while a smaller prefix (like /16) means a larger subnet.

IPv4 vs IPv6 at a glance

  • IPv4: 32-bit addresses like 203.0.113.25. Includes a broadcast address and a count of usable hosts. IPv4 space is limited, so subnetting and NAT are common.
  • IPv6: 128-bit addresses like 2001:db8::1. No broadcast (uses multicast), and the address space is enormous, making hierarchical planning easier.

Formulas

  • IPv4 total addresses = 2^(32 - prefix).
  • Usual IPv4 usable hosts = 2^(32 - prefix) - 2.
  • IPv6 total addresses = 2^(128 - prefix).
  • Wildcard mask = inverse subnet mask.
  • Network address = IP bitwise AND subnet mask.

Worked /26 example

For 192.168.1.77/26, the subnet mask is 255.255.255.192. The block size is 64, so the /26 blocks in the last octet start at 0, 64, 128, and 192. Address 77 falls in the 192.168.1.64/26 block, broadcast is 192.168.1.127, and the usual usable range is 192.168.1.65 to 192.168.1.126.

How usable hosts are calculated (IPv4)

In IPv4, most subnets reserve the first address as the network address and the last as the broadcast address. That is why usable hosts are usually total - 2. Two special cases are common in real deployments and appear in results:

  • /31: point-to-point, both addresses usable.
  • /32: single host.

How to use this calculator

  1. Enter an IPv4 or IPv6 address and its prefix length.
  2. Choose the appropriate version if prompted.
  3. Review the calculated network, broadcast (IPv4), and usable range.
  4. Use the total hosts and mask to size your subnet.
  5. Adjust the prefix to compare larger or smaller networks.

Choosing a prefix length

  • Smaller number (e.g., /16) → larger network, useful for many devices or growth.
  • Larger number (e.g., /28) → smaller network, good for tight segmentation.
  • IPv6 best practice: LANs use /64; sites often receive /48 or /56 for clean hierarchy.

Complete Reference Tables

IPv4

PrefixSubnet MaskWildcard MaskTotal AddressesUsable HostsNotes
/00.0.0.0255.255.255.2554,294,967,2964,294,967,294Default route / all IPv4
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,646
/2192.0.0.063.255.255.2551,073,741,8241,073,741,822
/3224.0.0.031.255.255.255536,870,912536,870,910
/4240.0.0.015.255.255.255268,435,456268,435,454
/5248.0.0.07.255.255.255134,217,728134,217,726
/6252.0.0.03.255.255.25567,108,86467,108,862
/7254.0.0.01.255.255.25533,554,43233,554,430
/8255.0.0.00.255.255.25516,777,21616,777,214Large allocation
/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,534Common private block size
/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.255256254Common LAN size
/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.342Small point-to-point subnet
/31255.255.255.2540.0.0.122*RFC3021 point-to-point
/32255.255.255.2550.0.0.011*Single host route

*Special cases: /31 point-to-point (2 usable), /32 single host.

IPv6

PrefixAddressesTypical use
/48280Large site allocation
/56272Small site allocation
/64264Standard LAN / SLAAC networks
/1281Single interface address

FAQ

What is a subnet mask?

A subnet mask marks which IPv4 bits are network bits and which bits are host bits. For example, 255.255.255.0 is the dotted mask for /24.

What is CIDR notation?

CIDR writes a network as IP/prefix, such as 192.168.1.10/24. The prefix length is the number of network bits.

How do I calculate usable hosts?

For normal IPv4 subnets, calculate 2^(32 - prefix) total addresses, then subtract 2 for the network and broadcast addresses.

Why does /31 have two usable addresses?

RFC3021 allows both addresses in an IPv4 /31 to be used on point-to-point links, so the calculator reports two usable addresses.

What is a wildcard mask?

A wildcard mask is the inverse of an IPv4 subnet mask. It is common in ACLs because zeros mean fixed bits and ones mean bits that may vary.

What subnet do I need for N hosts?

Use the reverse mode. It finds the smallest prefix where usable hosts are at least the number you enter, including the normal network and broadcast reservations.

What is the difference between IPv4 and IPv6 subnetting?

IPv4 has 32-bit addresses and broadcast addresses. IPv6 has 128-bit addresses, no broadcast, and commonly uses /64 for LANs.

Does IPv6 have broadcast?

No. IPv6 uses multicast instead of broadcast.

5 Fun Facts about IP Subnets

IPv4 is tiny by design

All of IPv4 (4.29 billion addresses) could fit inside a single /8 of IPv6—less than one 256th of one percent of IPv6 space.

Space comparison

/64 is the IPv6 magic number

IPv6 LANs are almost always /64 because SLAAC (stateless autoconfig) assumes 64 host bits for making addresses from MACs.

Auto addressing

Broadcast is an IPv4 thing

IPv6 dropped broadcast entirely and leans on multicast groups instead (e.g., ff02::1 for “all nodes”).

Multicast life

/31 saves addresses

Point-to-point IPv4 links often use /31 so both addresses are usable—no wasted network or broadcast slot.

Link efficiency

World per-capita addresses

IPv6 offers about 4.8×1028 addresses per human on Earth right now; IPv4 offers fewer than one per person.

Scale shock

Explore more tools