CIDR / Subnet Calculator

Calculate network details for any IPv4 or IPv6 prefix. Enter a CIDR notation like 10.0.0.0/24 or 2001:db8::/32.

IPv4 Subnet Calculator Example

Example calculation for 192.168.1.0/24, a common LAN subnet:

Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Total Addresses256
Usable Hosts254

IPv6 Subnet Calculator Example

Example calculation for 2001:db8::/32, the documentation address block:

Network2001:db8::/32
First Address2001:db8::
Last Address2001:db8:ffff:ffff:ffff:ffff:ffff:ffff
Prefix Length/32
Total Addresses296 (79.2 octillion)
/64 Subnets232 (4.3 billion)

A /32 allocation provides 4.3 billion /64 subnets - enough for a large ISP to assign a unique /64 to every customer.

IP Subnetting Quick Reference

Common IPv4 Subnets

CIDRMaskHosts
/8255.0.0.016,777,214
/16255.255.0.065,534
/24255.255.255.0254
/28255.255.255.24014
/30255.255.255.2522
/32255.255.255.2551

Common IPv6 Allocations

CIDRUseAddresses
/32ISP allocation296
/48Site / customer280
/56Residential272
/64Standard subnet264
/128Single host1

Frequently Asked Questions

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation represents an IP network as an address followed by a slash and a prefix length - for example, 192.168.1.0/24. The prefix length indicates how many leading bits identify the network. A /24 means the first 24 bits are the network portion, leaving 8 bits (256 addresses) for hosts.

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

For IPv4, the formula is 2^(32 - prefix_length). A /24 has 2^8 = 256 addresses (254 usable hosts, minus network and broadcast). For IPv6, it's 2^(128 - prefix_length). A /64 has 2^64 = 18,446,744,073,709,551,616 addresses.

What is a wildcard mask?

A wildcard mask is the inverse of a subnet mask. Where the subnet mask has 1-bits, the wildcard has 0-bits, and vice versa. For a /24, the subnet mask is 255.255.255.0 and the wildcard mask is 0.0.0.255. Wildcard masks are commonly used in ACLs on Cisco routers and firewalls.

What is the difference between IPv4 and IPv6 subnetting?

IPv4 uses 32-bit addresses (prefix lengths /0 to /32), while IPv6 uses 128-bit addresses (prefix lengths /0 to /128). IPv6 subnetting follows the same CIDR principles but with much larger address spaces. The standard IPv6 subnet allocation is /64, providing 2^64 host addresses per subnet - enough that address conservation is generally not a concern.

Need Prefix Data via API?

Look up BGP routes, origin ASN, RPKI status, and geolocation for any prefix programmatically.

API Documentation